Bash on Ubuntu on Windows not starting

oblong picture oblong · May 18, 2017 · Viewed 43.9k times · Source

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 

Answer

Mark picture Mark · Jun 25, 2020

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