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
network card. Note also that ESXi requires ≥ 2 vCPUs and at least 2 GB of RAM.e1000 vmxnet3
Pingback: 在 KVM 裡面跑 VMware ESXi | Gea-Suan Lin's BLOG
But why?
But why not?!
It’s because I want to test other hypervisors to look at their features, how they store disk images, and check that libguestfs can be used on those guests.
Besides my lab, I can now use this on my second laptop which increases its usefulness on some customer engagements. Fantastic, thanks!
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?
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.
Hello Richard,
Are you able to run 64 bit VM’s in virtual ESX5i environment?
Kind regards,
Arnold Meenhorst
The vmxnet3 net interface is not stable enough (qemu bug I think) so I’ve given up on this approach.
Hello Richard,
I have written a patch to fix the vmxnet3 bug which has been merged upstream:
https://github.com/qemu/qemu/commit/40a87c6c9b11ef9c14e0301f76abf0eb2582f08e
There was an issue with Ethernet frame sizes being too short and the vmxnet3 driver did not pad them. ESXi drops frames < 60 bytes, therefore ARP failed within the same bridge.
Regards,
Ben Draper