Proxmox and proper WSL2 configurations

cshill

Member
May 8, 2024
90
14
8
Morning/Evening,
I'm sure there are a lot of people tired of seeing this kind of post but I have to understand on an in-depth level how to properly make this work. Based on everything I've read it's a couple arguments and it should work, however, it works better but not good and the real question is if it's actually using all of the arguments for better performance.

Hardware: I am using a PowerEdge R540 with 378GB of Ram and dual Xeon 6154 Gold processors.
I have the virtualization turned on the server under BIOS.

Operating System: pve-manager/8.4.1/2a5fa54a8503f96d (running kernel: 6.8.12-11-pve)

Guest OS: Windows 11 24H2
Features: Hyper-V, Virtual Machine Platform, Windows Hypervisor Platform, WSL.

VM Configuration
Code:
agent: 1
args: -cpu host,vmx,aes,pcid,spec-ctrl,hv_relaxed,hv_vapic,hv_spinlocks=0x1fff,hv_vpindex,hv_runtime,hv_crash,hv_time,hv_synic,hv_stimer,hv_tlbflush,hv_ipi,hv_reset,hv_frequencies,hv_reenlightenment,hv_stimer_direct,kvm=off
balloon: 0
bios: ovmf
boot: order=scsi0;ide0;ide2
cores: 3
cpu: host,hidden=1
efidisk0: Datastore3:101/vm-101-disk-0.qcow2,efitype=4m,pre-enrolled-keys=1,size=528K
ide0: none,media=cdrom
ide2: none,media=cdrom
kvm: 1
machine: pc-q35-9.2,viommu=virtio
memory: 32768
meta: creation-qemu=9.0.2,ctime=1734717955
name: BLANK
net0: virtio=BC:24:11:EC:83:8C,bridge=vmbr0,firewall=1
numa: 1
ostype: win11
scsi0: Datastore3:101/vm-101-disk-1.qcow2,iothread=1,size=850G,ssd=1
scsi1: Datastore2:101/vm-101-disk-0.qcow2,iothread=1,size=4000G
scsihw: virtio-scsi-single
smbios1: uuid=fa7c0103-71c8-4235-b623-b6b23de4bdbb
sockets: 2
tpmstate0: Datastore3:101/vm-101-disk-3.raw,size=17K,version=v2.0
vmgenid: 193b079d-0fa3-4945-87dc-4274ca0bbd31
 
I have discovered one of the issues has to do with the processor Xeon Gold 6154 with Intel's virtualization technology and hyperthreading. The vmx package for nested virtualization within VT-x causes a L1 Terminal Fault. Can get around this by simply turning off hyperthreading but that means I lose a lot of core power.

https://docs.kernel.org/admin-guide/hw-vuln/l1tf.html
https://www.youtube.com/watch?v=kqg8_KH2OIQ

Within the server's shell you can run lscpu and will see at the bottom possible vulnerabilities and that is how I found out vmx was turned off despite the system telling me otherwise.

With the paid subscription model for the security update Proxmox's team DOES do something to try and correct the problem as other operating systems have. It just seems that despite the programmer's best attempts it still poses a delay for the virtual machines running WSL2/nested virtualization.

It's not quite a straight CPU bottleneck and the arguments still assist with performance but it's more of a general UI problem. CPU tests perform very well but not the same as if virtual tech was not turned on within a windows vm. You still lose some processing power but not too much and I'm fine with that. It's the sluggishness of other applications and responses/response rate. Example: I'll select file explorer and it eventually opens but there's a noticeable delay, same thing as opening a tab within file explorer and then dragging that to make a second file explorer. I've heard of issues like clicking on some applications and there's no response, no process actually starting for that application.
 
Those options conflict. KVM off is also very bad for performance. What setting did you want to use?
I've used several iterations, that kvm off was the last test.

This one worked best but I'm not even truly sure the system is activating the arguments related to HV due to the processor issue.
Code:
args: -cpu host,hv_relaxed,hv_vapic,hv_spinlocks=0x1fff,hv_vpindex,hv_runtime,hv_crash,hv_time,hv_synic,hv_stimer,hv_tlbflush,hv_ipi,hv_reset,hv_frequencies,hv_reenlightenment,hv_stimer_direct,hv-no-nonarch-coresharing=auto

I've also tried this one

Code:
args: -cpu host,+aes,+pcid,+spec-ctrl,hv_relaxed,hv_vapic,hv_spinlocks=0x1fff,hv_vpindex,hv_runtime,hv_crash,hv_time,hv_synic,hv_stimer,hv_tlbflush,hv_ipi,hv_reset,hv_frequencies,hv_reenlightenment,hv_stimer_direct,hv-no-nonarch-coresharing=auto