Nested Virtualization and KVM

Recently I was working on getting virtual machines to boot inside a virtual machine running on Ubuntu Trusty 14.04 (insert inception joke here). However I was getting an error:

libvirtError: internal error no supported architecture for os type 'hvm'

In my case that mean that nested virtualization was not turned on in the operating system that is running on the baremetal. (I should note there’s another good blog post here that describes turning on nested virtualization in KVM as well.)

To enable it, I removed the kvm_intel module and re-added it with nested=1.

# modprobe -r kvm_intel
# modprobe kvm_intel nested=1

Now I should see a “Y” after the below command. (Why it reports a “Y” I don’t understand.)

# cat /sys/module/kvm_intel/parameters/nested
Y

And we are good to go with nested virtualization.

I also setup this file:

# cat /etc/modprobe.d/kvm_intel.conf 
options kvm_intel nested=1

So that it will be added on a reboot.

Happy nesting!