Linux Enable KVM guest hypervisors (nested hypervisors)

To check if you can run hosted hypervisors run:

cat /sys/module/kvm_intel/parameters/nested

If it returns ‘Y’ you are good to go, and actually don’t need this article, if it returns ‘N’ you can enable nested virtualization for the current boot

For intel run as root:

modprobe kvm_intel nested=1

And for AMD run as root:

modprobe kvm_amd nested=1


Or you can enable it in a more permanent manner running
If you have an Intel Processor:

echo "options kvm-intel nested=Y" > /etc/modprobe.d/kvm-nested-intel.conf

If you have an AMD Processor:

echo "options kvm-amd nested=1" > /etc/modprobe.d/kvm-nested-amd.conf

You can always check if it’s working with

cat /sys/module/kvm_intel/parameters/nested

It should return ‘Y’, and you are ready to test new hypervisors without needing a new Test Server, but always remember that when you run a VM inside an VM hypervisor it’s I/O throughput will suffer a lot if you don’t have high end hardware.