mov ax, 1683h ; Get Current Virtual Machine ID
int 2Fh ; multiplex interrupt
Get Current Virtual Machine ID (Interrupt 2Fh Function 1683h) returns the identifier for the current virtual machine. MS-DOS device drivers, TSRs, and other programs use this function to determine which virtual machine is running. This is especially important for programs that independently manage separate data or execution contexts for separate virtual machines.
This function has no parameters.
The return value is the current virtual-machine identifier in the BX register.
Each virtual machine has a unique, nonzero identifier. Although Windows currently runs in virtual machine 1, programs should not rely on this. Windows assigns the identifier when it creates the virtual machine, and releases the identifier when it destroys the virtual machine. Since Windows may reuse identifiers from previous destroyed virtual machines, programs should monitor changes to virtual machines to ensure no mismatches.