Skip to content

Instantly share code, notes, and snippets.

@plembo
Last active April 23, 2025 09:37
Show Gist options
  • Save plembo/782e1511e463221b5772e85b6f2f72d4 to your computer and use it in GitHub Desktop.
Save plembo/782e1511e463221b5772e85b6f2f72d4 to your computer and use it in GitHub Desktop.
Enable nested virtualization in KVM

Enable nested virtualization in KVM

For those times when you need to run virtualization (e.g. vagrant with VirtualBox) inside a KVM (libvirtd) guest.

The following taken from Enabling nested virtualization in KVM over on Fedora Docs.

  1. Make sure that the Intel-VT-x/AMD-V extensions are enabled in the host machine's BIOS. For Intel:
$ cat /proc/cpuinfo | grep vmx

For AMD:

$ cat /proc/cpuinfo | grep svm
  1. 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:
options kvm_intel nested=1
  1. Go into the graphical virt-manager, open the subject guest's config, and click on "CPUs".

  2. Check the box "Copy host CPU configuration" and Apply.

  3. Restart the virtual machine, open a terminal in it and check for the extensions:

$ cat /proc/cpuinfo | grep vmx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment