Using WMIC to determine whether Windows is running in a virtual machine

by Mitch Tulloch [Published on 14 Sept. 2011 / Last Updated on 14 Sept. 2011]

How to use the Windows Management Instrumentation Command-line to determine whether Windows is running in a virtual machine.

If you need to determine whether a particular instance of a Windows operating system is installed on a physical machine or a virtual machine, you can use the Windows Management Instrumentation Command-line (WMIC) to do this provided you are dealing with a version of Windows that supports PowerShell. Here is a WMIC command that can determine whether Windows is installed in a virtual machine either Hyper-V, VMware or Xen:

wmic bios get serialnumber, version

For virtual machines running on Hyper-V, the version parameter will include the string VERSION.

For virtual machines running on VMware, the serialnumber parameter will include the string VMware.

For virtual machines running on Xen, the version parameter will include the string Xen.

If you have feedback concerning this tip, please email me. And be sure to check out my website!

The Author — Mitch Tulloch

Mitch Tulloch is a widely recognized expert on Windows administration, networking, and security. He has been repeatedly awarded Most Valuable Professional (MVP) status by Microsoft for his outstanding contributions in supporting users who deploy and use Microsoft platforms, products and solutions. Mitch has published over two hundred articles on different IT websites and magazines, and he has written or contributed to almost two dozen books and is lead author for the Windows 7 Resource Kit from Microsoft Press. For more information, see www.mtit.com .

Latest Contributions

Featured Links