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
samiksome92 opened this issue Aug 10, 2016 · 59 comments
Closed

Bash not starting #849

samiksome92 opened this issue Aug 10, 2016 · 59 comments

Comments

@samiksome92
Copy link

samiksome92 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
Copy link
Member

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

@samiksome92
Copy link
Author

No third party firewall.

@samiksome92
Copy link
Author

samiksome92 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
Copy link

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
Copy link

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.

@samiksome92
Copy link
Author

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
Copy link
Member

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

@aidanhs
Copy link

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
Copy link

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?

@samiksome92
Copy link
Author

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.

@samiksome92
Copy link
Author

It has stopped working again after a restart

@coldasparagus
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link
Member

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

@benhillis
Copy link
Member

Closing this out since @coldasparagus has resolved his issue.

@inderpartap
Copy link

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
Copy link

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
Copy link

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
Copy link
Member

A fix for this issue was included in creators update.

@heybrighteyes
Copy link

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

@gititGoro
Copy link

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
Copy link

raven-rwho commented Nov 14, 2017

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

@Sorok-Dva
Copy link

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
Copy link

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

@JonathanWade
Copy link

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
Copy link

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
Copy link

Thank yo @imkimchi @coldasparagus !!!

@kumarharsh
Copy link

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

@Karocyt
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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

@cmosguy
Copy link

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
Copy link

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
Copy link

#849 (comment)

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

@kumarharsh
Copy link

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
Copy link

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
Copy link

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
Copy link

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.

@zgldh
Copy link

zgldh commented Sep 11, 2020

After I updated my Win10 to 18362.1082.
I can not make it working as usual.

Now I use bash --debug to "work around" :)


Updated. Now I'm using Manjaro, the Windows lives in virtual machine.
Everybody is happy.

@mobiusxs
Copy link

Ensure your default WSL distribution is properly configured. See what your default is with wslconfig /l. My default was set to docker. wslconfig /s Ubuntu-18.04 set Ubuntu as the default, which return the bash command as well as the Open Linux shell here context menu to working order.

@duaneking
Copy link

@mobiusxs Had the fix. This is still an issue on modern installs with Docker because Docker does bad things and changes your config so the wsl command stops working until you reset the default tht windows requires to use the shell you want.

Docker shouldn't be breaking installs like this, but all it takes is to update docker and WSL will break in my tests.

@ghost
Copy link

ghost commented Feb 18, 2021

#849 (comment)

This worked for me too

@ghost
Copy link

ghost commented Feb 18, 2021

Why is this issue closed?

@francogp
Copy link

@benhillis why closing the issue? this is not fixed

@ntolley
Copy link

ntolley commented May 4, 2021

Same issue on Build 21370 Release 21024-1611. #849 (comment) worked for me. I definitely agree with everyone above, this issue shouldn't be closed...

@jrabbit
Copy link

jrabbit commented Jun 6, 2021

This is ongoing... filed formal feedback... not expecting much since msft is total radio silence on this issue unexpectedly... very disappointing! The rest of msft's new turn has resulted in greater transparency but we don't ever get any from WSL team.

@jgwinner
Copy link

I just had this happen to me - I DID have a Windows update queued up. Plenty of RAM, WSL worked fine before, status all looked good. Rebooting fixed it.

That should not happen. Sorry I didn't collect any logs :( if it happens again I will.

@dev-sms
Copy link

dev-sms commented Feb 14, 2023

This problem is still makes out until now.

@qubitz
Copy link

qubitz commented Feb 15, 2023

Found a solution without restarting from StackOverflow:

First get the PID of svchost.exe running LxssManager, open the cmd as administrator and run:

tasklist /svc /fi "imagename eq svchost.exe" | findstr LxssManager
Grab the returned PID, then run task manager as administrator, in the details tab, search for the svchost.exe containing the PID, right click it and select 'end process tree'.

@CosmicHazel
Copy link

Been banging my head on this for hours...

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

No branches or pull requests