52

I have been using Windows 10's Windows Subsystem for Linux bash (Ubuntu via Microsoft Store) in the last few weeks, no problem, awesome feature, couldn't be happier.

But today it suddenly stopped working. Typing bash just does nothing on the command line (cmd and PowerShell), as if it would be waiting for something. It doesn't crash or output an error message, but just keeps showing a blinking cursor.

enter image description here

(Cursor not visible on screenshot, it is a blinking _ on the next line after bash)

Task manager shows both command lines at 0% CPU with a "Microsoft Bash Launcher" process also at 0% CPU:

enter image description here

Any idea how to debug and fix this?

Update: After a few manual restarts and one "crash" (I think explorer.exe stopped, and didn't really come back after killing the process after a prompt) it now works again for now.
I had the problem a few weeks before (where I fixed it be reinstalling WSL), so I assume it will reappear sooner or later.

janpio
  • 2,396
  • 8
  • 25
  • 34
  • I would uninstall and reinstall `WSL Ubuntu`, I normally would suggest you reset it, but that requires a working instance. – Ramhound Dec 08 '17 at 20:04
  • Some really smart folks seems to have found a solution to the problem. Check out the [solution here](https://github.com/Microsoft/WSL/issues/849#issuecomment-252053937). – Vinayak Dec 08 '17 at 20:15
  • In order to uninstall the WSL you have to use [wsl-config](https://docs.microsoft.com/en-us/windows/wsl/wsl-config) – Ramhound Dec 08 '17 at 20:29
  • Is `wsl.exe` working? – Biswapriyo Dec 09 '17 at 08:02
  • @Biswa No, exact same behaviour for `wsl.exe` and `ubuntu`. Also when running PowerShwell or `cmd` as Administrator. – janpio Dec 09 '17 at 15:26
  • @Ramhound Thanks for the link to `wsl-config`, but I want to avoid re-installation if possible. Get a working setup was not easy, and to be honest I have no idea how to recreate it. Will take better notes if I really find no other solution though. – janpio Dec 09 '17 at 15:30
  • So did you attempt the pagefile solution. If you didn’t then you are out of options. – Ramhound Dec 09 '17 at 15:53
  • "Unfortunately" (I am actually pretty happy about it for now...) after a few manual restarts and one "crash" it now works again for now. I had the problem a few weeks before (where I fixed it be reinstalling WSL), so I assume it will reappear sooner or later. – janpio Dec 09 '17 at 18:16
  • Do you have [detailed logs](https://github.com/Microsoft/WSL/blob/master/CONTRIBUTING.md#8-detailed-logs) we can review? – Jaime Aug 08 '18 at 21:31
  • Looks like a duplicate of https://stackoverflow.com/questions/44049070/bash-on-ubuntu-on-windows-not-starting – Eyal Roth Oct 04 '18 at 17:53
  • @EyalRoth: Indeed ... although this seems the more appropriate site. – GreenMatt Feb 12 '19 at 23:06

2 Answers2

56

Try to do a full reboot of Windows10, hold Shift, and click “Restart.”

Normal reboot/shutdown action in the start menu will not shutdown Windows 10 fully, for the “fast boot” mechanism saves memory from the last session. The other answer mentioned changing system settings which make Windows 10 doing a full reboot, it works, but unnecessary.

By holding the Shift key and click the “Restart” in the start menu, Windows 10 will go into advanced restart mode, choose “Shutdown” from the menu. Then start normally again.

Giacomo1968
  • 53,069
  • 19
  • 162
  • 212
BOYPT
  • 671
  • 5
  • 4
14

As discussed on https://github.com/Microsoft/WSL/issues/849 by user imkimchi the steps for solving this issue are:

  1. Run windows + R
  2. type SystemPropertiesAdvanced
  3. click settings in performance group
  4. In advanced tab, click Change under Virtual Memory and 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.
SpookyGengar
  • 103
  • 2
enharmonic
  • 309
  • 2
  • 11
  • 3
    This is not a complete solution. I suspect changing the page file management itself causes WSL to start working again. Mine got stuck, and I got it working after reading this answer, but then after a month or so, it got stuck again. I reverted my virtual memory to "System Managed", and WSL started working again. I don't know what to make of it :-| – kumarharsh Apr 03 '19 at 06:55
  • 1
    When I went to this window I already had almost 32gb of RAM allocated... so I think this is not the solution. – Jim Oct 26 '20 at 13:48
  • When I restart my PC, my WSL instance usually starts working again without having to change this. ¯\\_(ツ)_/¯ – Qwerty Feb 23 '22 at 17:31