How to tell if I am on a XEN or KVM Server?
Solution 1
If you have sudo
privileges you can run the following command to get information about the "hardware" that CentOS is running on:
sudo lshw
For example, the first few lines of output on one of my computers is:
description: Desktop Computer
product: Virtual Machine
vendor: Microsoft Corporation
A virtual machine from Microsoft? I'm running on Hyper-V.
Solution 2
systemd-detect-virt
returns on this Ubuntu 18.04 KVM setup:
kvm
and on my host:
none
See also: https://unix.stackexchange.com/questions/89714/easy-way-to-determine-virtualization-technology
Tested on an Ubuntu 18.04 host.
Solution 3
There is code that can detect this: http://ivanlef0u.fr/repo/windoz/rootkit/invisiblethings/redpill.html
You can also check dmesg and lspci.
Xen PV guest or Xen guests with PV drivers will have something xen-related in dmesg
dmesg | egrep -i 'xen|front
Related videos on Youtube
Rachel Nark
Updated on September 18, 2022Comments
-
Rachel Nark almost 2 years
Is there a way to tell if I am on a XEN or KVM linux server? Reason I asked is nothing is on top yet I am seeing load averages high well after I do tasks and I am getting hangs/spikes when I do simple tasks
-
Rachel Nark about 12 yearsI don't have anything like that so this looks like a dedicated server.
-
William Jackson about 12 yearsI don't know what kind of output one would get with KVM or XEN. There is always the possibility that they spoof actual hardware. Other than asking the system administrator, there may not be a way to definitively determine whether it is a virtual machine.
-
Ciro Santilli Путлер Капут 六四事 over 5 yearsDid not work with this Ubuntu 18.04 on Ubuntu 18.04 setup: askubuntu.com/revisions/1046792/15 , it just output:
Standard PC (i440FX + PIIX , 1996)
.