9 Replies Latest reply on Aug 21, 2006 12:07 AM by DanielMeyer

    Command to see if Linux guest is running in VMware or not?

    InsaneGeek Hot Shot

      It's a bit of an odd request, but is there a command that can be ran to interrogate a system to see if it's actually running in a VM environment (most likely interrogate the /proc tree)?


      The main reason is that we have software that pushes out standard configurations onto systems, and we need to treat NTP, etc differently on VMware hosts.  I could look for a vmware-tools process running, etc or see if a particular package is installed or a file in /etc exists, but my concern is for a highly-dynamic environment where someone might virtualize it one day and remove it the next.  Someone could mistakenly leave those files on a system after it's been V2P and falsely mark it as running under VMware, so it would be nice to actually see if I'm physically running in a VM or I've just got a config that someone mistakenly forgot to clean up. 


      The /proc/scsi/scsi file shows a disk type of VMware, but I don't really know if that's stable enough for widespread scripting.