Marc-Andre Levesque wrote:
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Tony Mountifield
Does anyone know how a program, script or shell user can best determine whether the machine is running on bare metal or is a VMware guest?
Cheers Tony
This script does the trick for me on ESX 3 by looking at the (virtual) hardware description. But it probably is not foolproof.
if ( `/sbin/lspci | grep -qi vmware` ) || \ ( `grep -qi vmware /proc/scsi/scsi` ); then echo "This is a Virtual Machine." Fi
Marc-Andre
Alternatively, grep the output from dmidecode for VMware:
dmidecode | grep VMware
You'll get output from VMware Server, I've not tested with other VMware products.