Reputation: 400
Issue Faced:
Even after installing WSL and after running below command, I was getting error: The file cannot be accessed by the system.
wsl --set-default-version 2
Upvotes: 0
Views: 11324
Reputation: 36
Install the latest version of installation package MSI from the repo:
https://github.com/microsoft/WSL/releases
This solves all your problems!
Upvotes: 0
Reputation: 1
Installing the latest wsl package from github worked for me. And It will automatically add the environment variables to the system path.
Upvotes: 0
Reputation: 11
Setting Windows PATH resolved my issue .
In my case wsl.exe was located in C:\Program Files\WSL\
Upvotes: 0
Reputation: 121
I realized that to resolve the issue, you need to uninstall WSL 2 with the command:
"C:\Program Files\WSL\wsl.exe" --uninstall
Then, reinstall it using the following commands:
wsl --set-default-version 2
wsl --update
Before using it, it is recommended to run one of the following commands, depending on which subsystem you are using:
wsl --install -d Ubuntu ;or wsl --install --distribution Debian
The problem, as I understand it, occurs due to differences in the Windows system paths. WSL 1 is located in C:\Windows\system32\wsl.exe
, while WSL 2 is in C:\Program Files\WSL\wsl.exe
.
Upvotes: 2
Reputation: 46
I experienced a similar glitch after a system restore...and I was able to fix it by manually re-installing wsl using the latest package from the link as mentioned in the first solution https://github.com/microsoft/WSL/releases
Upvotes: 0
Reputation: 26
Just pitching in here with a solution variant that worked for me.
msiexec /f wsl.2.1.5.0.x64.msi
in a command prompt (cd to the dir of the downloaded msi-package or use the full path)Symptoms in my case. Running wsl
/wsl.exe
from command promt resulted in The file cannot be accessed by the system.
. Could not start wsl2 in any other way either.
Background (if it is of interest): Erroneously deleted some files in Windows\System32
, restored them using another PC and then also ran system restore on an earlier restore point. Ran a bunch of repair commands. Ended up with Windows working fine again except wsl.
Upvotes: 0
Reputation: 1
Here is what worked for me :
https://www.revouninstaller.com/fr/start-freeware-download-portable/
It'll be used it to completely remove WSL.
Unzip the file and Launch the version compatible with your system
Then go to the second tab "Windows Apps" and look for "Windows Subsystem for Linux". Double click on it to completely uninstall it (make sure you checked the "create restore point"). See the image here
When the it's done, a second step will appear with the registry entries related to WSL. Check them all and delete.
Now disable the WSL and Virtual Machine Plateform.
Restart your computer
Re-enable WSL and Virtual Machine Plateform and Restart your computer again and it's OK.
Hope this will help
Upvotes: 0
Reputation: 1436
I ran into the same issue, presumably after an automatic update.
I tried various things like running dism /Online /Cleanup-Image /RestoreHealth
and "repairing" the Windows Subsystem for Linux in Add/Remove Programs
without success.
I also tried to update the kernel via wsl --update --web-download
and encountered a Catastrophic Failure
.
After reading https://superuser.com/questions/1731365/updating-wsl-2-without-microsoft-store I solved the problem as follows.
Solution:
Event Viewer
& find log Microsoft-Windows-AppXDeploymentServer/Operational
AppX Deployment operation failed for package MicrosoftCorporationII.WindowsSubsystemForLinux_2.0.14.0_neutral_~_8wekyb3d8bbwe with error 0x80073D19. The specific error text for this failure is: Deployment of package MicrosoftCorporationII.WindowsSubsystemForLinux_2.0.14.0_x64__8wekyb3d8bbwe was blocked because the provided package has the same identity as an already-installed package but the contents are different. Increment the version number of the package to be installed, or remove the old package for every user on the system before installing this package.
I reinstalled the installed version of wsl via cmdline with the command misexec /package wsl.2.0.14.0.x64
wsl
worked as usual
You can download the wsl packages from the wsl github release page https://github.com/microsoft/WSL/releases
Upvotes: 8
Reputation: 400
Solution
To resolve this issue run the below command.
dism /Online /Cleanup-Image /RestoreHealth
OR
Do followings.
Windows logo key -> type linux -> 'Windows Subsystem for Linuxappears -> you can seeApp Settings` in the right pane, hit that menu.
When Settings windows open, you can see the Reset button. after the reset, It works like a charm!
References: Link
Upvotes: -1