Nested virtualization on CentOS 6

During my "2-node KVM" endeavour, I wanted to test my particular setup on a single test PC.
Not thinking or having researched anything, I blindly installed CentOS 6.3 onto my test PC (of course, the best and logical choice ;-))

But... I wanted to test Hypervisors in a virtual environment. After the base setup, that implies installing Virtual Machines inside the Hypervisor Virtual Machine!
This means nested virtualization. And as Google will tell you (just as it did me), that is enabled using the "kvm-intel.nested" kernel parameter.
Oops!! CentOS (and RHEL) does not support this so-called nested virtualization parameter yet. And I most definately (after all my efforts) didn't want to erase my CentOS test PC and reinstall as Fedora17 ;-)

To verify this: "cat /sys/module/kvm_intel/parameters/nested"
A default CentOS system will tell you the file doesn't exist.

The xen-c6 project to the rescue!! Many thanks to z00dax on #centos-devel (freenode). Kudos m8!
He pointed me to use the 3.4.31 kernel from the xen-c6 project at

Steps to enable nested virtualization on CentOS 6

1. Add the xen-c6 repo
  1. su -
  2. cd /etc/yum.repos.d
  3. wget
  4. yum repolist
  5. [optional] vi xen-c6.repo : change to "enabled=0" to not take the repo enabled by default

2. Install the new kernel

  1. su -
  2. yum --enablerepo xen-c6 install kernel kernel-firmware
  3. vi /boot/grub/grub.conf : add "kvm-intel.nested=1" to the end of the kernel line
  4. reboot
  5. verify proper operation: "cat /sys/module/kvm_intel/parameters/nested" will output "Y"

3. Hypervisor virtual machine configuration

  1. virt-manager
  2. open the hypervisor virtual machine, go to Details > Processor
  3. unfold the "Configuration"
  4. press the "Copy host CPU configuration" button
  5. unfold the "CPU Features"
  6. verify the "vmx" feature is set to "require"
  7. press Apply

Boot the hypervisor virtual machine, and lo and behold! libvirtd is up and running inside the VM!