Bash on Ubuntu on Windows not starting

Viewed 65121

So, I've been using the new(ish) Bash on Ubuntu on Windows (WSL) for a while now and all has been top-notch, until yesterday.

I git-pushed from Bash by accident, so it asked me for my repo-destination account details like normal. I decided to ignore this, terminate Bash and try to just use powershell instead (can't ever remember passwords!). Terminating Bash however caused the shell to freeze. I forced closed and restarted my comp (I've had to force close and restart several times before for various reasons and everything was fine).

After boot up, I just tried to check if Bash was working again, but it wasn't. It just failed to start with no error message. For example:

PS C:\WINDOWS\system32> bash
PS C:\WINDOWS\system32>

Has anyone else had a similar situation/knows how to help?

EDIT: Only solved through reinstalling bash, using

    lxrun /uninstall /full

then

    lxrun /install 
12 Answers

I had the same issue but my solution was different. I found that my (Default) WSL distribution was set to docker-desktop-data instead of my Ubuntu distribution, e.g.

In PowerShell (Windows Shell): wslconfig /L

This lists WSL distributions. For me "docker-desktop-data (Default)" was listed as default not my Ubuntu distribution.

To change this:

In PowerShell (Windows Shell): wslconfig /setdefault Ubuntu-20.04

The solutions listed also did not work for me. I found a solution here.

Essentially, navigate to Control Panel > System > Advanced System Settings > Advanced > Settings > Advanced > Virtual memory, Change ..., and set a Custom size for the paging file size: 800 min and 1024 max. Restarted, and the command prompt came back.

I've had similar issues. The solution for me was to disable fast startup in powers settings.

Do a FULL REBOOT. That worked for me. Windows 10 fast boots system to save memory. TO do a Full Reboot Hold Shift and Click on Restart/Shutdown.

Linux Distribution should be installed additionally to Windows Subsystem for Linux. See Install WSL on Windows 10 or Install WSL on Windows Server for detailed steps and explanations. In case mentioned manuals are moved or not available I'll put below main steps for Windows 10 that helped me:

  1. Open PowerShell as Administrator and run Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  2. Restart computer if prompted.
  3. Open PowerShell and run Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1804 -OutFile Ubuntu.appx -UseBasicParsing
  4. Execute the downloaded Ubuntu.appx.
  5. Enjoy running bash on Windows again.

I had the same issue the following fix worked for me:

Fix:

  1. restart by clicking shift + restart button.
  2. it will load recovery options, just click on continue to windows.
  3. once pc starts open the terminal by start search for ubuntu click enter
  4. once terminal gets open it might show cursor blinking and does nothing.
  5. just press cntrl+c or cntrl+z and you will have problem solved.

See my comment to original poster. Your fix did not work for me. here is the PowerShell [as admin] listing: Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved.

PS C:\WINDOWS\system32> lxrun /uninstall /full
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 uninstall Ubuntu on Windows.
This will remove the Ubuntu environment as well as any modifications, new applications, and user data.
Type "y" to continue: y
Uninstalling...
Error: 0x80070002
PS C:\WINDOWS\system32>

I went to https://aka.ms/wslstore

  • chose ubuntu
  • it downloaded
  • clicked 'pin to start'
  • clicked 'Launch'

Ubuntu [window]:

Installing, this may take a few minutes...
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: joe
Enter new UNIX password: joepw202

Installing, this may take a few minutes...
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: joe
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
Installation successful!
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

joe@joethinks:~$

Please note: BUMMER! None of my shortcuts or installs were moved over from my last version. Here i am running BASH from vscode:

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

joe@joethinks:/mnt/c/1d/TrinitySundayMusicPj$ cdtsm
cdtsm: command not found
joe@joethinks:/mnt/c/1d/TrinitySundayMusicPj$ cd trinitySundayMusic
joe@joethinks:/mnt/c/1d/TrinitySundayMusicPj/trinitySundayMusic$ node wizard.js
The program 'node' is currently not installed. You can install it by typing:
sudo apt install nodejs-legacy
joe@joethinks:/mnt/c/1d/TrinitySundayMusicPj/trinitySundayMusic$

At least it works.

Right after Windows Updates KBB4471324 and a reboot, Bash wouldn't launch. No messages.

In event viewer I saw messages about

The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID

I didn't bother trying to figure out if the SID, CLSID and APPID were associated with bash.

I launched Bash as administrator, which worked, and then bash as a normal user, which worked. It seems to be fine, now.

Section i: other error messages.

  • This error is closely followed by a second error, code 0x80070057 (see section 2)!

  • This error also manifests as "Windows Subsystem for Linux has no installed distributions. Distributions can be installed by visiting the Microsoft Store: https://aka.ms/wslstore" by typing Bash at cmd/powershell. Use Section 1 then Section 2.

Section ii: verify your installation and restart.

Be sure that WSL (Windows Subsystem Linux) is checked/installed and your computer had a proper restart: {⊞START} → type "features" (ensure "Turn Windows features on or off" is selected). → {ENTER}. → Turn Windows Subsystem for Linux on. → Press OK. → Restart your computer immediately after the installation has finished.

Section 1a: Install Linux [via the Microsoft Store].

  1. Press {⊞START} on your keyboard.
  2. Type "store" ensure "Microsoft Store" is selected. → {ENTER}}.
  3. {SHIFT}-{TAB} twice (highlight search). → {ENTER}.
  4. type "subsystem". → {ENTER}.
  5. Select your flavor of Linux (i.e., "Ubuntu LTS 18.04") and click "Install".
  6. {⊞START}. -> Type "ubuntu" (ensure Ubuntu App is selected). → {ENTER}.

Section 1b: Side-load Linux.

*This is a placeholder--you can manually install WLS--https://docs.microsoft.com/en-us/windows/wsl/install-manual. I have not done this, yet. If you have done this, please add instructions by editing my answer; otherwise, I will post this section after performing this operation myself.

Section 2: if launching Ubuntu throws 'WslRegisterDistribution failed with error: 0x80070057'**

After installing a linux flavor:

  1. {⊞START} → type "features" (ensure "Turn Windows features on or off" is selected). → {ENTER}.
  2. Turn Windows Subsystem for Linux off. → Press OK.
  3. Turn Windows Subsystem for Linux on.
  4. Restart your computer.
  5. {⊞START}. → type "ubuntu" (ensure "Ubuntu App" is selected). → {ENTER}

**This is the most-accepted solution for this issue is the last answer on page two at Microsoft Answers.

What worked for me was to disable and enable WSL feature from control panel:

  1. Control Panel --> Programs and Features --> Turn Windows Feature on or off
  2. Uncheck "Windows Subsystem for Linux"
  3. Uninstall Ubuntu from Windows
  4. Restart
  5. In (1), check "Windows Subsystem for Linux"
  6. Install Ubuntu
  7. Success!

If none of the previuos answers worked for you, try this workaround, after trying different alternatives, this one worked for me.

  1. Run windows + R
  2. type SystemPropertiesAdvanced
  3. click settings in performance group
  4. In advanced tab, deselect the automatically manage paging file size for all drives
  5. Select custom size and enter 800 for initial size, 1024 for maximum size.
  6. Apply changes and restart.
Related