0

I recently Installed an Ubuntu machine on VMware, I realized that the Ubuntu kernel had detected that it was running on a virtualized machine. How did this happen? And how does the Ubuntu system gets to know when to issue a HyperCall and when to issue a System call for operations to be performed?

Apurv
  • 195
  • 3
  • 12
  • Possible duplicate of [Detect virtualized OS from an application?](http://stackoverflow.com/questions/154163/detect-virtualized-os-from-an-application) See also [How can I programmatically know if I am in a VM?](http://stackoverflow.com/q/15374154/464709). – Frédéric Hamidi Apr 19 '15 at 06:57

1 Answers1

0

Not sure about the system, but what i use in many of my scripts to check weather my machine is running on native machine or virtual environment is the command "dmidecode"

You can check the output of this command, for example:

[root@mailserver ~]# dmidecode -t system

dmidecode 2.9

SMBIOS 2.31 present.

Handle 0x0001, DMI type 1, 25 bytes

System Information

Manufacturer: VMware, Inc.

Product Name: VMware Virtual Platform

Version: None

Serial Number: VMware-56 4d eb 70 28 36 a8 c0-08 bb 55 cf dc e6 4f 60

UUID: 564DEB70-2836-A8C0-08BB-55CFDCE64F60

Wake-up Type: Power Switch

. . . . . . . . . .

Here Product Name will give you what you needed, and i think same is used by the system as its the system command.

Amit Kumar
  • 268
  • 1
  • 4
  • 13