Enable Nested Virtualization in Proxmox Virtual Machine

PowerADM.com / Linux / Debian / Enable Nested Virtualization in Proxmox Virtual Machine

Nested virtualization allows you to run other hypervisors in a virtual machine. In this article, we will look at how to enable nested virtualization in Proxmox VE for Intel and AMD processors.

Check the processor model on the Proxmox host:

$ lscpu | egrep --color -i "Vendor ID|Model name"

Depending on the processor model, check if nested virtualization is enabled in Proxmox:

For Intel processors:

$ cat /sys/module/kvm_intel/parameters/nested

For AMD CPUs:

$ cat /sys/module/kvm_intel/parameters/nested

If you see Y or 1, nested virtualization is supported. If N or 0, then no.

To enable nested KVM virtualization for Intel processors:

$ sudo modprobe -r kvm_intel
$ sudo modprobe kvm_intel nested=1
$ sudo echo "options kvm-intel nested=Y" > /etc/modprobe.d/kvm-intel.conf
$ sudo modprobe -r kvm_intel
$ sudo modprobe kvm_intel

For AMD processors:

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

Now you need to enable nested virtualization support for the Proxmox virtual machine:

$ qm set <ID> --cpu host

In this case, the VM CPU type will change to host.

Enable nested virtualization In Proxmox VE

Note. For AMD processors, you need to add additional parameters to the VM configuration file:args: -cpu host,+svm

Turn off and turn on the VM. Check if the guest OS now supports virtualization. Connect to the VM console (Ubuntu in this example) and run the command:

$ egrep --color -i "svm|vmx" /proc/cpuinfo
Leave a Reply

Your email address will not be published. Required fields are marked *