microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.25k stars 812 forks source link

Boot different root / cloudimg filesystem #8830

Open maxboone opened 2 years ago

maxboone commented 2 years ago

Is your feature request related to a problem? Please describe.

I've been experiencing random crashes on WSL2 (on ARM), where I need to force quit the WSL2 VM through hcsdiag. Anyways, I want to move to btrfs for better resiliency than ext4 for some of my WSL2 installs.

Currently, WSL starts ext4.vhdx, I converted the VHD-image to btrfs by mounting it in a Hyper-V install. However, when I try to start the WSL installs they don't seem to boot (likely, some not open source ext4-mounting magic happens from CBL):

The operation timed out because a response was not received from the virtual machine or container.
Error code: Wsl/Service/CreateInstance/0x80370109

[process exited with code 4294967295 (0xffffffff)]

Tailing the logs from the system distribution, it's clear that it's trying to mount an ext4 system:

[  141.672913] scsi 0:0:0:3: Direct-Access     Msft     Virtual Disk     1.0  PQ: 0 ANSI: 5
[  141.675431] sd 0:0:0:3: Attached scsi generic sg3 type 0
[  141.677106] sd 0:0:0:3: [sdd] 536870912 512-byte logical blocks: (275 GB/256 GiB)
[  141.678739] sd 0:0:0:3: [sdd] Write Protect is off
[  141.679803] sd 0:0:0:3: [sdd] Mode Sense: 0f 00 00 00
[  141.681069] sd 0:0:0:3: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  141.685502] EXT4-fs (sdd): VFS: Can't find ext4 filesystem
[  141.686686] WSL (1) ERROR: Mount:1885: mount(/dev/sdd, /distro, ext4, 0x0, discard,errors=remount-ro,data=ordered
[  141.686689] ) failed 22
[  141.689013] WSL (1) ERROR: Invalid argument @main.cpp:3046 (ProcessMessage)
[  141.690914] sd 0:0:0:3: [sdd] Attached SCSI disk

Describe the solution you'd like

Be able to mount a different rootfs on boot. Or, get some pointers where this is configured / where this error happens so I can do debugging and do a MR myself.

Describe alternatives you've considered

Additional context

i2 commented 1 year ago

This is something that I am very interested in as well. Please vote/thumbs up to draw attention!