You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only output: the file cannot be accessed by the system
Diagnostic Logs
No response
Reacted by Christian Esser, diabolic8733, Sebastian Kowalczyk, Hasan Mohsin, hewers, Tiago Ferreira, David Lee Chen, Trevor Gross, Erik Cervin Edin, Rui Lopes and 12 more
Reacted by Jeff Thompson, Alastair Grant and Hannes
Reacted by Christopher Gurnee, Mark O. Brown and pedr.o
I successfully reverted uninstalling from "Apps and Features" the 2 apps WSL and gWSL installed with the Microsoft Store "Windows Subsystem for Linux Preview" (after exporting my distros as backup).
Reacted by binary2010, Christopher Gurnee, さとぴあ and leabut
I successfully reverted uninstalling from "Apps and Features" the 2 apps WSL and gWSL installed with the Microsoft Store "Windows Subsystem for Linux Preview" (after exporting my distros as backup).
I would like to be able to use WSL2g when i am using the machine locally and SSH when I need to remote in. It's a better experience than having to RDP into my windows machine to access the WSL filesystem. Is this likely to be fixed?
Just to clarify an earlier comment, it's only necessary to remove the Windows Store app to restore SSH capability. After doing a backup with wsl --export, open Start, search for Windows Subsystem for Linux Preview, and select Uninstall from the bottom right.
It's not necessary to remove (or at least it wasn't for me) Windows Subsystem for Linux Update nor Windows Subsystem for Linux WSLg Preview from Apps > Installed Apps.
You can check by running wsl --status. With the Windows Store app installed, it should look similar to:
Default Distribution: Ubuntu
Default Version: 2
Windows Subsystem for Linux was last updated on 3/25/2022
WSL automatic updates are on.
Kernel version: 5.10.102.1
Reacted by erictbar, wrobertg, Cameron Jackson, Nick Phillips, Dmitry Volkov, 0arm and Lisa Smith
I believe this is a duplicate of #9231. Yes, technically 9231 is a duplicate of this, since it was created later, but it was the root-issue bug that the WSL team created publicly to track this.
This is now somewhat/mostly fixed in the 2.0.0 pre-release. Running:
C:\Program Files\WSL\wsl.exe
will now work from an SSH session (a.k.a. Session 0).
As mentioned in #9231, the WSL team is still working on enabling this for the "normal" wsl.exe binary.
Reacted by Christopher Gurnee, Vinfall, Andrey Radchishin, Isak, Elan Hasson, 白泽, Himel, cd-dr, Pierre Carru, Zhe Huang and 7 more
if you want to use wsl whose version is app store, you should use ProxyJump, the command likes below:
Host openssh_win32
Hostname 192.168.191.52
User xiaoc57
Host openssh_wsl
ProxyJump openssh_win32
User xiaoc57
HostName localhost
Port 2222
the openssh_win32 is your windows, and openssh_wsl may be your ubuntu.
this command need start ssh in both operation system. and need listening 2222 from windows to wsl. maybe my describe is poor , if you have some question ,you can email me [email protected].
Also confirming that this works for me, many thanks
At the moment of this comment the wsl --install command will install the store version, which makes wsl in ssh session not working.
This appears to be fixed in a recent version 🎉. After running wsl --update from a GUI session, running wsl.exe in a SSH session correctly launches the Linux interface.
Executing with the full path C:\Users\username\AppData\Local\Microsoft\WindowsApps\wsl.exe gets the same result, to confirm this is indeed using the Windows Store install.
If you can launch the store version of wsl.exe(which is a msix-packaged command line executable) over SSH, Can you also verify that you are able to launch any other MSIX-packaged command line based executable over SSH too? For example: Julia?
After running winget install julia -s msstore, I am indeed able to launch juliaup and julia over SSH, from the same location.
On Windows 11. I disabled then reenabled (and rebooted) via Features which did nothing. Also tried the dsim recommendations to no avail. Upthread, someone mentioned the App Store. I found WSL there and Repaired it which worked. Existing containers okay.
I had the same problem on a Windows 10 system where uninstalling/reinstalling WSL2 was not an option (due to problems with X windows which only works under this one specific configuration).
bash.exe would not run as would not also wsl.exe from \windows\system32, but the wsl.exe from Program Files\WSL at least started but failed because it didn't understand the "-c" parameter passed to it by ssh. So I made a workaround, which was to create a linux.bat file containing: @"c:\Program Files\WSL\wsl.exe" -- %2 %3 %4 %5 %6 %7 %8
and then setting the default ssh shell to that batch file via PowerShell in admin mode: New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "c:\ProgramData\ssh\linux.bat" -PropertyType String -Force
The "--" in the batch file replaces the "-c" from ssh. I'm sure someone who knows Windows batch file syntax better than I can improve on that script, but at least I can now execute remote commands on my windows portable and get some benefit from that CPU... (The only thing remaining to be done to add this system to my small cluster is to mount my cluster's NFS file system in WSL2 - which is proving problematic, but that's a question for another forum and another day.)
Just posted an answer on #9197 (comment) but perhaps should have commented on this since it's the only open ticket related to all duplicates including the ones mentioned in #11627 so quoting it here:
Had this very issue on a Windows 11 installation and after reading through all comments here I noticed that indeed the wsl.exe copies that get installed and are available on the standard PATH aren't really the actual executables, unless they get replaced or something gets changed after reboot/repair, but debugging through the instances of wsl.exe on the system:
>where wsl.exe
C:\Windows\System32\wsl.exe
C:\Users\vagrant\AppData\Local\Microsoft\WindowsApps\wsl.exe
>dir C:\Windows\System32\wsl.exe
Volume in drive C has no label.
Volume Serial Number is 6E9D-788A
Directory of C:\Windows\System32
02/25/2024 01:48 PM 196,608 wsl.exe
1 File(s) 196,608 bytes
0 Dir(s) 96,262,938,624 bytes free
>C:\Windows\System32\wsl.exe --version
The file cannot be accessed by the system.
Since while running dir /s \wsl.exe found many other copies in many directories including C:\Program Files\WSL\wsl.exe I ended up testing executing the same command with that one:
That file seems to be much bigger than the ones on the path:
>dir /s wsl.exe
Volume in drive C has no label.
Volume Serial Number is 6E9D-788A
Directory of C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_2.2.4.0_x64__8wekyb3d8bbwe
06/21/2024 07:55 PM 3,633,088 wsl.exe
1 File(s) 3,633,088 bytes
Directory of C:\Program Files\WSL
04/25/2024 06:19 PM 3,633,088 wsl.exe
1 File(s) 3,633,088 bytes
Directory of C:\Users\vagrant\AppData\Local\Microsoft\WindowsApps
06/21/2024 07:56 PM 0 wsl.exe
1 File(s) 0 bytes
Directory of C:\Users\vagrant\AppData\Local\Microsoft\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_8wekyb3d8bbwe
06/21/2024 07:56 PM 0 wsl.exe
1 File(s) 0 bytes
Directory of C:\Windows\System32
02/25/2024 01:48 PM 196,608 wsl.exe
1 File(s) 196,608 bytes
Directory of C:\Windows\WinSxS\amd64_microsoft-windows-lxss-wsl_31bf3856ad364e35_10.0.22621.2506_none_62c8e9f54a7fa6e6
02/25/2024 01:48 PM 196,608 wsl.exe
1 File(s) 196,608 bytes
Directory of C:\Windows\WinSxS\amd64_microsoft-windows-lxss-wsl_31bf3856ad364e35_10.0.22621.2506_none_62c8e9f54a7fa6e6\f
02/09/2024 08:05 PM 344 wsl.exe
1 File(s) 344 bytes
Directory of C:\Windows\WinSxS\amd64_microsoft-windows-lxss-wsl_31bf3856ad364e35_10.0.22621.2506_none_62c8e9f54a7fa6e6\r
02/25/2024 01:48 PM 595 wsl.exe
1 File(s) 595 bytes
Total Files Listed:
8 File(s) 7,660,331 bytes
0 Dir(s) 96,284,803,072 bytes free
So not sure if the other ones are stubs or some sort of "symbolic link" to the actual ones but they don't seem to work out of the box after installing and rebooting.
On Windows 11. I disabled then reenabled (and rebooted) via Features which did nothing. Also tried the dsim recommendations to no avail. Upthread, someone mentioned the App Store. I found WSL there and Repaired it which worked. Existing containers okay.
realized that this thread is still active. this works for me 👍🏻
Thanks
This should be fixed. Please install and use the latest version of WSL which will fix this issue, using wsl --update. If you're still seeing this issue after that please create a new issue for us to triage, I'll close this issue out for our bookkeeping. Thank you!
Activity
benhillis commentedon Jan 11, 2022
Are you using the version of WSL from the Microsoft Store?
benhillis commentedon Jan 11, 2022
If so, this is a known issue: https://docs.microsoft.com/en-us/windows/wsl/store-release-notes#known-issues
Domain commentedon Jan 13, 2022
Oh, yes, I just upgrade to the store version.
ppigazzini commentedon Jan 13, 2022
I successfully reverted uninstalling from "Apps and Features" the 2 apps WSL and gWSL installed with the Microsoft Store "Windows Subsystem for Linux Preview" (after exporting my distros as backup).
Domain commentedon Jan 14, 2022
👍, thanks for the tips!
kansson commentedon Apr 8, 2022
Will this ever be fixed?
barak14 commentedon Aug 1, 2022
I would like to be able to use WSL2g when i am using the machine locally and SSH when I need to remote in. It's a better experience than having to RDP into my windows machine to access the WSL filesystem. Is this likely to be fixed?
zzjin commentedon Aug 29, 2022
Uninstall from store version, and install wsl from command line works, but windows 11 will automated upgrade to store version after some update leases.
Any update here to reslove https://docs.microsoft.com/en-us/windows/wsl/store-release-notes#known-issues ?
Domain commentedon Sep 22, 2022
Any update on this issue? I need systemd and ssh!
mg-christian-esser commentedon Sep 29, 2022
I'm running into this issue after upgrading to Win11 22H2
gurnec commentedon Sep 29, 2022
Just to clarify an earlier comment, it's only necessary to remove the Windows Store app to restore SSH capability. After doing a backup with
wsl --export, open Start, search forWindows Subsystem for Linux Preview, and selectUninstallfrom the bottom right.It's not necessary to remove (or at least it wasn't for me)
Windows Subsystem for Linux UpdatenorWindows Subsystem for Linux WSLg Previewfrom Apps > Installed Apps.You can check by running
wsl --status. With the Windows Store app installed, it should look similar to:Without it installed:
ddddavid-he commentedon Oct 3, 2022
I do too after upgrading to 22H2 and wsl2 kernel 5.15
kansson commentedon Nov 8, 2022
Is there some technical limitation why this isn't worked on?
15 remaining items
kendofriendo commentedon Jul 13, 2023
+1 for what tvkit said. I did the "repair" option and it fixed it.
NotTheDr01ds commentedon Sep 20, 2023
I believe this is a duplicate of #9231. Yes, technically 9231 is a duplicate of this, since it was created later, but it was the root-issue bug that the WSL team created publicly to track this.
This is now somewhat/mostly fixed in the 2.0.0 pre-release. Running:
will now work from an SSH session (a.k.a. Session 0).
As mentioned in #9231, the WSL team is still working on enabling this for the "normal"
wsl.exebinary.xiaoc57 commentedon Nov 4, 2023
very nice job
buvinghausen commentedon Nov 21, 2023
Same thing cropped up with the 23H2 update. Was able to remove the WSL app and all components then bring it back to life from the command line.
xiaoc57 commentedon Dec 10, 2023
if you want to use wsl whose version is app store, you should use ProxyJump, the command likes below:
Host openssh_win32
Hostname 192.168.191.52
User xiaoc57
Host openssh_wsl
ProxyJump openssh_win32
User xiaoc57
HostName localhost
Port 2222
the openssh_win32 is your windows, and openssh_wsl may be your ubuntu.
this command need start ssh in both operation system. and need listening 2222 from windows to wsl. maybe my describe is poor , if you have some question ,you can email me [email protected].
entee28 commentedon Feb 13, 2024
Also confirming that this works for me, many thanks
At the moment of this comment the
wsl --installcommand will install the store version, which makes wsl in ssh session not working.tgross35 commentedon Feb 29, 2024
This appears to be fixed in a recent version 🎉. After running
wsl --updatefrom a GUI session, runningwsl.exein a SSH session correctly launches the Linux interface.My version after the update is 2.0.14:
Executing with the full path
C:\Users\username\AppData\Local\Microsoft\WindowsApps\wsl.exegets the same result, to confirm this is indeed using the Windows Store install.tgross35 commentedon Mar 1, 2024
After running
winget install julia -s msstore, I am indeed able to launchjuliaupandjuliaover SSH, from the same location.(I doubt it makes a difference but I am also using Powershell as the default shell for SSH, as described at https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_server_configuration#configuring-the-default-shell-for-openssh-in-windows. Really that should be the default IMO)
shihabsararrafid commentedon Mar 6, 2024
Thanks a lot. It worked.
gtoal commentedon Apr 26, 2024
I had the same problem on a Windows 10 system where uninstalling/reinstalling WSL2 was not an option (due to problems with X windows which only works under this one specific configuration).
bash.exe would not run as would not also wsl.exe from \windows\system32, but the wsl.exe from Program Files\WSL at least started but failed because it didn't understand the "-c" parameter passed to it by ssh. So I made a workaround, which was to create a linux.bat file containing:
@"c:\Program Files\WSL\wsl.exe" -- %2 %3 %4 %5 %6 %7 %8and then setting the default ssh shell to that batch file via PowerShell in admin mode:
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "c:\ProgramData\ssh\linux.bat" -PropertyType String -ForceThe "--" in the batch file replaces the "-c" from ssh. I'm sure someone who knows Windows batch file syntax better than I can improve on that script, but at least I can now execute remote commands on my windows portable and get some benefit from that CPU... (The only thing remaining to be done to add this system to my small cluster is to mount my cluster's NFS file system in WSL2 - which is proving problematic, but that's a question for another forum and another day.)
robertoandrade commentedon Jun 27, 2024
Just posted an answer on #9197 (comment) but perhaps should have commented on this since it's the only open ticket related to all duplicates including the ones mentioned in #11627 so quoting it here:
chandragie commentedon Aug 5, 2024
realized that this thread is still active. this works for me 👍🏻
Thanks
buvinghausen commentedon Aug 21, 2024
Happened again on my Surface Laptop 7 which is Snapdragon so it's a multi architecture feature ;-)
craigloewen-msft commentedon Feb 18, 2025
This should be fixed. Please install and use the latest version of WSL which will fix this issue, using
wsl --update. If you're still seeing this issue after that please create a new issue for us to triage, I'll close this issue out for our bookkeeping. Thank you!