Skip to content

Instantly share code, notes, and snippets.

@changeme
Last active May 11, 2021 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save changeme/58a34f8865cc296e6684f9d30296cbd1 to your computer and use it in GitHub Desktop.
Save changeme/58a34f8865cc296e6684f9d30296cbd1 to your computer and use it in GitHub Desktop.
How can I know if I am in a VM?

How can I know if I am in a VM?

virt-what

# virt-what
kvm

lscpu

# lscpu | grep -E 'Hypervisor vendor|Virtualization type'
Hypervisor vendor:     KVM
Virtualization type:   full

dmidecode

# dmidecode -s bios-version
1.11.0-2.el7
# dmidecode | egrep -i 'manufacturer|product|vendor|domU'
        Vendor: SeaBIOS
        Manufacturer: OpenStack Foundation
        Product Name: OpenStack Nova
        Manufacturer: Red Hat
        Manufacturer: Red Hat
        Manufacturer: Red Hat
        Manufacturer: Red Hat
        Manufacturer: Red Hat
        Manufacturer: Red Hat
        Manufacturer: Red Hat
        Manufacturer: Red Hat
        Manufacturer: Red Hat
        Manufacturer: Red Hat
# dmidecode  | grep -i product
        Product Name: OpenStack Nova

dmesg

# dmesg | grep -i virtual
[    0.000000] Booting paravirtualized kernel on KVM
[    0.427075] KVM setup paravirtual spinlock
[    1.310748] input: VirtualPS/2 VMware VMMouse as /devices/platform/i8042/serio1/input/input2
[    1.313385] input: VirtualPS/2 VMware VMMouse as /devices/platform/i8042/serio1/input/input3
[    1.361184] systemd[1]: Detected virtualization kvm.
[    1.445696] systemd[1]: Starting Setup Virtual Console...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment