1

I have went through the process of manually enabling WSL 2. There are no errors at any point of the installation process. I'm on Windows Version 10.0.19045 Build 19045 which is supported by WSL 2. Ubuntu and Debian run fine after going through those instructions. Running wsl.exe or wsl -l -v; however, fails and instead of running provides the following error messages:

Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore

I actually installed Ubuntu from the store after following the instructions. I'm able to run most programs that I have installed. After installing Docker, I tried to run it from Ubuntu only to get an error message instructing me to upgrade to WSL 2:

The command 'docker' could not be found in this WSL 1 distro.
We recommend to convert this distro to WSL 2 and activate
the WSL integration in Docker Desktop settings.

For details about using Docker Desktop with WSL 2, visit:

https://docs.docker.com/go/wsl2/

Did I miss a step or is this a bug that needs to be fixed?

In terms of features I have "Virtual Machine Platform" (a subset of Hyper-V) and "Windows Subsystem for Linux" enabled. I disabled Hyper-v because that causes Docker on Windows to fail after install.

Also note that wsl.exe seems to be confussed about what is installed:

PS C:\WINDOWS\system32> wsl --install -d Ubuntu
Ubuntu is already installed.
Launching Ubuntu...

suggesting Ubuntu is available to WSL but then again I cannot run wsl.exe without error nor can I upgrade any distribution as There is no distribution with the supplied name.

2 Answers 2

1

Well, when in doubt RTFM. In the troubleshooting link:

Error: Windows Subsystem for Linux has no installed distributions. ... Check whether you may be running separate user accounts.

Running your primary user account with elevated permissions (in admin mode) should not result in this error, but you should ensure that you aren't accidentally running the built-in Administrator account that comes with Windows.

After using my normal account, rather than the administrator account we are instructed to use in the original documentation to install WSL 2, I was able to see the WSL commands run successfully. Docker in Ubuntu doesn't run still and still has the same error.

To convert existing distributions run the following command as the normal user but not an administrator: > wsl --set-version <distribution> 2. Find the distribution name and WSL version by running the following command: > wsl -l -v.

3
  • 1
    Glad you got it figured out! Re: "rather than the administrator account we are instructed to use in the original documentation to install " -- As a heads-up, the install doc also says to use administrator mode by clicking "Run as Administrator", not to run as the system administrator account. ;-) Commented Nov 23, 2022 at 18:22
  • @NotTheDr01ds, Running it that way was how I got the error. I had to open a new PS terminal the normal way to run half of the commands. I put in a request to add notice at each step to show which must be run without admin privileges. I never logged in as an admin. I used run as administrator from the context sensitive menu.
    – haleonj
    Commented Nov 23, 2022 at 19:52
  • I'm using the admin account created during OOBE rather than the builtin one, and I have the same issue as OP.
    – Spencer
    Commented May 8, 2023 at 15:07
-1

I was running into this problem as well, and the solution was to open the Windows utility "Add or Remove Programs", find my linux distribution (in this case Ubuntu-20.04), and click the "Uninstall" button. Then I could reinstall the distribution fresh from the powershell CLI with wsl --install Ubuntu-20.04. You can confirm that it's actually removed by going to C://Users/<your user>/AppData/Local/Packages/ and checking that the folder for your distribution (In my case it was something like CanonicalGroupLimited.Ubuntu20.04LTS_...) is gone. If you also want to back up your data before wiping the distro, that is located under C://Users/<your user>/AppData/Local/Packages/<your distro>/LocalState/ext4.vhdx; copy this somewhere else before reinstalling, and then copy it back when you're done.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .