Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--mount option available on Win10 (non-Insider) #7940

Closed
Hashbrown777 opened this issue Jan 17, 2022 · 40 comments
Closed

--mount option available on Win10 (non-Insider) #7940

Hashbrown777 opened this issue Jan 17, 2022 · 40 comments
Labels

Comments

@Hashbrown777
Copy link

Is your feature request related to a problem? Please describe.
I need a way to mount physical disks to the WSL linux environment.

Describe the solution you'd like
The Microsoft Store release to be Win10 minimum with GUI features disabled if that makes it easier.

Describe alternatives you've considered
I've been on Insider basically since --mount released on those rings, but I experience many issues and I'm on it solely for this feature.
WSLg moved out of insider to full release, but only for Windows 11, & I cannot move to Win11 due to corporate.
The same version appeared as a preview on the MS Store; but it's also been locked to Win11.

Additional context
I understand there are issues with getting the graphical portions of the newer version of WSL backported into Win10; but --mount works fine in Win10. The GUI stuff should be decoupled from WSL2 "core".
Craig unveiled the MS Store release of WSL saying, "This decouples WSL from your Windows version, allowing you to update through the Microsoft Store instead."
https://devblogs.microsoft.com/commandline/a-preview-of-wsl-in-the-microsoft-store-is-now-available/
But this doesn't seem to be the case.
image

@Hashbrown777
Copy link
Author

Uh, why was this closed?

@jaredhagel
Copy link

Please don't close this. Like many users, their companies haven't moved to Windows 11 yet. In the meantime while still using Windows 10, there is no good way to read/write from disks using the ext4 file format.

@Hashbrown777
Copy link
Author

They're not even giving a reason. I don't even know who @owenschupp is supposed to be, there's nothing on their user page at all. Somehow they have the authority to close issues though?

@Hashbrown777
Copy link
Author

I honestly don't know what to do but be annoying to one of the maintainers and at-tag someone like @craigloewen-msft
I don't see a contact or an overarching admin listed for the project, and owenschupp is just not saying anything.

@Croydon
Copy link

Croydon commented Feb 10, 2022

This is really weird, given that owenschupp has no (public) GitHub activity whatsoever

@craigloewen-msft
Copy link
Member

Thank you for the @ ! I'm following up with @owenschupp who is a dev on the WSL team for this, so expect a reply soon :)

@ghost
Copy link

ghost commented Feb 10, 2022

Hello! I apologize for this being closed without reason- that was done so in error on my part as I had misread and misunderstood the context of the issue. This is something we want to track so I am reopening it. Again, apologies for the confusion I caused here. I appreciate y'all reaching out.

As for transparency, I am a dev on the WSL team and I do not have public GitHub history on this account as I created it for the purposes of WSL-related GitHub activity only.

@ghost ghost reopened this Feb 10, 2022
@jaredhagel
Copy link

jaredhagel commented Feb 16, 2022

A manual process of mounting a USB device in Windows 10 is specified here - #6061 (comment). You need build your own WSL Linux kernel with added support for usb_storage. This worked for us - we can read/write to our USB device formatted with ext4 using WSL2 on Windows 10 through Windows Explorer.

That being said, this process is not user-friendly at all. A simple 'wsl --mount' option would simplify this process greatly :)

@Hashbrown777
Copy link
Author

@jaredhagel I made a comment there but if you know the answer let we know.

So does this share the filesystem or the device (as a blk)? Is this just getting the equivalent of internally mounted (but still already mounted by windows) /mnt/(drive letter) or will this let us use linux mount directly for things like LUKS as [win11] wsl --mount bare provides?

@brianddk
Copy link

brianddk commented Feb 16, 2022

@Hashbrown777 I answered your comment. Yes, you can mount LUKs and view it in WSL-2. No, a LUKs WSL-2 mount will not export back into windows, or at least IDK how to patch that all together.

@jaredhagel
Copy link

That's true - but you can still access the WSL Linux file system through Windows Explorer, as shown below. This is done via the 'explorer.exe .' command within your WSL prompt as you all probably know already.

image

@Hashbrown777
Copy link
Author

I've recompiled the kernel in the past, pre-5.4, to get access to up-to-date btrfs and wireguard (well, just to get wireguard even working back then, some required network flags were disabled in the official WSL kernel release) so I have no issue trying that

but I'd really rather an official release, especially since this seems more and more doable, I think your workaround may help the WSL team find a solution into packaging it into win10's WSL2

@brookst
Copy link

brookst commented Feb 28, 2022

Is there any movement on this? I was under the impression that I needed to update to 21H2 to get this, but I did so and wsl is still missing the --mount argument. I'm trying to mount SATA drives on Win10 so USB over IP doesn't help.

@Chris-70
Copy link

Chris-70 commented Mar 1, 2022

From what I know it's only available if you are part of the preview - dev insiders program. I joined and updated to enable mounting ext4 drives.

@brianddk
Copy link

brianddk commented Mar 1, 2022

If your --mount request is for a USB device then you can side-step the WSL-2 Win10 deficient and use WSL-10 + usbipd-win. It is nowhere near as clean as a --mount option would be, but if you are in a bind, it might hold you over. Provided your IO bus is in fact USB.

@brooksvb
Copy link

I've been needing this feature as well for a while and would like to see an update.

@karthick-kk
Copy link

+1. I need this feature so badly. Have no other means than to go by virtualbox otherwise

@bengalih
Copy link

+1 still need mount on Windows 10 enterprise builds.

@Tabiskabis
Copy link

+1, this feature deserves backporting to Win 10

@bengalih
Copy link

bengalih commented Apr 22, 2022

If your --mount request is for a USB device then you can side-step the WSL-2 Win10 deficient and use WSL-10 + usbipd-win. It is nowhere near as clean as a --mount option would be, but if you are in a bind, it might hold you over. Provided your IO bus is in fact USB.

This worked as a stopgap for me. It is inconvenient to have to rebuild the kernel, but the process outlined at the repository is fairly straightforward and I was able to mount a USB flash drive directly to perform block level operations (dd). Would be a good idea to also look at dorssel/usbipd-win#70 for additional hints on building it with appropriate support for USB storage and other file systems.

Additionally, this workaround doesn't provide a way to mount VHDX images natively either on Windows 10 which is really necessary to isolate data sets outside of the WSL managed VHDX for the distro.

@TomKranenburg
Copy link

Incredibly sad this still isn't there. Is there any movement at all on this?

@dimkasta
Copy link

dimkasta commented May 5, 2022

Any news on this? We cannot really enable the insider channel on our work machines (and shouldn't even if we could), and we are not yet ready to move to w11

@poka-IT
Copy link

poka-IT commented May 15, 2022

Can we hope to have this option before the arrival of Windows 15 ?

@BlackDogWhite
Copy link

I have a Win11/22H2 build 22621.1 that will mount a SATA drive connected with a SATA/USB converter. But none of my insider Win10 computers (21H2 build 19044.1741) will mount this same hardware combination.
wsl -- mount \.\physicaldrive1 just returns immediately with the help text.
I assume (?) that this is not a USB problem since the same hardware works on the Win11 machine.
Really like to get this resolved.

@Slips-PC
Copy link

It is ridiculous this still isn't on a stable build.

@soxhi8
Copy link

soxhi8 commented Jun 23, 2022

Please move to stable asap, it seems to work quite nicely on Windows 11. Seems like most of it is done already.

@kp-97
Copy link

kp-97 commented Jun 23, 2022

Yes, please move it to stable soon please.

@jaredhagel
Copy link

Our company really needs this feature. Our IT department hasn't committed to a timeline to update all our PCs to Windows 11, so we have no option besides VirtualBox. Will this ever be backported to Windows 10?

@IAmEchino
Copy link

Wow. I thought I was going crazy because it just kept telling me I couldn't execute the command. Thank you guys for bringing this issue up. What the heck is taking so long?? It's been nine months for crying out loud!

@HairyStuntWaffle
Copy link

When will this be coming to windows 10?

@brinza666
Copy link

still no available on Version 21 H2 (OS Build 19044. 1766)

@dlucksinger
Copy link

:(

@TomKranenburg
Copy link

:(

:c

@Tabiskabis
Copy link

How has this not been included in 22H2? :(

@tealsnow
Copy link

Please, what reason could you possibly have for not backporting this? Except for if you specifically want to alienate Linux users.
The whole reason that I need this is that this machine does not support Windows 11, hence the need for Linux.

@Biswa96
Copy link

Biswa96 commented Oct 21, 2022

Some investigation report. The WSL Preview version 0.70.4.0 has changed the minimum OS version to Windows 10 19041. But wsl.exe checks for presence of IWSLSupport interface which is not available in Windows 10.

@@ -13,7 +13,7 @@
     </uap10:PackageIntegrity>
   </Properties>
   <Dependencies>
-    <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.22000.0" MaxVersionTested="10.0.22000.0"/>
+    <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.19041.0" MaxVersionTested="10.0.22621.0"/>
   </Dependencies>
   <Resources>
     <Resource Language="CS-CZ"/>

Not sure if this is a good or bad news, but something is going behind the scene 💭

@Hashbrown777
Copy link
Author

That's interesting @Biswa96 I imagine it's a typo given 19041 is a win 10 release from mid 2020.

I think the main issue is that features from the Dev Channel (fast ring) haven't been making it to the non-insider releases. I mean, I had been using this on Windows 10 since 2021, given it was released on build 10.0.20211.1000. That was back in late 2020, over 6 months prior to the first insider release of Windows 11, completely predating wslg entirely.

At the time of submitting this github issue, Win11 and wslg had moved out of insider into actual releases (the latter even available on the MS Store), but like you've noticed backend OS things like IWSLSupport still haven't made it out of Win10Dev to even a release preview.

I'm only writing this because a lot of people above keep talking about "backporting" wsl and mentioning win11, which would actually be a lot of work. This isn't about backporting, it's about releasing (if not wsl; actual OS tech). It's already there, it works on windows 10, but only on insider builds, it's already well tested, and I guess[ed...] 'only' needs to go through approval channels and integration with an upcoming release.

I think the store version as it stands is wslg, which may be intrinsically tied to win11, but this ticket is that it shouldn't be; wsl2 with --mount should be decoupled and released there, supporting win10, and if there are underlying issues with win10's releases they need to mention it here instead of leaving us in the dark about the delays (because even if the task of getting that done wouldn't be under the wsl team's purview, this ticket should serve to track that).

There's just no info out there as to what's going on.

@Hashbrown777
Copy link
Author

Hashbrown777 commented Nov 18, 2022

As @Biswa96 has found yesterday, I installed the 22H2 update, and a "22H2 Cumulative Update Preview" which brought my Windows version up to 10.0.19045.2311.

This allows https://aka.ms/wslstorepage to run with --mount!

Not sure what the MS team wants to do with this issue, as it still requires a "Preview" update (as opposed to one fully released?), but it appears to be working now.

@Hashbrown777
Copy link
Author

I just thought I'd follow up with a demonstration with the most complex setup I can think of to really test the feature.

In this screenshot starting top-left I show I'm not in the insider program, have three 4tB unreadable disks (no partition table for windows to even ID), and show my Windows version for posterity.

Then bottom-left (after previously LUKS encrypting the disks and formatting them as btrfs RAID0, something windows cannot even wsl --mount by itself) using --bare I attach the three and mount natively from within Linux.

Now on the right I show Windows can 'directly' access the mount, and see the files within.

Beneath that likewise Linux shows it has successfully mounted the ~12tB btrfs device, and can see the same file.

image

Extra info:
This file test/steve I created when I performed the the format step, and has survived the unmounting process (the directory structure did indeed disappear on umount, the files are on-disk!).
The format that was performed was mkfs.btrfs -m raid1 -d raid0 -f passed as the -format option to the same wslMount command off-screen (that script isn't necessary, it's just for making this whole test simple and repeatable).
I'm not running any special kernel or custom wsl image, just the Debian one from the app store, so this truly is just working out of the box. Output from uname -a; cat /etc/*release*:

Linux esoterikos 5.15.74.2-microsoft-standard-WSL2 #1 SMP Wed Nov 2 19:50:29 UTC 2022 x86_64 GNU/Linux
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Finally you might notice that linux gvim window is displaying natively...WSLg also works on win10! This was an added bonus I thought I'd share when I noticed the /mnt/wlsg directory was populated.
NB it's still running on CPU, it doesn't seem easy to use NVIDIA's docs to get GPU support, given there's no wsl package in the debian repo (like there is for ubuntu) and their own local-installs link 404's.
WSLg is natively wayland, but glmark2 is not on Debian10 so I didn't put any effort into testing it, just basic X (my issue was, and use-case is, with --mount not GUI).

Many thanks to the WSL team, and anyone else behind the scenes pushing this through the slow windows update pipeline (and for dealing with a lot of disparaging remarks I've seen in other threads).

@FunctionDJ
Copy link

TL;DR on how to make --mount work on regular Windows 10

  • be on 19045.2311 or newer
  • if you still get Invalid argument, just install this https://aka.ms/wslstorepage (no re-install of distros needed) and it should work

(Taken from @Hashbrown777 's comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests