Libvirt: enable nested virtualization


I’m running an Unraid (6.8.3) server with several Windows VMs.
In one of these I need to run docker desktop, therefore I want/need to enable nester virtualization, but what I found so far didn’t seem to work as the xml schema appears to be different with the recent versions.
Anyone has a clue how to achieve this or am I mistaken and need to enable/do something else?..

what have you tried already? have you confirmed your CPU supports the feature?

I struggled with this for days. I ended up having to run virsh edit <vm name> and change host-model to host-passthrough to get it to work. But changing anything in Virt-Manager seems to override this feature. YMMV of course as this was on Gentoo and who knows what kind of tinkering I did before-hand I know I don’t

1 Like

Never got a notification here :frowning:

The CPU model is set to passthrough, still I seem not be able to get docker up and running :frowning:

Needs to load the kvm module with specific parameters:

modprobe -r kvm_{intel,amd}
modprobe kvm_{intel,amd} nested=1

Make it permanent:

echo "options kvm_{intel,amd} nested=1" > /etc/modprobe.d/kvm_nested.conf

Of course, replace {intel,amd} with your platform (i.e. modprobe -r kvm_intel etc etc)

1 Like

Can you post any error logs to verify this is the issue?