{{tag>Virt}} # Notes nested virtualization ## prereq Source : https://gist.github.com/plembo/782e1511e463221b5772e85b6f2f72d4#file-nestedvirtkvm-md 1. Make sure that the Intel-VT-x/AMD-V extensions are enabled in the host machine's BIOS. For Intel: ~~~bash grep vmx /proc/cpuinfo ~~~ For AMD: ~~~bash grep svm /proc/cpuinfo ~~~ 2. Check to see if /etc/modprobe.d/qemu-system-x86.conf exists and if it does not have the following line, add it and reboot: ~~~bash options kvm_intel nested=1 ~~~ 3. Go into the graphical virt-manager, open the subject guest's config, and click on "CPUs". 4. Check the box "Copy host CPU configuration" and Apply. 5. Restart the virtual machine, open a terminal in it and check for the extensions: ~~~bash grep vmx /proc/cpuinfo ~~~ ----------------- Source : https://docs.fedoraproject.org/en-US/quick-docs/using-nested-virtualization-in-kvm/ Checking if nested virtualization is supported ~~~ cat /sys/module/kvm_intel/parameters/nested Y ~~~ ## To enable nested virtualization for Intel processors: Shut down all running VMs and unload the kvm_probe module: ~~~bash sudo modprobe -r kvm_intel ~~~ Activate the nesting feature: ~~~bash sudo modprobe kvm_intel nested=1 ~~~ Nested virtualization is enabled until the host is rebooted. To enable it permanently, add the following line to the /etc/modprobe.d/kvm.conf file: ~~~bash options kvm_intel nested=1 ~~~ ## To enable nested virtualization for AMD processors: Shut down all running VMs and unload the kvm_amd module: ~~~bash sudo modprobe -r kvm_amd ~~~ Activate the nesting feature: ~~~bash sudo modprobe kvm_amd nested=1 ~~~ Nested virtualization is enabled until the host is rebooted. To enable it permanently, add the following line to the /etc/modprobe.d/kvm.conf file: ~~~bash options kvm_amd nested=1 ~~~ ## Testing nested virtualization ~~~bash virt-host-validate ~~~