FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 07-24-2008, 11:47 AM
 
Default How to detect whether running on VMware?

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
--
Tony Mountifield
Work: tony@softins.co.uk - http://www.softins.co.uk
Play: tony@mountifield.org - http://tony.mountifield.org
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 07-24-2008, 12:03 PM
Paul Bijnens
 
Default How to detect whether running on VMware?

Tony Mountifield wrote:

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?




This paper show some very interesting tricks:

http://handlers.sans.org/tliston/ThwartingVM*Detection*_Liston_Skoudis.pdf

One simple (but not really foolproof, and only for VMWare) is testing
the MAC address, and look at the OUI bytes; these are assigned to VMWare:

00-05-69
00-0C-29
00-1C-14
00-50-56



_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 07-24-2008, 12:08 PM
Marc-Andre Levesque
 
Default How to detect whether running on VMware?

-----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
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 07-24-2008, 12:14 PM
Ned Slider
 
Default How to detect whether running on VMware?

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.


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 07-24-2008, 01:02 PM
"Marko A. Jennings"
 
Default How to detect whether running on VMware?

On Thu, July 24, 2008 7:47 am, Tony Mountifield wrote:
> 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?

dmidecode | grep -iq " vmware "

This returns 0 if it is a VMware system and 1 it it isn't.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 03:13 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org