If you have a proxmox server with very large resources but we want, for example, to make a failover simulation on proxmox which should use at least 2 servers, then we can activate nested virtualization on proxmox.
How to enable nested Virtualization on proxmox?
In short, nested virtualization is running a VM within a VM. In this case, I would enable nested virtualization on proxmox 7.2 to install CentOS on Proxmox VM. Open the proxmox CLI as root user and if your server uses an intel processor, then write the command below:
but if you are using an AMD processor then type the command below:
If the result of the above command produces a Y output, it means that it enabled the nested virtualization function. But if the output is N, it means that the function is still disabled. To enable, then type the command below:
echo 'options kvm-intel nested=Y' > /etc/modprobe.d/kvm-intel.conf
echo 'options kvm-amd nested=1' > /etc/modprobe.d/kvm-amd.conf
After that use the command below to reload the kernel module:
modprobe -r kvm_intel modprobe kvm_intel
modprobe -r kvm_amd modprobe kvm_amd
After that do the command again to check nested virtualization using the command below:
and the nested virtualization function should be active, as shown below:
After that, create a VM (I install Proxmox) and on the CPU tab, select the host on Type column as shown below:
Before installing the VM, check the Hardware section for the VM, it will look like the image below:
Then change the KVM hardware virtualization in the Options section to Yes, as shown below:
After that do the installation of Proxmox and if it is finished, then try to install any OS (I install CentOS) on proxmox that we have installed previously and the OS should be able to run normally.
If you install Proxmox on the Proxmox server and you get an error like the below image:
No support for KVM virtualization detected.
Check BIOS settings for Intel VT / AMD-V / SVM.
It means the VM detected there is no KVM Virtualization on the server or on the Proxmox Application. If you are sure your server has been configured to enable nested virtualization, you must check the configuration of Proxmox, especially in the section selecting the host as the CPU type and changing to Yes in the KVM hardware virtualization section.