2015-08-12

Nested KVM virtualization with RHEV

If you want to run Red Hat Enterprise Virtualization (RHEV) or it's community version oVirt on your laptop for demonstration or learning purposes you need to enable nested virtualization for KVM. By default you'll get an error about unsupported CPU type.

I have Fedora running on my laptop and have two virtual machines running on virt-manager named "rhevm" and "rhevh". 

On the physical host, in my case Fedora enable nesting: 

# nano /etc/modprobe.d/kvm-nested.conf
Add this line to the file (file might not exist by default): options kvm_intel nested=1

Reload the KVM kernel module:

# modprobe kvm_intel
# modprobe -r kvm_intel

Then edit the "rhevh" virtual machine to use host-passthrough mode:

# virsh edit rhevh

Change from < cpu mode='custom' match='exact' > to < cpu mode='host-passthrough' >

You are now ready to start your virtual machines and play with RHEV, with nested virtualization.

Please note that this is not recommended or supported for production environments.