Is this possible to detect VMware product name (ESXi, Workstation, Fusion, Player) from Linux guest?

I tried libvirt-what but it shows vmware on all platforms.

Any other ideas?

有帮助吗?

解决方案

There is a command line tool available (with source code!) that uses the VMware "backdoor" I/O ports and can detect the hypervisor product. See link.

The "Get VMware Version" command has the number 0ah, see link.

其他提示

I don't know about ESXi, but QEMU you can detect this way - same might work for ESXi

cat /proc/cpuinfo | grep -i qemu
model name      : QEMU Virtual CPU version 1.0

Or

lspci -nn

might also help as you can look for certain devices that ESXi is emulating if you are using the ESXI specific para-virt network drivers.

Or you could try virt-what which seems comprehensive:

http://people.redhat.com/~rjones/virt-what/

Or dmesg and then grep for fusion or esxi ?

Or sudo dmidecode | egrep -i 'manufacturer|product|vendor'

might help.

Low level wise, ESXI seems to use the 0x5658 io port. If you can craft a program to read from that you can get back 0x564D5868 (or 'VMXh').

Hopefully tho one of the above will help you. Please let me know, I'd be interested to know which works

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top