6

I have just installed WSL 2 but I have difficulties to launch it.

My installation

I did the official installation from Microsoft. Manual installation, I chose "Ubuntu" in the Microsoft Store and it installed Ubuntu 20.04 : https://docs.microsoft.com/en-us/windows/wsl/install-win10

I have a Dell Inspiron 5593, processor Intel(R) Core(TM) i7-1065G7 CPU. I am on Windows 10, version 2004, build 19041.1083.

The issues

  • When I execute wsl or wsl.exe in the command prompt or power shell, nothing happens.

  • When I search "wsl" in the taskbar and click on the icon, a Linux terminal appears and disappears quickly.

  • After I followed the previous points, wsl.exe --list --all --verbose in the power shell gives me :

    NAME                   STATE           VERSION
    docker-desktop-data    Stopped         2
    docker-desktop         Stopped         2
    Ubuntu                 Stopped         2
    

(with a * before "docker-desktop-data")

  • The only way I have found to launch it is to go to the Microsoft Store, find Ubuntu and click on the "launch" button. Then a terminal opens and I can execute Linux commands without other issue.
  • When I try to execute WSL commands (except wsl.exe --list --all --verbose) on command prompt or power shell it says my command is invalid and prints the usage informations.

What I tried to solve the problem

  • Execute sudo apt get-update on a Linux terminal.
  • Open the Windows settings, clicked "check for updates" and I don't have any update to do.
  • Make sure "Windows sub system for Linux" is enabled in Windows settings.
  • Read the following links :

"Troubleshooting installation" section at the end of the installation page : https://docs.microsoft.com/en-us/windows/wsl/install-win10

https://docs.microsoft.com/en-us/windows/wsl/troubleshooting

  • And other old links, apparently trying to solve an elder bug from august/september 2020 :

https://github.com/microsoft/WSL/issues/5836

WSL Bash doesn't start and tried the two answers

https://github.com/microsoft/WSL/issues/5912

2
  • Look in Programs and Features, Windows Features, and ensure WSL is enabled (down at near the bottom of the list).
    – anon
    Commented Jul 9, 2021 at 11:13
  • Have you tried removing and reinstalling the WSL instances?
    – Ramhound
    Commented Jul 9, 2021 at 11:59

1 Answer 1

7

Could be wrong/no default distribution. Try setting the default distribution:

wsl --set-default Ubuntu

If that fails, try unregistering and reinstalling the distribution.

wsl --unregister Ubuntu

then go to the Microsoft store and click Launch.

3
  • "wsl --set-default Ubuntu" worked ! Thank you. Is it normal that wsl launches in the Windows command prompt ? When I click on "launch" in the Microsoft Store, it is different : it opens a Linux terminal with the Ubuntu icon.
    – shrimp
    Commented Jul 9, 2021 at 12:34
  • Unless something's change in the Store installation of Ubuntu recently, it should be the same underlying terminal app ("Windows Console") either way, just with a different icon. Click on the icon for both -- Do the menus look the same? Anyway, my recommendation is to install Windows Terminal, Microsoft's newer, open-sourced, much more-feature reach "replacement" (at some point). It can be installed from the Store as well. It has auto-detection for WSL installations, so it will create a menu entry for each in the event you install more than one. Commented Jul 9, 2021 at 13:36
  • wsl -l will list available images, thank you, it helped me to fix the issue I was facing.
    – ImtiazeA
    Commented Jul 17, 2021 at 17:35

You must log in to answer this question.

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