Only having terminal access to a server running CentOS 5.7, I had to determine if the server was actually a physical or virtual machine. There are a few methods to do this, however, here are a couple of the easier methods.
dmesg | fgrep Vendor\:\ VMwareVendor: VMware Model: Virtual disk Rev: 1.0
dmesg | grep VendorVendor: VMware Model: Virtual disk Rev: 1.0
dmesg | grep -i vendorVendor: VMware Model: Virtual disk Rev: 1.0
dmesg | grep VMwareDMI: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/22/2008
hda: VMware Virutal IDE CDROM Drive, ATAPI CD/DVD-ROM drive
Vendor: VMware Model: Virtual disk Rev: 1.0
lspci | grep VMware00:0f.0 VGA compatible controller: VMware SVGA II Adapter
rpm -qa | grep vmwxorg-x11-drv-vmware-10.13.0-2.1
rpm -qa | grep vmxorg-x11-drv-vmware-10.13.0-2.1
xorg-x11-drv-vmouse-12.4.0-2.1
and others…
About the Commands
dmesg (for “display message” or “driver message” ) is a command on most Linux and Unix based operating systems that prints the message buffer of the kernel.
lspci is used to display information about PCI buses and devices connected to them.
fgrep means fixed-string grep and is the same as grep -F
grep will search files for lines that match a given pattern.
Sources
http://communities.vmware.com/thread/52192
http://en.wikipedia.org/wiki/Dmesg
http://linux.die.net/man/8/lspci
http://ss64.com/bash/fgrep.html
http://communities.vmware.com/thread/177691