WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Mounting partitions on boot drive with WSL2

Open Foffy-01 opened this issue 2 years ago • 8 comments

Issue

I have a Linux partition and the windows partition on the same drive, at the moment it's impossible to access the linux partition from windows using WSL, which I find quite frustrating as I'm forced to re-boot into Linux to access the files I need.

Feature Request

I'd like to be able to mount an individual partition, even if in the boot drive, on WSL.

Foffy-01 avatar Sep 03 '23 14:09 Foffy-01

I'm having the same issue (mentioned in #10775) but with an Ext4 partition on a drive that's not the Windows boot drive but does have an active NTFS partition on it.

jaherron avatar Nov 16 '23 19:11 jaherron

Bump, please add, would be really nice for dual-boot laptop setups where WSL could be used to access existing linux system in case it's needed

PanForPancakes avatar Oct 05 '24 19:10 PanForPancakes

Ye I have same issue, having NixOS(LUKS btrfs) and windows (bitlocker ntfs) dual boot configuration. I can easily open bitlocker partition with cryprsetup (even managed to automate with by creating BEK and using as keyfile with crypttab) but not vice versa. My current solution is using VMware workstation (it CAN passthrough single partition) with Alpine Linux, mounting disks and sharing disk with SMB. waiting for less complicated and manual(VM can't be launched at boot because admin access required) method. Were there any workarounds?

Sk7Str1p3 avatar Oct 23 '24 20:10 Sk7Str1p3

Same here - I believe this feature would be very useful for many of us as it should be quite common to have multiple partitions on the same drive.

Also, maybe this is also related to #6015?

htbkoo avatar Mar 02 '25 10:03 htbkoo

Ye I have same issue, having NixOS(LUKS btrfs) and windows (bitlocker ntfs) dual boot configuration. I can easily open bitlocker partition with cryprsetup (even managed to automate with by creating BEK and using as keyfile with crypttab) but not vice versa. My current solution is using VMware workstation (it CAN passthrough single partition) with Alpine Linux, mounting disks and sharing disk with SMB. waiting for less complicated and manual(VM can't be launched at boot because admin access required) method. Were there any workarounds?

The same, both in setup and desire. There is a chance for wsl2 to be the best solution for Windows to mount alien filesystems from Linux, only if it is capable of mounting partitions on the same disk where Windows boot from.

peigongdsd avatar Apr 23 '25 18:04 peigongdsd

It's like 2 years old issue and no single PR or commit, that's real shame 😭

Sk7Str1p3 avatar Apr 24 '25 21:04 Sk7Str1p3

Would very much like to see this. My giant physical swap partition from Linux is being wasted!

Basically the current mount flow goes through:

  • WslCoreVm::AttachDisk adding a mutex
  • WslCoreVm::AttachDiskLockHeld doing the actual attachment, which after some checks boils down to
  • wsl::windows::common::hcs::AddPassThroughDisk, which constructs a ModifySettingRequest<Attachment> (schema in https://learn.microsoft.com/en-us/virtualization/api/hcs/schemareference#attachmenttype) and calls ModifyComputeSystem()
  • WslCoreVm::MountDisk adding a mutex
  • WslCoreVm::MountDiskLockHeld doing the actual mount

The current bottleneck is in the HCS step, which boils down to Hyper-V's inability to attach a single partition instead of a whole disk. And because this thing involves multiple Microsoft teams... it will probably be hard to get started.(See: Microsoft organization structure chart.)

Artoria2e5 avatar Jul 17 '25 09:07 Artoria2e5

Same as above. This is an important feature and it seems silly that it's not supported!

liamhelmer avatar Nov 08 '25 18:11 liamhelmer