0

From a Linux OS, is there a way to determine if the OS is running as a guest OS on a virtualized VMware environment as opposed to running directly on non-virtualized/bare metal/physical host? In my case it is either VMware or not, but I am also interested the more general question of whether the OS is on physical hardware or virtualized hardware of any sort.

Leigh Riffel
  • 605
  • 2
  • 10
  • 23

3 Answers3

5

In VMware:

# dmidecode --string system-product-name
VMware Virtual Platform

In Virtualbox same command outputs VirtualBox

MKT
  • 226
  • 2
  • 4
2

On newer systems, the command "lscpu" give's you the information you need, inclusive which hypervisor the VM is running on.

Orphans
  • 1,396
  • 2
  • 18
  • 30
  • This seems to work for newer versions showing the "Hypervisor vendor:" entry when a hypervisor is present, but doesn't work for older versions that don't have lscpu such as RHEL 5. – Leigh Riffel Aug 15 '17 at 15:11
2

You can look at the output of the following:

  • virt-what
  • cat /proc/cpuinfo
  • dmidecode
  • lspci
  • lshw
  • hwinfo

Any of these will print various things that should point to if and what virtualisation-platform is being used.

Sig-IO
  • 1,056
  • 9
  • 11