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!
Hi Mitch,
I have a question concerning the use of WMI-filtering for VM’s in Virtualbox.
As a teacher I would like to prohibit my students to use the external network (or even contacting the host on which the VM’s are running)
As you describe, you can use WMIC for VM’s in Hyper-V, VMWare and Xen. But is this also possible for VM’s in Virtualbox? If so, I could probably configure my VM’s in Virtualbox as NAP-clients (I hope) to prohibit access to the physical network.
I’m just trying to remember what I know from the time I was an MCT in networking trainings till 2013 so it’s been a while… I would love to teach my students some basics about networking. So thanks for your reply and hopefully you have some good news for me.
Kind regards,
Mark Havermans
Breda, Netherlands
Sorry don’t know as I haven’t used VirtualBox for years. Best to try and see what happens. You might also try posting your question to Oracle’s VirtualBox forums here: https://forums.virtualbox.org/
Good luck.