19

So I'm running a VM somewhere and want to know what hypervisor the host is running. Any way to check whether it's running KVM or in a container?

The vm is running Ubuntu

1
  • This question should be removed because is a duplicate of the one above, which is more precise and with far more detailed responses. Commented Sep 10, 2020 at 21:47

2 Answers 2

22

Without external tools:

sudo dmidecode | grep -i -e manufacturer -e product -e vendor

or

sudo grep -i -e virtual -e vbox -e xen /var/log/dmesg  # or /var/log/kern.log

should give you enough to go on.

You can see checks for specific platforms in the ImVirt module.

1
  • This doesn't work, at least for xen. It shows the platform's specifications even in a vm. Commented Feb 18, 2019 at 5:07
15

Look at virt-what

stephenm@pc:~$ apt-cache search virt-what
virt-what - detect if we are running in a virtual machine

sudo apt-get install virt-what

sudo virt-what

2
  • This is how facter (puppet) determines the VM type. Commented Sep 18, 2013 at 12:44
  • Simple and concise, this is the best answer for me. Commented Sep 10, 2020 at 21:44

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.