-
Notifications
You must be signed in to change notification settings - Fork 834
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
Starting WSL results in error "The file cannot be accessed by the system." #9197
Comments
I am experiencing the same issue. No matter which WSL command I run right after installing Ubuntu with wsl --install -d ubuntu, I get the same error. I'm running the WSL commands from a ScheduledJob (powershell) after waiting for the initial user creation prompt, but having closed it without creating a user. |
I am having the same error message since this morning, except it is only happening while using a remote ssh connection, if I start the command locally then they work, if I connect to windows using OpenSSH then type wsl then I get the error |
I was able to resolve my issue with a |
@StephaneKazmierczak did you ever fix this issue? |
I have had this happen twice, last time I did the dism command and a couple of restarts and it eventually worked again, and now I have the same problem again. So I think that is not a permanent solution. And I think this issue should be reopened, there seem to be multiple people with an issue here. |
I have the same issue. WSL works fine when executing from the usual graphical session but ends up with |
For solution see #7900 |
Thanks @simmel . Removing |
I keep a wsl shell running on remote machine at all times. Also I was having more issues with 1.1.0 so downgraded to 1.0.3 |
Same problem with our Azure DevOps pipeline job. c:\agent> wsl --version
The file cannot be accessed by the system. In our case, we want to install a custom WSL image on a build agent. As described in the known issues, calls to the WSL that originate from a session zero no longer works. Does anyone know workarounds? https://learn.microsoft.com/en-us/windows/wsl/store-release-notes#known-issues
|
Our case seems to be almost exactly the same as yours. We want to install a custom WSL image using a build agent. We noticed this issue with remote commands in Jan 2023 and found that no command with WSL at the front would work. We use packer and powershell scripts to provision a windows sysprep image with WSL baked in. I do not know exactly what fixed the problem but we now do the following and it works fine:
I hope this helps. |
I solved this issue by Reset the Windows logo key -> type When Settings windows open, you can see the |
Just want to report that this solves my problem as well!!
|
This worked for me too. seriously, wtf??? |
Tried it, did not work. |
didn't work. |
I ended up following the steps to uninstalling that linux windows application, which did not uninstall wsl2, just got reverted to an older working version. |
Thanks a lot ❤ |
|
|
It works for me after a blue screen and System Restore can also see https://superuser.com/a/1758189/1821863 |
Removing Windows worked for me... |
worked for me as well. Somehow my Windows got bricked during a restart. Then I had no other choice but to "restore" to a previous version and then following the above steps worked for me. |
Got this message on Windows 11. Nothing helped, even reactivation through the "Turn Windows features on or off" -> "Windows Subsystem for Linux" from the Control Panel. The only thing that has helped is to delete "Windows Subsystem for Linux" by the Settings ("Add or remove programs" -> search for "linux") |
Worked for me flawlessly! |
https://www.youtube.com/watch?v=T9r5d_YoIbc |
Another "fix" that doesn't fix anything.... milo> ssh -Y [email protected] Microsoft Windows [Version 10.0.22621.2428] cimmy@IRIS C:\Users\cimmy>wsl cimmy@IRIS C:\Users\cimmy> |
If you delete the "Windows Subsystem for Linux" Windows App (APPX, not the EXE) you can run WSL commands headless again. (e.g. wsl --version, wsl --list) However then you get "WSL 2 requires an update to its kernel component. For information please visit https://aka.ms/wsl2kernel" if you try to start a VM. Not a fix, but a clue. |
I had same issue, after I installed ubuntu 22.04 (from window store),I lose acces to wsl from ssh. |
This worked for me ! thanks @Van-Dame |
Using this other wsl.exe worked for me |
I'm doing the same thing you are, but I don't have a "C:\Program Files\WSL\wsl.exe". I tried C:\Windows\System32\wsl.exe with no luck. My agents are running Windows Server 2022 |
For others like me absolutely terrified at the thought of clicking uninstall for WSL, after backing up my vhdx to be safe (C:\Users\<username>\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu<version and ID>\LocalState\ext4.vhdx) I did it, after uninstalling the 2 "Windows Subsystem for Linux" entries I had it immediately worked. I lost nothing, I didn't have to do or re-install anything else, it just started working. ¯\_(ツ)_/¯ |
GUYS , this happens after a restore for some reason - nothing worked for me. the only simple thing was to uninstall windows subsystem for linux and reinstall it, this doesn't cause any data loss - were not removing ubuntu , just the sub system app.so just remove it and reinstall from store. fixed easily |
Yes! Exactly this happend to me - I had to restore the system and WSL broke. Wasn't able to run the |
Upgrading WSL to a pre-released version worked for me!
After rebooting it should be fine. https://superuser.com/questions/1714736/cannot-run-wsl2-over-ssh-on-windows-11 |
This worked for me too, had this happen today after a system restore. Found the answer on SO but also found this thread so thought I might reply here. |
Hi I'm also facing the same issue and uninstalled the WSL from windows. Now trying to install from microsoft store, please check below screen shot if I'm installing correct app. Is this correct? Please let me know so that I can proceed. |
This is not working for me. Getting same error: The file cannot be accessed by the system |
Bingo Best Solution Thanks Mate!!! |
Me too. I just hit |
Since I'm on Windows Server 2022 I didn't have a Reset option in the GUI so I tried Reset-AppxPackage with no luck. The version I was using was 2.0.14.0, but with -pre-release it went to 2.1.3.0 and my problems went away! |
if you get :
the solution was not "repair" for me or not only :
it was :
|
It works for me |
I tried many things, repairing Windows, dism commands, sfc /scannow, uninstalling / reinstalling the Windows Subsystem for Linux optional feature of Windows, repairing my distro app, repairing the WSL store app, but the thing that finally worked was:
|
В моем случае проблема была решена одной простой командой: "wsl --shutdown". Значение ее можно посмотреть набрав "wsl --help". Может показаться странным, но это работает как сразу, так и после перезагрузки. Удачи! |
Tried everything possible, none worked. Eventually this helped - |
This worked after a system restore -- thank you. |
I fixed it after installing wsl.msi manuall |
I fixed it by clicking a reinstall button in Windows Subsystem for Linux app in Microsoft Store |
In my case I managed to solve it in the following way: After that you search for |
wow that saved the day thank you <3 |
It worked for me, resolved in less than 1 minute. |
It worked thanks just needed to click repair, the internal windows repair functions for me are also broken i think |
Had this very issue on a Windows 11 installation and after reading through all comments here I noticed that indeed the
Since while running
That file seems to be much bigger than the ones on the path:
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. |
Version
Microsoft Windows [Version 10.0.22621.819]
WSL Version
Kernel Version
No response
Distro Version
Debian
Other Software
Docker Desktop (Windows), version 4.12.0
Visual Studio Code 1.73.1 (system setup) with Remote-WSL Extension 0.72.0
Repro Steps
Open powershell.
Run wsl.exe
Returned response is
The file cannot be accessed by the system.
Expected Behavior
It should start the distro.
Actual Behavior
Returned response is
The file cannot be accessed by the system.
Diagnostic Logs
https://1drv.ms/u/s!ArYWk3X9lH3jicFEE6GNcS0tDY6Dtg?e=6VEqXD
The text was updated successfully, but these errors were encountered: