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
Procedure One. It is required to follow a step-by-step process to enable Bash in Windows 10, so, in the first step, enable the Windows Subsystem for Linux. Search the term “feature” in the Start Menu search bar and select “Turn Windows feature on and off” from the results list.
Press Windows key + X then click Command prompt, at the command prompt, type: bash then hit Enter. If you want to be able to access the local file system, press Windows key + X, Command Prompt (Admin) then type bash at the prompt.
Ensure that you have the Windows Subsystem for Linux enabled, and that you're using Windows Build version 18362 or later. To enable WSL run this command in a PowerShell prompt with admin privileges: Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux .
Note that bash runs natively on Windows 10, which is different from using emulators like 'cygwin' for Windows which enabled GNU tools to run on unsupported Windows environment. Also, Linux subsystem for Windows 10 is only available on the 64-bit version of the OS.
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
Came here with a similar issue, but a different solution, so I'll post in case it helps anyone else.
The difference in my situation was that, when running bash
through Command Prompt, it complained about Legacy Mode being enabled.
win+r
then cmd
)Properties
Now it should work either by launching the standalone app, or typing bash
into a regular cmd
window after restarting Command Prompt.
This and other causes can be found in this Github issue.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With