136

I am trying to use bash on Windows 10, but I'm getting this message when tried to run bash:

Windows Subsystem for Linux has no installed distributions. Distributions can be installed by visiting the Windows Store: https://aka.ms/wslstore Press any key to continue...

When I go to that url which opens the Windows Store app, there no sign of any Linux distribution there.

My windows version is(as in my right bottom corner of the screen):

Windows 10 Enterprise Insider Preview. Evaluation copy.Build 16215.rs_prerelease.170603-1840

I follow the instructions in this guide Installation Guide and also was watching this video Editing code and files on Windows Subsystem for Linux on Windows 10 from Scott Hanselman, but they didn't get the message of no installed distribution.

Any Help?

9
  • Cygwin could be alternative, a [Linux/Unix]-like environment for Windows: cygwin.com ... you can get bash, and many other things, from this interface.
    – Paul T.
    Jun 29, 2017 at 19:14
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See What topics can I ask about here in the Help Center. Perhaps Super User or Unix & Linux Stack Exchange would be a better place to ask.
    – jww
    Jun 29, 2017 at 20:33
  • 8
    @jww is not a direct development question, but I need this bash on windows to test some new stuff I am trying with .net core, and all the new stuff in the new Microsoft tech stack, also this is related to programming because a common Windows user does not need this I think.
    – ddieppa
    Jun 30, 2017 at 13:14
  • I read this article today Ubuntu is now available for download on the Windows Store, when open the store shows Ubuntu as not installed app though
    – ddieppa
    Jul 10, 2017 at 19:48

26 Answers 26

173

When the Windows Store opened, there was no Distro to choose, then I found this command lxrun /install and worked for me as well.

You will get something like this as an output:

C:\WINDOWS\system32>lxrun /install
Warning: lxrun.exe is only used to configure the legacy Windows Subsystem for Linux distribution.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore

This will install Ubuntu on Windows, distributed by Canonical and licensed under its terms available here:
https://aka.ms/uowterms

Type "y" to continue: y
Downloading from the Microsoft Store... 100%
Extracting filesystem, this will take a few minutes...
Would you like to set the Ubuntu locale to match the Windows locale (en-FI)?
The default locale is en_US.
Type "y" to continue: y
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: <you type your login here>
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Installation successful!
Documentation is available at:  https://aka.ms/wsldocs
11
  • 1
    Never see a Distro to choose in the Windows Store, but the lxrun/install command worked fine
    – ddieppa
    Jul 7, 2017 at 14:20
  • 2
    Here is a print screen of the process after running lxrun/install Installing Bash on Windows
    – ddieppa
    Jul 7, 2017 at 14:46
  • 1
    When running lxrun the following warning shows up and that is why I downvoted: > Warning: lxrun.exe is only used to configure the legacy Windows Subsystem for Linux distribution. Apr 1, 2018 at 22:02
  • 13
    lxrun doesn't seem to exist on Windows 2019
    – DAB
    Aug 25, 2019 at 18:27
  • 5
    lxrun is replaced by wsl Apr 24, 2021 at 18:46
26

I'm getting a similar bug after trying to uninstall and reinstall.

For me I had to open a cmd prompt as administrator and run lxrun /install

2
  • 1
    When running lxrun the following warning shows up and that is why I downvoted: > Warning: lxrun.exe is only used to configure the legacy Windows Subsystem for Linux distribution. Apr 1, 2018 at 22:40
  • Well it has been a year @RandallFlagg =) , now that distributions are handled in the windows store, the entire question is invalid.
    – Levi
    Apr 2, 2018 at 15:14
25

I get this when I have recently rebooted. If I wait 5 minutes, the problem fixes itself !

5
  • 4
    I'm glad I found this answer, I've been using the Windows Subsystem for Linux for over a year and today when I had just powered on my laptop it was showing up with this error for the first time for me and I thought I was going to have to run the lxrun command from the first answer or find something to install to fix it, but upon seeing this answer, I decided just to wait, and you were right, it did start working after a few minutes.
    – Davy M
    Oct 15, 2018 at 19:13
  • 1
    Oh wow, you are right! I rebooted the first time since I installed WSL and I get this error and freak out. So weird...
    – kyw
    Nov 2, 2018 at 7:33
  • 2
    This is relevant in case you already installed linux distribution from store.
    – Sworgkh
    Nov 30, 2018 at 7:25
  • 1
    this works. this is beyond frustrating. turned off computer, forgot to commit to git, then waited for restart...and now sitting here. any idea why it takes minutes?!
    – chug2k
    Jan 8, 2019 at 13:52
  • 2
    I'm not sure why this happens but rather than waiting 5 minutes restarting the LxssManager service works for me.
    – ctorx
    Jan 23, 2019 at 3:47
21

The top answers written for this question are more than enough. I just had trouble following them because lxrun command has been depreceated, so I get the error

'lxrun' is not recognized as an internal or external command, operable program or batch file.

when I try to run this command with cmd.

It has been replaced with wsl command. You can get more info on this issue here - https://github.com/MicrosoftDocs/WSL/issues/425

When you run wsl /install, there is a chance you may still get the error that you had earlier posted in your question. In that case, simply go to the link https://aka.ms/wslstore as you had gone earlier. If you don't see anything coming up, simply search for Ubuntu and install the same. (If you search with the term wsl though, you will get to see other Linux flavors too and then you can download any of your choice)

2
  • 2
    Thanks for mentioning this. The command lxrun /install didn't work, but wsl /install worked
    – Baig
    May 18, 2020 at 14:47
  • Windows Subsystem for Linux has no installed distributions. Distributions can be installed by visiting the Microsoft Store: aka.ms/wslstore
    – Sayaman
    Jan 30, 2022 at 16:42
17

It seems that the link given in the command doesn't work. Here's the actual link to the microsoft store for Ubuntu.

https://www.microsoft.com/en-nz/store/p/ubuntu/9nblggh4msv6?rtc=1

1
  • This works if searching for Linux on the store doesn't return anything.
    – Karlth
    Apr 2, 2018 at 11:06
8

If you have any problems with running lxrun /install (for example on ltsb Windows version) try manual mode.

First, go to the folder with downloaded .appx file and run following commands (change filename if needed):

Rename-Item ~/Ubuntu.appx ~/Ubuntu.zip
Expand-Archive ~/Ubuntu.zip ~/Ubuntu

After finishing cd into new folder and run ubuntu.exe file. That's it.

3
  • 1
    This is the only answer that worked for me on Server 2019 build 1809
    – Gostega
    Jun 24, 2020 at 5:20
  • Amazing, this totally worked for us too.
    – Beoski
    Feb 17, 2022 at 0:42
  • I get Operation Failed. False v4.0.30319 C:\Program Files\PowerShell\7\WindowsBase.dll
    – Gilbert
    May 30, 2022 at 8:01
7

You have to go to https://aka.ms/wslstore this link and download ubuntu on windows. After that you can use bash on windows.

6
  • The link doesn't work for all countries it seems. Why on earth would they put region locking there?
    – Karlth
    Apr 2, 2018 at 11:05
  • This doesn't work. It opens the store and says something is wrong, no distros are showing. Oddly, they're accessible from search, but there's no list of the WSL distros
    – Zoe is on strike
    Apr 4, 2019 at 19:28
  • @Zoe I think that must be on your end because, ironically enough I just did that very step successfully just 55 minutes after you commented. Maybe try again! :)
    – joshmcode
    Apr 4, 2019 at 20:25
  • @joshmcode it's been 19 hours, still doesn't work. Still the same "Please wait a little while, and try again". If 19 hours doesn't fix it, there's no point in trying. As mentioned in the first comment on this question, this may be a regional issue, in which case waiting won't fix anything.
    – Zoe is on strike
    Apr 5, 2019 at 14:46
  • I see. Sorry! :( I hope you're able to figure a workaround out soon.
    – joshmcode
    Apr 7, 2019 at 21:48
6

For everyone who is getting

'lxrun' is not recognized as an internal or external command,
operable program or batch file.

or

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

Open microsoft store, install 'Ubuntu' then open the app. This will install ubuntu and later you can use wsl command since lxrun is deprecated

5

If you get this error after installing a distribution using the windows store, and WSL was working previously, you may need to make sure that the LxssManager service is running, since it often stops after a Windows update or a reboot.

Go to services.msc, and search for LxssManager and start it; if it is running already, restart it.

3
  1. Go to add or remove programs
  2. Install Windows subsystem for Linux
  3. Go to https://aka.ms/wslstore, which will take you to the Microsoft Store
  4. Select and install a Linux distribution
2
lxrun /install

Works on a Administrator Command Prompt for Windows 10 Professional, Version 1803 Build 17134.165

This installs GNU/Linux by default whereas there is an option to select between:

  • Ubuntu
  • openSUSE Leap 42
  • SUSE Linux Enterprise
  • Debian GNU/Linux
  • Kali Linux

If the given link (https://aka.ms/wslstore) works, it openes the windows store for me with an error saying something is wrong on their side and to try again later.

2

It's actually easier to solve this problem that other solutions listed here. If you run wslconfig /l and if the output is:

Windows Subsystem for Linux Distributions: Ubuntu (Default)

Just run wslconfig /s Ubuntu to set Ubuntu as default again. It should start working now.

Edit:

I've also found that if this problem occurs on a fresh boot, then you just wait for a few minutes (10 minutes max) and this error automatically disappears.

Edit 2: I've also found that this error is sometimes also due to the corresponding service not running. Run CMD as administrator and run

net start LxssManager

2

For running bash on windows ubuntu is required to be installed.

As you've already added bash from programs and features, now you need to install Ubuntu. Contrary to what is seen in most of the installation guides on web, it does not gets installed by running 'bash.exe'.

You can simply go to Microsoft store in search for 'Bash' or 'Ubuntu'and install Ubuntu 18 LTS from there.

After installation you'll be able to use the terminal and all its commands.

1

I had this same issue. But when you go to the windows store you can search for ubuntu and then install the ubuntu app and it works. I think most of the tutorials on the net are from the beta version and have afterwards never been updated.

https://insights.ubuntu.com/2017/07/11/windows-10-loves-ubuntu-loveislove/

Note: This is also old. You do not need to be on the insider builds. I'm not and it worked.

1

Run the bash command in git bash windows. It worked !!

2
  • Not to be marked as the correct answer, but definitely useful in a hurry. Thanks! Aug 21, 2021 at 17:56
  • If the PATH isnt set up right, and trying to run bash from CMD or elsewhere, the WSL fake "bash" can still be invoked and tries to install via WSL. To get around that cp /c/path/to/bin/bash.exe /c/Windows/System32/bash.exe - No more WSL. Apr 29, 2022 at 7:17
1

The only thing that worked for me is described here https://learn.microsoft.com/en-us/windows/wsl/install-manual#downloading-distros

  1. https://aka.ms/wsl-ubuntu-1804
  2. manually install it or run Add-AppxPackage.\.appx from PowerShell
1

The link to the store appears to have a region lock in it, resulting in errors for many visitors.

However there are different Ubuntu distributions to be downloaded. See image below, image is however in Dutch but it will show results.

So pick a version you desire and it will result in a working bash.

enter image description here

1

The actual answer to the question query is: The user exists with Ubuntu already installed. But WSL command does not find anything in CMD.exe "Command Line" "System does not find distribution."

You need to start the below WSL command from Windows Start Menu. And then the old Linux System will show up on WSL in the command line as found.

If this doesn't work for you? Just start up PowerShell with Administrator and:

WSL --help
WSL "only this command, will start the Linux default distro selected"

Run the WSL

You can then start up using this command with CMD.exe Administrator in Windows:

lxrunoffline l "This will now list all your distros"

With an option to remove old distros copied to Windows folders are with perhaps Ubuntu18.04 such way that you will have to use Linux to remove older folders, do not try to copy or edit files in a distro with Windows Apps. You risk integrity problems as well as many errors followed by huge processing time. Use folder /mnt to find your drive with Linux and use commands there to further finish your work as perhaps copying the home directory into a new distro.

My solution to move "not copy" my distro then was: "to give space for C:"

lxrunoffline m -n Ubuntu-18.04 -d d:\wslinstalled\Ubuntu-18.04 "remember folder names"

"Remember folder name such as Ubuntu-18.04 for a specific movement. Unless you will overwrite everything on that folder name with also the lxrunoffline files and you risk losing older copies if you use one folder name. You might end up with a strange name to your project if you just use one directory."

Lxrunoffline has several other commands if you need help just run:

lxrunoffline
1

As of 2022, New Linux distributions are available for Windows 10 as well as Windows 11 like Kali Linux and Ubuntu. Both available from Microsoft Store. Someone watching this question now can visit Microsoft Store to Download them..

0

like beginner_ said in his answer you need to go to the store and look for the distros you want to install. Please see the following link to understand what has changed and what you can excpect or what distros you can look for(the list is outdated so just try to find an updated list or just try your luck).

I am running on my machine without the developer mode Ubuntu, OpenSuse and Kali.

0

Access to Microsoft Store is blocked by my company. For me following worked in PowerShell (admin) -

lxrun /install  
0

Go to cmd, and then run the following command: lxrun /install

0

Typing lxrun /install in elevated command prompt works....

0

The solution to the error "WSL 2 installation is incomplete",

Execute the following steps:

  1. wsl --install -d Ubuntu ## lxrun is no more, its now replaced with wsl, Refer here for samples.

  2. wsl

Refer here for samples.

0

the following command can be used for the Ubunto installation on windows from cmdinstallation of Ubunto

wsl --list --online

official link: https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-11-with-gui-support#3-download-ubuntu

1
0

As of 2023 Nov, Windows 11, none of the above options worked. Installing git bash worked in running .sh files but that didnt solve the underlying problem I had (wanted to compile cpp files) I had to move to Cygwin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.