How to detect a guest system ? Or how to detect which virtualization technology is used by "virt-what" command ?

What is ‘virt-what’ and how is it useful ?

Quite often people come to me with a question “how can we know which virtualization hypervisor is used for this guest “?

Previously I used to point out couple of options (dmidecode..etc) to check whether it is a Xen guest or kvm guest ..etc. but now we have a utility which can be used to identify the hypervisor without much effort. The utility is called “virt-what” .. It is shipped with most of the distributions now. Lets see what this utiltiy does ..

Below is the snip from my F14 system:

[root@humbles-lap ~]# yum install virt-what

Setting up Install Process
Resolving Dependencies
Running transaction check
Package virt-what.x86_64 0:1.3-3.fc14 set to be installed

**************

Installing : virt-what-1.3-3.fc14.x86_64 1/1

Installed:
virt-what.x86_64 0:1.3-3.fc14

Complete!

 

“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. 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.

Currently virt-what can identify below hypervisor guests:

openvz :The guest appears to be running inside an OpenVZ or Virtuozzo container.

kvm: This is KVM.

qemu: This is QEMU.
uml: This is a User-Mode Linux (UML) guest.

virtualbox: This is a VirtualBox guest.
virtualpc: The guest appears to be running on Microsoft VirtualPC.
vmware:The guest appears to be running on VMware.

xen :The guest appears to be running on Xen
xen-dom0: This is the Xen dom0 (privileged domain).
xen-domU: This is a Xen domU (paravirtualized guest domain).
xen-hvm: This is a Xen guest fully virtualized (HVM).

Now, I ran this command in one of my system & below was the output:

[root@host1 ~]# virt-what
xen
xen-dom0
[root@host1 ~]#

Hmmmm. It says it is Xen dom0 or xen hypervisor/host system.

Then I went to another system to see how this will look like ..

[root@HOST2 ~]# virt-what
kvm
[root@HOST2 ~]#

It says it is a KVM guest..

Now, try this in your environment and see what is the output ..

Lets meet in next blog.. Please feel free to ask questions if you have any..