Re: How to detect whether running on VMware?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Marc-Andre Levesque wrote:

-----Original Message-----
From: centos-bounces@xxxxxxxxxx [mailto:centos-bounces@xxxxxxxxxx] 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.

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux