Search My Blog

Sunday, November 14, 2010

virt-what - detect if we are running in a virtual machine

virt-what - detect if we are running in a virtual machine

virt-what is a shell script which can be used to detect if the program is running in a virtual machine.

The program prints out a list of facts about the virtual machine, derived from heuristics. One fact is printed per line.

# virt-what xen xen-domU 

If nothing is printed and the script exits with code 0 (no error), then it can mean either that the program is running on bare-metal or the program is running inside a type of virtual machine which we don't know about or cannot detect.

Most of the time, using this program is the wrong thing to do. Instead you should detect the specific features you actually want to use. (As an example, if you wanted to issue Xen hypervisor commands you would look for the /proc/xen/privcmd file).

Download

Go there...
http://people.redhat.com/~rjones/virt-what/

Don

No comments: