Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bash not starting #849

Closed
samiksome opened this issue Aug 10, 2016 · 47 comments
Closed

Bash not starting #849

samiksome opened this issue Aug 10, 2016 · 47 comments

Comments

@samiksome
Copy link

@samiksome samiksome commented Aug 10, 2016

Bash is not opening after closing the scheduled apt package index update task.

I tried restarting but its still not working. Whenever I run bash the command prompt simply becomes unresponsive.

Build : 14393.51

This is what happened
1> restarted computer for some reason. apt package index update started in a command prompt window. Seemed unresponsive, so I closed it.
2> tried running bash but nothing happens. It simply shows the cursor. Ctrl+C or any other combos don't work.
3> Tried restarting. still doesn't work.

[ possible related issue #422 ]

@benhillis

This comment has been minimized.

Copy link
Member

@benhillis benhillis commented Aug 10, 2016

Are you using a third party firewall? Some are known to block network traffic and cause this issue.

@samiksome

This comment has been minimized.

Copy link
Author

@samiksome samiksome commented Aug 10, 2016

No third party firewall.

@samiksome

This comment has been minimized.

Copy link
Author

@samiksome samiksome commented Aug 11, 2016

UPDATE:

I tried uninstalling bash using lxrun /uninstall /full
It uninstalled properly.
Now when I try to install it using either bash or lxrun /install, it gets stuck at extracting filesystem...

@diff-by-default

This comment has been minimized.

Copy link

@diff-by-default diff-by-default commented Aug 11, 2016

Same windows build, same issue here. Installation originally hung at "extracting filesystem" for a few hours...killed it, uninstalled, attempted to reinstall, same issue. No luck on my end so far.

@aidanhs

This comment has been minimized.

Copy link

@aidanhs aidanhs commented Aug 13, 2016

Same windows build here. It installed fine originally and continued working fine across reboots. But after I rebooted yesterday it's now hanging. I don't remember seeing anything to do with apt-get update and I've completely disabled avast and rebooted multiple times.

While it's hung I have two init processes, one hanging off the lxssmanager svchost and the other a child of the first init. The latter sits at 25-30% cpu for as long as I've been patient to leave it (15 mins).

I've followed the instructions at #410 (comment) and sent an e-mail as instructed - I know it wasn't explicitly requested for this issue, but I figured it wouldn't hurt. The trace starts before bash is started and was stopped after it was hung for around a minute (iirc). Be warned: the zip is ~100MB because lxcore_kernel.etl is about 4GB!

I subsequently attempted a full reinstall and it hung during extraction.

@samiksome

This comment has been minimized.

Copy link
Author

@samiksome samiksome commented Aug 13, 2016

I can also confirm this. I just checked it again and there are indeed two init processes. Also same behaviour with cpu usage (the first does not use any, the latter around 25%).

@benhillis

This comment has been minimized.

Copy link
Member

@benhillis benhillis commented Aug 16, 2016

@aidanhs Thank you, I received your traces and will take a look this morning.

@aidanhs

This comment has been minimized.

Copy link

@aidanhs aidanhs commented Aug 17, 2016

Additional notes:

  • I totally removed and reinstalled the linux subsystem feature, no joy
  • I created a new user, they also hang on install with the same isse
@xeiiskeksx

This comment has been minimized.

Copy link

@xeiiskeksx xeiiskeksx commented Aug 19, 2016

Hey there.

I have the same build and also got stuck without any errors.
I tried to install the "Bash on Ubuntu on Windows" feature with cmd and windows powershell.
But every time I got stuck at "extracting files". One time I waited 2 hours, but no progress was made.

Is there any workaround?

@samiksome

This comment has been minimized.

Copy link
Author

@samiksome samiksome commented Aug 31, 2016

My bash has suddenly started working again ... I don't know what triggered it ... I restarted my pc a couple of times today and later for some reason opened powershell and typed bash and somehow it was working ... I uninstalled and reinstalled and its still working properly.

@samiksome

This comment has been minimized.

Copy link
Author

@samiksome samiksome commented Sep 2, 2016

It has stopped working again after a restart

@coldasparagus

This comment has been minimized.

Copy link

@coldasparagus coldasparagus commented Oct 5, 2016

Hi, I finally found some info (this issue, #849) on this problem. With Google I've found nothing.

I have the identical problem. bash.exe just hangs despite multiple install/deinstall, etc. Including an uninstall "-Full" using PowerShell of the LXSS subsystem. Also, a newly created user using bash.exe hangs after "extracting filesystem", etc. just as previously described.

I traced the binary of bash.exe, using Process Explorer (sysinternals). It hangs forever on WaitForMultipleObjects(). I compiled the "outbash" project (found on github, it's a reimplementation of bash.exe) and when running it, it had the same behavior. It hung forever on WaitForMultipleObjects().

It seems to be sending a command line to some localhost port (some service?) but the service is never responding. I also get the AptPackageIndexUpdate window popping up, it does the apt-get update, however the window hangs on the screen until I hit the close button.

This is all after using LXSS quite successfully from the release of the Anniversary Update. It just randomly stopped working as described. I suspect the KB3194496 cumulative update. However, unfortunately, W10 has no way to roll back system updates which I know of. For the time being I'll just continue with the MSYS2 project and use Linux on VirtualBox with a local Windows X11 server.

Thanks, Alex

@coldasparagus

This comment has been minimized.

Copy link

@coldasparagus coldasparagus commented Oct 5, 2016

Hi, I had a look at the debug of "cbwin" again. It may be it's simply calling C:\Windows\System32\bash.exe and waiting for that. But something's clearly waiting for something ... "HANG"!

@coldasparagus

This comment has been minimized.

Copy link

@coldasparagus coldasparagus commented Oct 6, 2016

I found my solution, in another thread involving "multiple pagefiles" which is now marked "closed with workaround." Sorry I can't recall which number it is.

It was the solution to the exact problem of bash.exe hanging, AptPackageIndexUpdate window appearing and freezing, etc., at least for me.

I had changed to a C-drive pagefile of 800-1024, and in addition a system-managed size for drive D:, E:, and F:, which are all 1.8TB drives (C: is 512GB SSD). I had then tried all uninstalls, reinstalls, etc., thinking nothing of changing the pagefiles. I had suspected the usual: latest windows update, AVG antivirus hook DLL, etc.

Reading through the other issue, they suggested having only one pagefile as a workaround. I simply reconfigured the pagefiles to one only on C: (system managed) and "None" on the other three. Reboot, then bash.exe immediately shows me the Linux prompt.

Great day, thanks!

Alex

@chanduch06

This comment has been minimized.

Copy link

@chanduch06 chanduch06 commented Nov 17, 2016

HI started using Bash on ubuntu on windows. It was working well since two months, suddenly it stopped working. I couldn't able to figure it out what exactly happened. could you please help me to resolve this issue

@benhillis

This comment has been minimized.

Copy link
Member

@benhillis benhillis commented Nov 17, 2016

@chanduch06 - Can you please provide a little bit more information? What behavior are you experiencing?

@benhillis

This comment has been minimized.

Copy link
Member

@benhillis benhillis commented Jan 10, 2017

Closing this out since @coldasparagus has resolved his issue.

@benhillis benhillis closed this Jan 10, 2017
@inderpartap

This comment has been minimized.

Copy link

@inderpartap inderpartap commented Feb 12, 2017

I decided to just start a shell prompt and type bash in it. The error message was about the "legacy mode enabled". To change it:

  1. Right click on the cmd prompt window.
  2. In the option tab, uncheck the "Use legacy console"
  3. Apply the changes and restart cmd.exe
  4. type bash.
  5. Installation will start.
@imkimchi

This comment has been minimized.

Copy link

@imkimchi imkimchi commented Aug 14, 2017

a bit more details about @coldasparagus 's explanation

  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.

And there you go

@benallard

This comment has been minimized.

Copy link

@benallard benallard commented Oct 9, 2017

Changing the page settings from System-managed to 800-10240 fixed it for me as well.

However, I'd like to consider this as a work-around, and not a real fix please.

@benhillis

This comment has been minimized.

Copy link
Member

@benhillis benhillis commented Oct 9, 2017

A fix for this issue was included in creators update.

@heybrighteyes

This comment has been minimized.

Copy link

@heybrighteyes heybrighteyes commented Oct 24, 2017

Unfortunately, the issue still occurred on my machine after installing the Creators Update. The workaround fixed it for me (for now).

@gititGoro

This comment has been minimized.

Copy link

@gititGoro gititGoro commented Oct 27, 2017

I just tried the virtual memory fix by @coldasparagus and @imkimchi. I only have one drive and it's a 256gb SSD. The fix worked for me as well.

@raven-rwho

This comment has been minimized.

Copy link

@raven-rwho raven-rwho commented Nov 14, 2017

I just used the virtual memory fix by @coldasparagus and @imkimchi - works like a charm thx 👍

@Sorok-Dva

This comment has been minimized.

Copy link

@Sorok-Dva Sorok-Dva commented Dec 17, 2017

Hi, I'm on the last update, I tried @imkimchi fix but each time, after using bash a while, bash just handle and not responding.
I use bash to run a node.js server, when I close the bash term, localhost is still handling.
What I have to do please ? It's very annoying, and my windows was recently reset to factory (reinstall)

@devcircus

This comment has been minimized.

Copy link

@devcircus devcircus commented Jan 9, 2018

On 10.0.16299 and the page settings fix worked for me. Thanks for this info. ⭐️⭐️⭐️⭐️⭐️

@JonathanWade

This comment has been minimized.

Copy link

@JonathanWade JonathanWade commented Feb 3, 2018

This worked for me as well; 10.0.16299 Win10 pro. I have a fast M2 SSD drive and 32GB of system RAM so this is surprising. The automatically managed page file reported itself as being 5120MB.

Potentially related: other programs seemed really slow to launch (under essentially idle system load) and I noticed Service Host: Local Session Manager was hogging a constant 10% of my CPU. Changing to manual pagefile both brought back WSL bash and removed the local session manager issue.

@david-jankoski

This comment has been minimized.

Copy link

@david-jankoski david-jankoski commented Feb 15, 2018

Had similar issue on
Win10Pro Build17074.rs_prerelease_flt180116-1539
was using the ubuntu subsystem perfectly fine for a while and today it stopped working for no apparent reason. following @imkimchi steps fixed it. thanks.

@japadgett2

This comment has been minimized.

Copy link

@japadgett2 japadgett2 commented Mar 22, 2018

Thank yo @imkimchi @coldasparagus !!!

@ELI7VH

This comment has been minimized.

Copy link

@ELI7VH ELI7VH commented Apr 25, 2018

@imkimchi thank you for the clear directions! Worked for me. It just started happening yesterday on a 3-week old system.

would love to know why this happens.

@burxtx

This comment has been minimized.

Copy link

@burxtx burxtx commented Sep 28, 2018

@imkimchi Thanks! Work good for me.

@burxtx

This comment has been minimized.

Copy link

@burxtx burxtx commented Sep 28, 2018

@imkimchi Thanks! Work good for me.

Not enough memory will occurs and applications crash was observed after this setting take effect.

@eyalroth

This comment has been minimized.

Copy link

@eyalroth eyalroth commented Oct 4, 2018

Happened to me today on version 10.0.16299.461. @imkimchi solution worked for me as well.

@benhillis Why is this issue not being re-opened? Looks like it still affects newer releases.

@eyalroth

This comment has been minimized.

Copy link

@eyalroth eyalroth commented Oct 31, 2018

I would like to expand on @imkimchi solution - instead of a custom size between 800 and 1024 MB, I would suggest selecting the System managed size option or setting a much higher max size (for me the "system managed" size is 16 GB which is the same as my RAM).

With 16 GB RAM, having a page-file of only 1024 MB is rather tight and might cause many applications to crash / not start -- especially on a developer's workstation.

The workaround still works, as it seems to be mostly related to having one page-file instead of multiple files.

@kumarharsh

This comment has been minimized.

Copy link

@kumarharsh kumarharsh commented Feb 25, 2019

@benhillis I've also started seeing this issue intermittently. I'm on Windows 10 Pro 1809 (build 17763.316)

@Karocyt

This comment has been minimized.

Copy link

@Karocyt Karocyt commented Mar 7, 2019

Already a single system-managed page file but same problem.
I tried restarting, removing/reinstalling ubuntu app, nothing.
After maybe 3-4 reinstalls, the store was telling me it was installed, but ubuntu.exe was not found and wsl.exe still hanging. Then I rebooted once more and was able to reinstall ubuntu properly.
It was a weird issues and still no clues about the real fix in this mess.

@kumarharsh

This comment has been minimized.

Copy link

@kumarharsh kumarharsh commented Apr 3, 2019

The solution as suggested in #849 (comment) did work for me. But after running for about a month, wsl has stopped responding again. I don't think the Creators Update has this fix (not doesn't have the complete fix).

Edit: curiously, after re-enabling System managed page files, and restarting my computer, WSL started working again.

@simonla

This comment has been minimized.

Copy link

@simonla simonla commented Apr 16, 2019

I have the same problem in 1809, so I do not think Creators Update really fix it. #849 (comment) works for me.

@joshefin

This comment has been minimized.

Copy link

@joshefin joshefin commented May 24, 2019

A better solution is to stop and start the LxssManager service. Be patient, it may timeout sometimes. Update: Sometimes the process just won't die.

@brokenshoebox

This comment has been minimized.

Copy link

@brokenshoebox brokenshoebox commented Jun 11, 2019

I have had similar issues with this as well. The solution for me was to disable fast startup.

@cmosguy

This comment has been minimized.

Copy link

@cmosguy cmosguy commented Jun 20, 2019

I have tried the same recommendations from #849 (comment) and from #849 (comment) and I still cannot get WSL bash to work. I see the task start briefly then die in my task manager. Can @benhillis please reopen this and fix it please? I am using

OS Name	Microsoft Windows 10 Enterprise
Version	10.0.17134 Build 17134
@asrandor

This comment has been minimized.

Copy link

@asrandor asrandor commented Jun 22, 2019

Hello!
I have the same problem as @cmosguy, on the same OS version.
I've noticed that everytime I rebooted my computer, my Debian distro worked well. But as soon as I close it, I'm unable to get it back, I have to reboot again.
commands 'wsl' and 'bash', both in the cmd and powershell as administrators changed nothing to that problem. Changing the page/memory thing changed nothing. I couldn't stop and start again the LxssManager. (it says Stopping for a while and that's all). Disable Fast Startup changed nothing either.

OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.17134 N/A Build 17134
@mcfiredrill

This comment has been minimized.

Copy link

@mcfiredrill mcfiredrill commented Jul 19, 2019

#849 (comment)

This fix worked for me...why does this happen? Some memory fragmentation issue? Would love an explanation...

@kumarharsh

This comment has been minimized.

Copy link

@kumarharsh kumarharsh commented Jul 19, 2019

When I follow #849 (comment), it gets fixed. Then after some days, WSL stops launching again, so I do the reverse of #849 (comment), and then WSL starts working again (for some days). And thus, On and on the wheel goes.

@boypt

This comment has been minimized.

Copy link

@boypt boypt commented Nov 5, 2019

The workaround is to do a FULL reboot of Windows10, hold SHIFT and click reboot.

Normal reboot/shutdown action in the start menu will not shutdown win10 fullly, for the "fast boot" mechanism saves memory from the last session. The other comment mentioned changing system memroy page size which makes win10 do a full reboot too, works but unnecessary.

By holding SHIFT key and click the Shutdown/Reboot in start menu, win10 will go into maintain mode, choose Shutdown from the menu. Then start normally again.

@ride4sun

This comment has been minimized.

Copy link

@ride4sun ride4sun commented Jan 6, 2020

Tried that and I still can not start the Ubuntu bash
Build 19041 release 191206-1406

Tried the Page size workaround and the Shift reboot - no luck

@glebsts

This comment has been minimized.

Copy link

@glebsts glebsts commented Mar 26, 2020

Yesterday installed WLS, today it stopped working, tried combo of pagefile reconfigure + shift-reboot, started working 🤞
Win10 Pro AMD, 8GB ram.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.