How to check if windows server is a virtual server

Solution 1:

In theory, virtualization is undetectable. By practice, it is, because most virtualization solutions provide means for guest->host communication or do not devices / CPU like physical CPU does. But, means for detecting host are provider dependant.

But, most virtualization solutions provided means, which whom you can communicate with host, like VMWare addins which uses "virtual" (nonexisting) port or Virtual PC, which uses undocumented CPU instructions :)

Programming background: http://www.codeproject.com/KB/system/VmDetect.aspx

Tool: http://www.codegurus.be/codegurus/Programming/virtualpc&vmware_en.htm

Other way is to check for devices, which are specifical to VM, like VMWare includes its name in many devices.

For Xen you can use : http://xen-3.1.sourcearchive.com/documentation/3.1.0/xen-detect_8c-source.html (Should be easy to compile under Win32).

Theretical background: http://thread.gmane.org/gmane.comp.emulators.kvm.devel/22643

Solution 2:

You could check by MAC addresses. If it starts with

  • 00:0C:29 VMWare (auto)
  • 00:50:56 VMWare (manual)
  • 00:16:3e Xen

The VPS provider can change the MAC address ranges (in Xen at least) but most don't bother in my experience.

Solution 3:

An easy attempt on a WMware guest would be to execute "vmic bios get" and search for the keyword 'wmware'. But i don't know what user rights are required. At least it works as administrator.

Another way would be to look after the graphic card driver. It would also have the vmware keyword in it if it has the VMware tools installed.

Solution 4:

Dmidecode will certainly give you some obvious pointers for VMWare, and is easilly called from all manner of scripts.

Eg. the system manufacturer is "VMWare Inc" and the base board is listed as a "reference platform".

DMIDecode site - includes link to dos binaries