KVM Nested in Vmware ESXi 5.5 - enable guest hypervisor vmx/svm flags without vsphere web client
Both Vmware ESXi and the open source alternative KVM (Kernel Virtualization Module) that turns a Linux server into a native hypervisor can run as nested hypervisors, meaning they are not installed on the bare metal machine, but they are themselves virtual machines under the other.
KVM nested in ESXi 5.5 - Requirements
In order for KVM module to load (or the packages to even install), the CPU has to have the Intel/AMD virtualization technology flags (vmx/svm) in
/proc/cpuinfo. These technologies assist the hypervisors virtualization functions, specially I/O operations.
Enable vmx/svm flags for the Guest/Nested hypervisor in Vmware ESXi5.5 from CLI
The official guide -
https://communities.vmware.com/docs/DOC-8970 - for enabling hardware assisted virtualization (VMX/SVM CPU flags) for the guest hypervisor is to use the web client. For those of us using this setup just for testing and using the free vsphere client, this method is not compatible.
So how can vmware ESXi 5.5 be instructed to provide the CPU virtualization vmx flag to the guest hypervisor without web client ?
There are two workarounds: one from the regular vsphere client and one from the ESXi 5.5 shell.
Steps:
1. Shutdown the nested/guest hypervisor (Ubuntu KVM in my case)2. Locate the guest hypervisor virtual machine configuration file (<VM-name.vmx>), edit and add the following line at the end:Code:
vhv.enable = "TRUE"
Save and close the file.
3. Identify the nested hypervisor vm ID and reload it's configuration with the [b]vim-cmd esxi command:[/b]
Code:
~ # vim-cmd vmsvc/getallvms | grep -i ubun
44 VM6-Ubuntu-KVM [datastore1] VM6-Ubuntu-KVM/VM6-Ubuntu-KVM.vmx ubuntu64Guest vmx-08
~ # vim-cmd vmsvc/reload 44
4. Start the nested VMVerify that the nested hypervisor correctly detects the vmx flag
Once the virtual machine started, login and check the
/proc/cpuinfo file:
Code:
$sudo grep -c vmx /proc/cpuinfo
4
Enjoy!
_________________
VPSie - SSD VPS servers in AMS-IX, LINX, DE-CIX
https://vpsie.com