Can't enable Hyper-V with multiple cores

gyjys43043

New Member
Dec 29, 2024
3
0
1
I'm recently playing the PVE, and I encountered a nested virtualization issue

I need to run WSL2(Hyper-V) in the the Windows Server, after enabling the WSL2
  • When assigning a single socket with a single core CPU, or multiple sockets with a single core CPU to a guest Windows Server, the nested virtualization works fine
  • When assigning a single socket with multiple cores CPU or multiple sockets with multiple cores CPU to a guest Windows Server, the Windows can't boot, and it gets stuck at the booting screen after I enable the WSL2.
Basically, can't assign 2 or more cores to the VM, otherwise the Windows will stuck at booting screen

My server model is:
Code:
Dell T560
CPU Intel(R) Xeon(R) Gold 5418Y (2 Sockets)
RAM 512GB

The PVE version is 8.3.2

Below is the Windows VM Server configuration
Code:
bios: ovmf
boot: order=sata1
cores: 1
cpu: host
efidisk0: local-lvm:vm-102-disk-0,size=4M
machine: pc-i440fx-8.1
memory: 16384
meta: creation-qemu=8.1.5,ctime=1732611982
name: Testing
net0: virtio=BC:24:11:92:DD:43,bridge=vmbr0
numa: 1
ostype: win11
sata0: NAS_Storage:iso/virtio-win-0.1.262.iso,media=cdrom,size=708140K
sata1: local-lvm:vm-102-disk-1,size=300G
sata2: local-lvm:vm-102-disk-2,size=2T
scsihw: virtio-scsi-single
smbios1: uuid=7879829e-e147-4796-a384-04e2b12b1e9d
sockets: 1
vmgenid: bcc13e58-c266-4b26-8b7c-8c02b313fe16

I tried below flags on CPU, however when assigning 2 or more cores to the VM, the Windows will be stuck at the booting screen
Code:
args: -cpu SandyBridge,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time,+vmx
args: -cpu host,+kvm_pv_unhalt,+kvm_pv_eoi,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv_reset,hv_vpindex,hv_runtime,hv_relaxed,hv_synic,hv_stimer,-hypervisor,+vmx

When set 2 cores, the Windows stuck at booting screen
1735524248468.png
1735524300690.png

Anyone have any idea how to solve this issue?
Appreciate if you can help on this
 
Last edited:
I found a workaround, seems this is compatible issue between Qemu and CPU

Use "Cascadelake-Server-v5" CPU, and set flags "-hypervisor,+vmx" can solve the issue

As per testing between the "host" type CPU, I don't see a significant performance drop
 
I have a question regarding this as I have everything I can find as turned on. Nested virtualization, options within the VM for KVM Hardware Virtualization, I turn on the Hyper-V feature with WSL inside the Windows 11 machine, and it technically works but it instantly becomes sluggish.

I saw some posts referencing flags and that I need to add a bunch. How do I add flags? Do I change the VM config file?
 
I have a question regarding this as I have everything I can find as turned on. Nested virtualization, options within the VM for KVM Hardware Virtualization, I turn on the Hyper-V feature with WSL inside the Windows 11 machine, and it technically works but it instantly becomes sluggish.

I saw some posts referencing flags and that I need to add a bunch. How do I add flags? Do I change the VM config file?
You can edit the config file in the shell. The config file locate is "/etc/pve/qemu-server/<VM ID>.conf"

From my understanding, PVE(KVM) is not fully compatible with all types of CPU on the market, which causes some strange issues, like sluggish, bluescreen, or getting stuck. You have to change the CPU type, or test CPU flags that shared on the forum, try to enable/disable them, until it works
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!