Nested virtualization doesn't work. How do I convert libvirt xml to proxmox?

kacvegas

New Member
Mar 8, 2026
1
0
1
Hello, I have a problem with nested virtualization + GPU passthrough.
Attempting to run nested virtualization in a Windows 10 VM results in the virtual machine crashing (the QEMU log only states that the virtual machine hung and had to be shut down, nothing more) or a Windows 10 BSOD.
Lastest Proxmox instaled from ISO to Proxmox website.
CPU: AMD Ryzen 7700
GPU: 4080S
AMD SVM enabled in the BIOS.
IOMMU enabled in the BIOS.
Secure boot disabled to prevent it from interfering with Proxmox.
GPU passthrough works.
In Proxmox, CPU type host.

For others (those using libvirt), it works after entering these arguments.
<features>
<acpi/>
<apic/>
<hyperv mode="custom">
<relaxed state="off"/>
<vapic state="off"/>
<spinlocks state="on"/>
<vpindex state="on"/>
<runtime state="on"/>
<synic state="on"/>
<stimer state="on"/>
<frequencies state="on"/>
<tlbflush state="off"/>
<ipi state="off"/>
<avic state="on"/>
</hyperv>
<kvm>
<hidden state="on"/>
</kvm>
<vmport state="off"/>
<smm state="on"/>
</features>
<cpu mode="host-passthrough" check="none" migratable="on">
<topology sockets="1" dies="1" clusters="1" cores="16" threads="1"/>
<cache mode="passthrough"/>
<feature policy="disable" name="hypervisor"/>
</cpu>

But from what I see, Proxmox, for some strange reason, doesn't support the libvirt XML component and doesn't even have a librvirt to Proxmox converter.
I also didn't see any place in the GUI where I could enter arguments for KVM/QEUMU.
 
I believe the Hyper-V settings are similar to those described below.

https://www.qemu.org/docs/master/system/i386/hyperv.html

Specifying something like hv_relaxed=off should make it usable.

Code:
qm set <vmid> -cores 16
qm set <vmid> -args '-cpu host,migratable=on,-hypervisor,+svm,<hv_~ option>'
qm set <vmid> --cpu host,hidden=1

*migratable=on is assumed to be on even if unspecified.

Code:
<vmport state="off"/>
<smm state="on"/>

I don't know about this.

The following settings are also required.

sed -i '/GRUB_CMDLINE_LINUX_DEFAULT=/c GRUB_CMDLINE_LINUX_DEFAULT="quiet iommu=pt"' /etc/default/grub
echo "options kvm ignore_msrs=1 report_ignored_msrs=0" > /etc/modprobe.d/kvm.conf
echo "options kvm-amd nested=1" > /etc/modprobe.d/kvm-amd.conf

I don't know if the GPU will work with this configuration.

With the following settings and a few tweaks, I was using the 7700 without any crashes or BSODs.

Code:
sed -i '1s/$/ quiet iommu=pt/g' /etc/kernel/cmdline
sed -i '/GRUB_CMDLINE_LINUX_DEFAULT=/c GRUB_CMDLINE_LINUX_DEFAULT="quiet iommu=pt"' /etc/default/grub
cat << EOF > /etc/modules
vfio
vfio_iommu_type1
vfio_pci
coretemp
EOF
echo "options kvm ignore_msrs=1 report_ignored_msrs=0" > /etc/modprobe.d/kvm.conf
echo "options kvm-amd nested=1" > /etc/modprobe.d/kvm-amd.conf
qm set <vmid> -args '-cpu host,hv_passthrough,level=16,-hypervisor,+svm'
qm set <vmid> -machine pc-q35-9.2+pve1,viommu=virtio
qm set <vmid> --cpu host,hidden=1
 
Last edited: