cannot get WSL2 to work in Windows 11, that is virtualized inside of proxmox 8

jdaw

New Member
Aug 30, 2023
5
0
1
When I enable wsl2 through windows platform, win11 vm immediately starts to boot into advanced recovery console. Any advice?

I run Windows 11 as vm inside of proxmox 8. I successfully set gpu passthrough, and I am able to run Nvidia GPU inside of Win11. I can run games, furmark etc.
But when I try to run "Ubuntu" WSL2 in Windows, I get an error

Code:
WslRegisterDistribution failed with error: 0x80370102
Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS.

As soon as I enable Virtual Machine Platform in Windows Features, windows stops to boot and immediately falls into Advanced Recovery Mode during startup. The only way to get it back is to manually load vsscsi driver there and then usebcdedit /set hypervisorlaunchtype off to disable hyperv/windows virtualization.

I went through many tutorials/forums. Already tried -kvm arg in vm configuration, tried hidden=1 in various combinations. The result is the same all the time.

I understand that I can easily create another VM on host proxmox and ssh there, but I still would like to have ability to run WSL.

VM Configuration:
Code:
agent: 1
args: -cpu host,-hypervisor,+vmx
balloon: 0
bios: ovmf
boot: order=scsi1;net0;hostpci0;ide0;ide2
cores: 32
cpu: host,hidden=1
efidisk0: local-lvm:vm-101-disk-2,efitype=4m,pre-enrolled-keys=1,size=4M
hostpci0: 0000:01:00,pcie=1,x-vga=1
hostpci1: 0000:00:14,pcie=1
ide2: local:iso/virtio-win.iso,media=cdrom,size=522284K
kvm: 1
machine: pc-q35-8.0
memory: 61440
meta: creation-qemu=8.0.2,ctime=1692921033
name: winvm
net0: e1000=CE:84:8B:44:AF:AB,bridge=vmbr0,firewall=1
numa: 0
ostype: win11
scsi1: /dev/disk/by-id/nvme-Samsung_SSD_990_PRO_2TB_S73WNJ0W320367J,size=1953514584K
scsihw: virtio-scsi-single
smbios1: uuid=9eb9d91e-9f15-4202-a969-3cad45232285
sockets: 1
tpmstate0: local-lvm:vm-101-disk-0,size=4M,version=v2.0
vmgenid: 8a838a99-4567-472c-90bb-27991d71b95b

Relevant parts of systeminfo output in Windows 11 vm
Code:
OS Name:                   Microsoft Windows 11 Pro
OS Version:                10.0.22621 N/A Build 22621
Processor(s):              1 Processor(s) Installed.
                        [01]: Intel64 Family 6 Model 183 Stepping 1 GenuineIntel ~2995 Mhz
BIOS Version:              EFI Development Kit II / OVMF 3.20230228-4, 6/6/2023
Hyper-V Requirements:      VM Monitor Mode Extensions: Yes
                        Virtualization Enabled In Firmware: Yes
                        Second Level Address Translation: Yes
                        Data Execution Prevention Available: Yes

Proxmox
Code:
pveversion -v
proxmox-ve: 8.0.1 (running kernel: 6.2.16-3-pve)
pve-manager: 8.0.3 (running version: 8.0.3/bbf3993334bfa916)
pve-kernel-6.2: 8.0.2
pve-kernel-6.2.16-3-pve: 6.2.16-3
ceph-fuse: 17.2.6-pve1+3
corosync: 3.1.7-pve3
criu: 3.17.1-2
glusterfs-client: 10.3-5
ifupdown2: 3.2.0-1+pmx2
ksm-control-daemon: 1.4-1
libjs-extjs: 7.0.0-3
libknet1: 1.25-pve1
libproxmox-acme-perl: 1.4.6
libproxmox-backup-qemu0: 1.4.0
libproxmox-rs-perl: 0.3.0
libpve-access-control: 8.0.3
libpve-apiclient-perl: 3.3.1
libpve-common-perl: 8.0.5
libpve-guest-common-perl: 5.0.3
libpve-http-server-perl: 5.0.3
libpve-rs-perl: 0.8.3
libpve-storage-perl: 8.0.1
libspice-server1: 0.15.1-1
lvm2: 2.03.16-2
lxc-pve: 5.0.2-4
lxcfs: 5.0.3-pve3
novnc-pve: 1.4.0-2
proxmox-backup-client: 2.99.0-1
proxmox-backup-file-restore: 2.99.0-1
proxmox-kernel-helper: 8.0.2
proxmox-mail-forward: 0.1.1-1
proxmox-mini-journalreader: 1.4.0
proxmox-widget-toolkit: 4.0.5
pve-cluster: 8.0.1
pve-container: 5.0.3
pve-docs: 8.0.3
pve-edk2-firmware: 3.20230228-4
pve-firewall: 5.0.2
pve-firmware: 3.7-1
pve-ha-manager: 4.0.2
pve-i18n: 3.0.4
pve-qemu-kvm: 8.0.2-3
pve-xtermjs: 4.16.0-3
qemu-server: 8.0.6
smartmontools: 7.3-pve1
spiceterm: 3.3.0
swtpm: 0.8.0+pve1
vncterm: 1.8.0
zfsutils-linux: 2.1.12-pve1
 
I have to be that guy and ask (assuming this is latest win11 and not some tarted about custom version)
you did run wsl --install right? - it is telling you the platform components are not installed.... if you did what does wsl -v and wsl --status show
 
I have to be that guy and ask (assuming this is latest win11 and not some tarted about custom version)
you did run wsl --install right? - it is telling you the platform components are not installed.... if you did what does wsl -v and wsl --status show
Code:
Microsoft Windows [Version 10.0.22621.2134]
(c) Microsoft Corporation. All rights reserved.

C:\Users\andy_>wsl -v
WSL version: 1.2.5.0
Kernel version: 5.15.90.1
WSLg version: 1.0.51
MSRDC version: 1.2.3770
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.2134

C:\Users\andy_>wsl --status
Default Version: 2

This is with disabled hyperv, as otherwise it doesn't boot
 
oh, then you don't have a WSL issue - you have a hyper-v issue, you need to fix that issue first before you tackle wsl

you need hyper-v to use WSL2

I assume you are using pro if you can control separately if hyper-v is installed -

you have a lot going on in that win11 vm (passthrough, the extra vmx flag etc) i would suggest you pare it back down to a basic win11 with disks, network card, no pass through devices, just defalt display adpate, host CPU and nested virtualization, etc and start that there - might be worth spinning up a win 11 VM fresh using only UI options in pve...

i can test on my pve8 tomorrow (it is 10pm here)
 
Last edited:
  • Like
Reactions: gurubert
yup something very funky in latest win11 GA - added vmx=on as recommended by kvm site - the machine then boots but the event logs complain that vmx is not supported and issues with signing

and in the event logs we get Hypervisor launch failed; Either VMX not present or not enabled in BIOS. this would seem to be an issue with the UEFI BIOS maybe? as PVE is new to me, i am not sure what should and should not work

but there is a post around here where someoene hit the issue with win10, another post on reddit where someone hit this installing docker (which installs hyper and on wsl).

something seems broken IMO
 
oh i tried that, old q35 types, mixes of CPUS - i note we are using a debian unstable OVMF, maybe we need a later one
@fiona i notice you are mentioned in the notes for edk2 2023.02-1 in trixie - are we all going mad (there are multiple posts about this this month) or is win11 nested virtualization currently broken on Win11 with all august windows patches?

(or are we all just stupid and missing something obvious)
 
Last edited:
  • Like
Reactions: freneticallylost
It seems like an issue with Windows 11 and PVE... I have been trying to get the exact same setup but was unsuccessful.

The only way I could get WSL2 setup correctly on a Windows 11 VM in PVE is to disable GPU passthrough AND add the following to my config:

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

Setting the CPU type to Cooperlake disables the ability to do GPU passthrough of the Intel Iris XE onboard graphics in my case. So I cannot enable both GPU passthrough and WSL2 on the same VM.

See for reference: https://forum.proxmox.com/threads/a...virtualization-not-working.125987/post-581185
 
It seems like an issue with Windows 11 and PVE... I have been trying to get the exact same setup but was unsuccessful.

The only way I could get WSL2 setup correctly on a Windows 11 VM in PVE is to disable GPU passthrough AND add the following to my config:

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

Setting the CPU type to Cooperlake disables the ability to do GPU passthrough of the Intel Iris XE onboard graphics in my case. So I cannot enable both GPU passthrough and WSL2 on the same VM.

See for reference: https://forum.proxmox.com/threads/a...virtualization-not-working.125987/post-581185
I can confirm this worked for me.
 

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!