Home labs, by their very nature, are designed to satiate your curiosity by providing a testing environment for your self-hosting, networking, VM, and container experiments. As the de-facto leader among home lab operating systems, there’s a lot you can do with Proxmox. But what about running a miniature home lab inside your Proxmox environment?
Since it supports nested virtualization, it’s possible to create full-fledged virtual machines inside your favorite VMs. If this facility sounds intriguing, here’s everything you need to know about nested virtualization.
5 ways Proxmox simplifies home lab management
If setting up your own home server seems like a daunting task, you can make the ordeal a lot less painful by installing Proxmox
What’s nested virtualization?
And why should you use it?
If you’re not familiar with the concept of virtualization, it’s the facility that lets you create virtual machines by splitting the host machine’s CPU, RAM, and storage resources. Nested virtualization is just that, except, it allows the virtual machines on your server to run their own VM instances.
Despite sounding as weird as running macOS on Proxmox, nested virtualization is perfect when you don’t want to tamper with your current home lab configuration. Likewise, you can enable nested virtualization for a VM and use it to test other Type-1 and Type-2 hypervisors. Alternatively, you can use it to experiment with a Proxmox VM and try out all the cool ways you can break the platform – without exposing your underlying Proxmox server to any risks.
VirtualBox vs VMware Workstation Pro: Which Type-2 hypervisor should you use?
Can Workstation Pro dethrone VirtualBox and become the king of free hypervisors?
Enabling nested virtualization in Proxmox
Once you’re ready to enter the wacky and exciting world of nested virtualization, you can follow these steps to set up this facility for your Proxmox VMs:
- Head to the Shell section of your primary Proxmox node.
-
On Intel CPUs, run this command to confirm whether nested virtualization is enabled.
cat /sys/module/kvm_intel/parameters/nested
For owners of AMD processors, the command is slightly different:cat /sys/module/kvm_amd/parameters/nested
If the console shows Y (on Intel CPUs) or 1 (on AMD systems), feel free to skip to step 6. -
Should the console display N or 0, you’ll have to run the following command to enable nested virtualization on your server:
echo "options kvm-intel nested=Y" > /etc/modprobe.d/kvm-intel.conf
Again, AMD-powered systems require a different command:echo "options kvm-amd nested=1" > /etc/modprobe.d/kvm-amd.conf
- Reboot your Proxmox server.
- Once the system restarts, head back to the Shell tab.
-
Paste the following command into the terminal.
qm set vm_id --cpu host
Be sure to replace the vm_id parameter with the numerical ID of the virtual machine where you want to enable nested virtualization.
Building fun projects with nested virtual machines
With that, you should be able to leverage the power of nested virtualization to host virtual machines inside the VMs running on your Proxmox server. If you’re thinking about the practical applications of this feature, I recommend using it to test other virtualization platforms. From XCP-ng and Microsoft’s Hyper-V to their Type-2 counterparts VirtualBox and VMware Workstation Pro, nested virtualization is perfect when you wish to familiarize yourself with other hypervisors.
