Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any way to find out if the linux i'm running (actually installing) is running in a VMWare machine. I need to disable ntp settings if the automated install is done on a virtual machine but keep them enabled if not. VMWare tools are not installed when this check is done.

share|improve this question
Duplicate of… – janneb Nov 1 '10 at 20:08
up vote 7 down vote accepted

If running as root to use dmidecode does not work for your needs, try lspci:

$ /sbin/lspci |grep VMware
00:0f.0 VGA compatible controller: VMware SVGA II Adapter

You (probably) don't particularly care what the virtual video card is, but you're not going to find that answer in real hardware, so you can use it as an identifier.

share|improve this answer

I usually use dmidecode to do exactly that (though you need to have root access to do that). Look for the "BIOS Information" section, it will usually have the "Vendor" or "Version" fields set to "VMWare", "VirtualBox" or something similar.

share|improve this answer

You don't say what approach you're using to do this but you can certainly do it in C.

share|improve this answer
Most of the Linux distributions have dmidecode command which basically does the same. – ipozgaj Nov 1 '10 at 16:25

You can check the MAC address...

When installed in a VM, the MAC address is using the VMWARE range format.

share|improve this answer
Not necessarily. IIRC the MAC is fully configurable even with physical NICs, much less a virtual one. – Piskvor Oct 26 '11 at 14:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.