Hypervisor VMware ?

I was looking for a method to detect if a Linux box is a VMware guest as a non-root user without relying upon the installation of VMware tools, for the purpose of scripting and realised that it was simpler than I had expected.

/sbin/lspci | grep VMware 1>/dev/null
if [ $? -eq 0 ]; then
  echo "Running on VMware"
else
  echo "Not running on VMware"
fi
Advertisements
This entry was posted in bash and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s