microsoft / WSL

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

Mount partitions and skip HyperV limitations #9283

Open murder opened 1 year ago

murder commented 1 year ago

Is your feature request related to a problem? Please describe. https://learn.microsoft.com/en-us/windows/wsl/wsl2-mount-disk#limitations

At this time, only entire disks can be attached to WSL 2, meaning that it's not possible to attach only a partition. Concretely, this means that it's not possible to use wsl --mount to read a partition on the boot device, because that device can't be detached from Windows.

  1. We cannot mount Linux partitions that share the disk with Windows main partitions
  2. We cannot mount Linux partitions that share any Windows mounted partition
  3. We cannot mount specific partitions - just whole disks

We cannot mount our own Linux partitions if we have them, if they share the same drive as Windows

Describe the solution you'd like

Describe alternatives you've considered

8954 #6415 #4699

DiskPart_output

WSL_0x80070020

khdevnet commented 1 year ago

It will be great to make possible mount ext4 partition what located on the same disk with windows boot system. On many laptops only one disk exist and no slot for one more disk, that block to use wsl2 on full power with ext4. Wait for that feature )))

rbuels commented 1 year ago

This would have been useful for me too.

alukaszew commented 1 year ago

I never thought I'd say this but if nothing will change till the next week, I'm moving to linux + my mac. I have enough problems with windows in my work...

Regards

derkallevombau commented 1 year ago

@TapiaX, @alukaszew: I agree with you, it's a shame. Especially ridiculous is the explanation that Hyper-V is closed source because it's from MS, even though WSL is from MS too. And the documentation is really nasty: You read this, try it and you wonder why it doesn't work. And at the very end of the page comes this which contradicts everything explained before. Who writes such docs?

zgjja commented 11 months ago

yes, this one is helpful. Managing VHD/VHDX in WSL2 is useful but not very compatible for users with both WSL2 and dual-system to access same files, so adding ability to support "--partition " option for real would be very convenient, also get better safety (VHD may sometimes get corrupted).

ThiefMaster commented 10 months ago

I'd also like to be able to mount an ext4 partition on the same disk that hosts the Windows system. This would be perfect to use a partition on that disk as a backup for my Linux system on another physical machine (by simply using rsync to make a copy).

luohuiwu commented 1 month ago

I met the same issue. I have only one disk and want to mount other ext4 partitions on the same disk that already hosted the Windows 10 OS.  I also agree that: it would be perfect to use a partition on that disk as a backup for my Linux system on another physical machine (by simply using rsync to make a copy).