EZZAHIR Taha
Posted on May 16, 2023
This error message usually occurs when there is an issue with the permissions of the user account running WSL.
One cause of such error is that the default WSL distro is set to docker install. In this case you can find which distro is currently a default distro with wsl -l command and change it to right one with wsl -s command.
Another solution is to fix the problem is to reset the WSL distribution, which will recreate the distribution files and fix any permission issues. Here are the steps to reset the WSL distribution:
- Open PowerShell as Administrator.
- Run the command
wsl --shutdown
to stop all running WSL instances. - Run the command
Get-ChildItem -Path
HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | ForEach-Object {&{"Unregistering $($.pschildname)"; ®.exe delete "$($.pspath)\Flags" }} to unregister all the installed WSL instances. - Run the command
wsl --list
to confirm that no WSL instances are listed. - Run the command
wsl --import <DistributionName> <InstallLocation> <FileName>
to import a new WSL distribution. - Run the command
wsl --set-default <DistributionName>
to set the new distribution as the default. - Replace
<DistributionName>
with a name of your choice,<InstallLocation>
with the location where you want to install the distribution, and with the name of the .tar file that contains the distribution.
After following these steps, you should be able to run WSL without any errors.
💖 💪 🙅 🚩
EZZAHIR Taha
Posted on May 16, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.