Skip to main content

Nested Virtualization

Enabling Virtualization

I recently had a situation where I wanted to run Docker Desktop in a Windows 11 VM. I have my CPU type set to host so I figured I would be able to just install Docker Desktop and call it a day. Unfortunately, after installing Docker Desktop and rebooting, my VM would not boot.

After a bit of research I found a few posts that mentioned updating the config for the VM. I am running a 14th gen Intel CPU (14900K) so I am not entirely sure what hardware is compatible. I believe any Intel/AMD that is capable of virtualization should work, but I have only tried it on my own host.

Update config

To get everything working I ended up just re-installing Windows 11 so I was back to a fresh VM. This may not be required, but if you have issues it may be a good idea.

Grab the VM ID and select "pve" in the "Server View" and then click the "Shell" button just below the "Create VM" button in the top right corner. This will open a root shell. Paste in the following to open the config, replacing <VM ID> with your VM ID.

nano /etc/pve/qemu-server/<VM ID>.conf

Then after agent add a new line:

args: -cpu Cooperlake,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time,+vmx

I first tried without the Cooperlake part but it did not work. So I ended up adding the whole argument above and it was able to proceed. Now restart your VM and Docker Desktop or WSL2 should be able to be installed.