Is there a way to know if the Windows machine I'm working on is virtual or physical? (I'm connecting with RDP to the machine. If it's a virtual machine it is working and handled by VMWare).
-
2see also - http://stackoverflow.com/questions/779723/determine-when-running-in-a-virtual-machine – warren Feb 03 '10 at 13:51
16 Answers
In the CMD window type:
SYSTEMINFO
You will find a line with the following text (or similar):
System Manufacturer: VMware, Inc.
System Model: VMware Virtual Platform
-
5If Hyper V is used you get: System Manufacturer: Microsoft Corporation System Model: Virtual Machine – Gayan Dasanayake Mar 24 '17 at 10:24
-
If it's Windows, just have a look at the hardware screens. It'll have a billion and five VMWare-branded virtual devices.
- 1,791
- 17
- 27
-
Agreed. Since the OP mentioned RDP, it's most likely Windows, so there you go. – mfinni Feb 03 '10 at 14:01
-
-
3Looking at drivers is also works for linux. lsmod would probably return the information that you need. – Seamus Connor Feb 03 '10 at 17:01
-
-
3
If it's handled by VMware, it isn't too difficult at the present moment. This could change in the future.
# dmidecode -s system-manufacturer
VMware, Inc.
- 237,123
- 42
- 477
- 940
- 20,218
- 10
- 67
- 114
-
I get 'dmidecode' is not recognized as an internal or external command on both Windows 7 and 10 ESXi 6.0 VMs. – Andrew S May 08 '18 at 15:59
-
[`dmidecode`](https://www.tecmint.com/how-to-get-hardware-information-with-dmidecode-command-on-linux/) is a linux command used to get information about the hardware. It does not work on Windows. – Jaime Aug 06 '18 at 01:29
-
for `linux` OS this is the best option to detect hardware vs virtual machine.. – Satish Sep 10 '18 at 01:10
In Linux you can also use "virt-what". "virt-what - detect if we are running in a virtual machine".
On Windows, from CMD:
Systeminfo | findstr /i model
returns something like:
System Model: VMware Virtual Platform
[01]: Intel64 Family 6 Model 26 Stepping 5 GenuineInt
- 737
- 5
- 11
- 101
- 1
- 2
On Linux, run this:
$ dmesg |grep -i hypervisor
Hypervisor detected: KVM
- 201
- 2
- 2
-
5for linux you type `dmesg |grep DMI` Virtual Machines: [root@myhost ~]# dmesg |grep DMI
DMI 2.3 present. DMI: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS 090006 05/23/2012 [root@myhost ~]# dmesg |grep -i virtual DMI: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS 090006 05/23/2012 Booting paravirtualized kernel on bare hardware input: Macintosh mouse button emulation as /devices/virtual/input/input1 scsi 0:0:0:0: Direct-Access Msft Virtual Disk 1.0 PQ: 0 ANSI: 4 input: Microsoft Vmbus HID-compliant Mouse as /devices/virtual/input/input4 Physical: [root@backdev1 – gabo34 Apr 10 '14 at 17:00 -
If you are in Windows, as castrocra says, you can run the systeminfo
command from inside a cmd shell, then look for the "BIOS Version".
These are probably real machines:
BIOS Version: Dell Inc. A03, 06/12/2010
BIOS Version: Phoenix Technologies, LTD MS7254 1.08, 08/03/2007
This, on the other hand, is almost certainly a virtual machine:
BIOS Version: VMware, Inc. VMW71.00V.0.B64.1201040214, 04/01/2012
-
1Modern hypervisors can supply arbitrary strings here, making this a not very reliable check. – Michael Hampton Jul 04 '14 at 18:03
-
3Unfortunately this isn't reliable. I'm running a virtual machine but my BIOS is showing as: "Phoenix Technologies LTD 6.00, 16/08/2013" – Gavin Ward Oct 30 '14 at 09:27
-
1
It has been answered, but FWIW you can do this in powershell:
gwmi -q "select * from win32_computersystem"
The "Manufacturer" will be "Microsoft Corporation" and the "Model" will be "Virtual Machine" if it's a virtual machine, or it should display regular manufacturer details if not, e.g. "Dell Inc." and "PowerEdge R210 II" respectively.
- 257
- 1
- 3
- 10
-
Funny. _My_ Windows VM says the Manufacturer and Model are both "Bochs". – Michael Hampton Aug 22 '14 at 02:07
-
1Or in cmd: `wmic computersystem get manufacturer | find "VMware" && echo In VMWare || echo Not in VMWare`. It's faster than `systeminfo`-based solutions. – atzz Mar 03 '15 at 13:13
-
@MichaelHampton Are you using VMs? Which platform - HyperV, VMWare or something else? Seems like the VM is probably being run in a Bochs emulator or something like that. – Richard Hauer Oct 31 '15 at 04:42
On Linux if you prefer to look under /proc
try
cat /proc/cpuinfo | grep flags | grep hypervisor
- 131
- 2
Even simpler - wmic /node: bios get serialnumber
Anything that returns a Dell-style serial number is physical.
It will also return "VMware-42 22 26 a8 dd 6e e3 b3-2e 03 fc 2c 92 ae 2e 89", if it's a virtual machine.
- 11
- 2
-
Sadly, this is not working all the time. Our ESXi servers are running a DELL VMware Image, and all VMs claim to be a Dell hardware server via WMI. The serial number is the DELL service tag. – Tobias Dec 11 '19 at 07:43
There is another option here which describes the official way to do so:
For Windows:
Click Start > Run. Type msinfo32 and press Enter. In the right pane, look for System Manufacturer for 'VMware, Inc.'
- 173
- 6
You could try the "Host Detection" program.
- 8,503
- 26
- 38
-
1This link is broken as of 2019. I found [this page](http://www.codegurus.be/Programming/c++_en.htm) on the site that links to the program page, but *that* link is also broken. – Bacon Bits Dec 26 '19 at 17:25
-
Seems like the last working cached page of this was back in 2007: http://web.archive.org/web/20070401065556/http://www.codegurus.be/codegurus/Programming/virtualpc&vmware_en.htm – David Jan 29 '21 at 01:47
If it's a Unix VM, use imvirt. It's a Perl script that detects VMWare, Xen, and several others.
- 806
- 2
- 6
- 17
One (relatively) simple way to detect key virtualization information is via WMI / WBEM. You can use the root\CIM2 namespace and access the Baseboard class (full of interesting BIOS information) to get a description of the "physical" system. This class often includes information about the motherboard and chassis - manufacture, model, serial number, other.
Run the following command from a command prompt or PowerShell session:
wmic baseboard get manufacturer, product, Serialnumber, version
- 101
- 1
I had the same question and found that there are a lot of processes running with "VM" in the name, for example VMWareTray.exe
- 1
nbtstat -a The outcome will tell you as VMs have a speecific prefix which is 00-50-56-XX-XX-XX. There is also another prefix it uses but I can not remember at the top of my head but I recall Vcenter uses 00-50-56-XX-XX-XX so this ios the one I check only.
I think this is the best way, personally.
-
3...except for when someone manually sets the MAC address to something else – Rex Apr 10 '14 at 18:17
-