Notes on getting VMware ESXi to run under KVM

This is mostly adapted from this long thread on the VMware community site.

I got VMware ESXi 5.5.0 running on upstream KVM today.

First I had to disable the “VMware backdoor”. When VMware runs, it detects that qemu underneath is emulating this port and tries to use it to query the machine (instead of using CPUID and so on). Unfortunately qemu’s emulation of the VMware backdoor is very half-assed. There’s no way to disable it except to patch qemu:

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index eaf3e61..ca1c422 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -204,7 +204,7 @@ static void pc_init1(QEMUMachineInitArgs *args,
     pc_vga_init(isa_bus, pci_enabled ? pci_bus : NULL);
 
     /* init basic PC hardware */
-    pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, xen_enabled(),
+    pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, 1,
         0x4);
 
     pc_nic_init(isa_bus, pci_bus);

It would be nice if this was configurable in qemu. This is now being fixed upstream.

Secondly I had to turn off MSR emulation. This is, unfortunately, a machine-wide setting:

# echo 1 > /sys/module/kvm/parameters/ignore_msrs
# cat /sys/module/kvm/parameters/ignore_msrs
Y

Thirdly I had to give the ESXi virtual machine an IDE disk and an e1000 vmxnet3 network card. Note also that ESXi requires ≥ 2 vCPUs and at least 2 GB of RAM.

Screenshot - 190514 - 16:04:38

Screenshot - 190514 - 16:21:09

9 Comments

Filed under Uncategorized

9 responses to “Notes on getting VMware ESXi to run under KVM

  1. Pingback: 在 KVM 裡面跑 VMware ESXi | Gea-Suan Lin's BLOG

  2. mkowp

    Besides my lab, I can now use this on my second laptop which increases its usefulness on some customer engagements. Fantastic, thanks!

  3. ben

    Hello Rich,

    I have ESXi fully installed with the vmxnet3 driver, however it would seem I can only connect to it via a routed network.

    If I try and ping the ESXi guest from another guest on the same bridge within KVM it fails, the guest arp cache gets populated with the correct mac address of the ESXi host, however the ESXi host always shows incomplete on the arp cache and can only see the gateway MAC.

    This explains why it works on a routed network but not local to the bridge.

    The question is, do you experience this as well or was your test to simply install ESXi as a guest under KVM?

    • ben

      Scrap that, it would seem that the guest will not get an ARP Reply, unless the host itself tries to ping the ESXi host.

      But the same outcome on the ESXi hosts arp table is the same.

  4. Arnold

    Hello Richard,

    Are you able to run 64 bit VM’s in virtual ESX5i environment?

    Kind regards,

    Arnold Meenhorst

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.