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

Linux subsystem randomly freezes after a few minutes #4936

Closed
jackyjkchan opened this issue Feb 28, 2020 · 72 comments
Closed

Linux subsystem randomly freezes after a few minutes #4936

jackyjkchan opened this issue Feb 28, 2020 · 72 comments

Comments

@jackyjkchan
Copy link

jackyjkchan commented Feb 28, 2020

I am using Microsoft Windows [Version 10.0.18363.657]
I launch the subsystem using the Ubuntu app from start menu, app version is 1804.2019.521.0

This issue has occurred from doing just about doing anything, to list a few, running "exit" in the ubuntu shell, exiting from vi, attempting to run vi. Installing python packages with pip, typing into shell...
It sometimes even freezes right when i start the ubuntu shell.

I would expect the shell to not randomly freeze.

I'll attach logs after i restart my computer. When this happens my entire computer becomes very slow and the CPU usage shoots to 100%.

I've attached the error logs, i added a .log to the name so github would let me attach them.
I also added a screen shot showing what processes seem out of place when this bug happens.
After the freeze happened I tried to terminate WSL through cmd prompt.
The "The Windows Subsystem for Linux instance has terminated" message appears after i run esl --terminate Ubuntu on command prompt.

WSL_Issue_Hanging

lxcore_kernel.etl.log
lxcore_service.etl.log
lxcore_user.etl.log

@JudeLiu
Copy link

JudeLiu commented Feb 28, 2020

I'm experiencing exactly the same as you did, dude. I'm almost about to totally uninstall my WSL. It just drives me crazy with the never-stopping fan.

@afichou
Copy link

afichou commented Feb 28, 2020

Same here, for a couple of computers since wednesday.

@jackyjkchan
Copy link
Author

Oh to add to @JudeLiu's comment , I've also tried uninstalling and reinstalling WSL. My Ubuntu WSL install is fresh as of yesterday. So freshly reinstalling WSL doesn't help.

By reinstalling i did the following:
wsl --unregister Ubuntu **on cmd prompt
disable windows linux subsystem option in control panel "Add and remove windows features"
restart computer
re enable
restart computer
install Ubuntu app from windows store.

@hevanlee
Copy link

This exact same issue happened to me as well. About 6 or so init processes stay in the background after I close terminal, each taking approx 15% CPU usage. I've tried disabling and re-enabling wsl, reinstalling several times, using Debian GNU instead, and deleting and replacing the lxss folder in system32 with one from another computer but nothing seems to work.

@vcristal
Copy link

vcristal commented Feb 29, 2020

I’m having the same exact issue. It usually happens when I use ssh.

@pmkays
Copy link

pmkays commented Feb 29, 2020

Also having the same issue and have tried reinstalling WSL Ubuntu multiple times. I've also got multiple init and bash files running that are taking up huge chunks of CPU; restarting the computer every time it freezes seems to be a temporary fix but it's a huge pain.

@vcristal
Copy link

vcristal commented Feb 29, 2020

You can not even use task manager to close those processes and as previously said you have to restart the computer to get rid of them.

@LuthfiArfi
Copy link

LuthfiArfi commented Feb 29, 2020

I am having the same issue. My issue happened after i upgraded my wsl. now every time my wsl freeze i need to full reboot my laptop to make sure that init and bash in task manager is gone. hope they can get fix this bug

@ghost
Copy link

ghost commented Feb 29, 2020

Hi guys,
I got exactly the same issue.
It started right after I loaded the latest Windows update (Version 1909, OS Build 18363.693).
First, I supposed, I broke something under WSL or a bad mix with the new Windows version.
Thanks to this post, I can say it's not the case.
I hope MS will find a way to correct this issue because, as you all, I need to go ahead in my work.
Good weekend however ...

@pmkays
Copy link

pmkays commented Feb 29, 2020

What WSL and version are you all using?

@jackyjkchan
Copy link
Author

I am using the Ubuntu app from the Microsoft app store. 1804.2019.521.0. I don't think this is the issue however as my desktop is also using this version and has not seen any issues.
My laptop Windows OS is on build is 18363.693 (where i am observing seeing WSL issues).
Desktop build is 18363.657 where i have no issues.

@pmkays
Copy link

pmkays commented Mar 1, 2020

@jackyjkchan Over night I upgraded my Windows OS to Version 1909 18363.657 but I'm still having the same issue. My Ubuntu app from the app store is also 1804.2019.521.0

@jackyjkchan
Copy link
Author

@pmkays well then, let us both pray to the engineers at Redmond and hope they notice us.

@JudeLiu
Copy link

JudeLiu commented Mar 1, 2020

@jackyjkchan my laptop OS version is 1909 build 18363.693 but still have this problem, and use Ubuntu 18.04 LTS app downloaded from win store.

I tried to reinstall WSL. I uninstalled it from setting, download ubuntu app from store again.
But when I install it, four init processes are spawned again, just like before.

SAD

@ghost
Copy link

ghost commented Mar 1, 2020

Hi,
I run WSL 1, so I think it's time to make the leap toward WSL V2.
Hope it will be easy to preserve my environment.
Bye

@LuthfiArfi
Copy link

Hi,
I run WSL 1, so I think it's time to make the leap toward WSL V2.
Hope it will be easy to preserve my environment.
Bye

is it already on stable version?

@WillemLT
Copy link

WillemLT commented Mar 1, 2020

I've exactly the same.
Running Windows 10 Pro Version, OS Build 18363.693

It's appearing after few minutes of use, sometimes during boot already. It feels a bit unpredictable when it occurs.
It can happen with different commands (nano, whois, ping).
When it freeze I have the same CPU behaviour as jackyjkchan. Some process become in a suspended state as well and only with a restart I can get my PC stable again.

I mainly use the Ubuntu app (1804.2019.521.0) as well, but even using the wsl command via powershell let it freeze. As well as the Debian repro.

2020-03-01 16_43_47-Task Manager

With the suspended processes.
2020-03-01 16_45_03-Task Manager

Trying to kill / restart processes is not working.
Trying to restart process LXSSMANAGER in services, gaves an error and fails. It keeps in a stopping status..
Only restarting the pc works.

@GriffinCodes
Copy link

Using Intellij to run a bash script with WSL, after launching the WSL is frozen, my CPU is at 100% and the processes are unkillable.

https://i.gyazo.com/11989e804e5e77802255e0f0161b25cb.gif
https://imgur.com/a/imCb9JW

@youcanyoudown
Copy link

I have exactly the same issue after updating the system.. I tried many ways but failed. Hope some heroes save us!

@fred-the-coder
Copy link

fred-the-coder commented Mar 2, 2020

Same issue here....
Running a Windows update to try to solve the issue after the latest update.
February update, not mandatory, has been detected, thus updating.
Crossing finger for the issue to be solved.
I'll keep you post if issue is solved after Windows Update...

=> Seems like the Windows Update (windows-10-update-kb4535996) solves the issue on my side. So far, so good...

Update march, 3: actually issue is not solved...still randomly freezing. I won't go to insider program...

@WillemLT
Copy link

WillemLT commented Mar 2, 2020

I moved via Windows Insiders Program to (slow release track) build 19041.113
This is the version which supports as well WSL 2.
However for WSL 1 it seems to have a positive effect as well.
Seems like it solves the issue on my side.

@vpeng2016
Copy link

Having the exact same issue- bash freezes after a few minutes of work with multiple instances of init and bash which consume a ton of CPU. Unfortunately Windows Update (windows-10-update-kb4535996) does not seem to fix the problem

@youcanyoudown
Copy link

I moved via Windows Insiders Program to (slow release track) build 19041.113
This is the version which supports as well WSL 2.
However for WSL 1 it seems to have a positive effect as well.
Seems like it solves the issue on my side.

I used this method and indeed the Windows Insiders Program 19041.113 fixed my issue.

@JudeLiu
Copy link

JudeLiu commented Mar 3, 2020

This problem forced to me to join windows insider preview and it's fixed.
Maybe this is what exactly MS wants us to do

@GiancarloZ
Copy link

Works for me as well! Just join Windows Insiders Program and update.

@Lei-Guo
Copy link

Lei-Guo commented Mar 4, 2020

Same problem. I spent the entire weekend trying to figure out what was going on. Windows Insiders Program may not be worth it for some computers as it sometimes causes system crash, driver issues and so on. Let's just hope MS will fix the problem in the next update.

@kavi9030
Copy link

kavi9030 commented Mar 4, 2020

I have the same issue. Is there any other solution rather than joining Windows Insiders Program and update?

@Juanfdez11
Copy link

Same issue here, for me the 100% CPU usage is even triggered when I'm not using Ubuntu.
Had to uninstall WSL. Let's just hope they get it fixed soon...

@PdoubleU
Copy link

PdoubleU commented Mar 5, 2020

The same problem appears on my PC. It has begun a few days ago after one full day of working with WSL and code editor. Now I enrolled in Windows Insiders - I am updating my windows 10. I'll let You know if it works in my case.

@SaElAh
Copy link

SaElAh commented Mar 20, 2020

Exact same problem there too... Has anyone found a temporary solution ? I freeze after only a few minutes of usage :/.

@Tsylvester8
Copy link

Yes. I had the same problem too. @giannisdravilas solution fixed it for me.

@fts-01
Copy link

fts-01 commented Mar 25, 2020

I have the same problem but unfortunately @giannisdravilas solution does not fix it for me. Any other ideas how to fix ?

@AhrazA
Copy link

AhrazA commented May 1, 2020

Having a similar issue in vim. The Virtual Machine Platform fix by @giannisdravilas did not work for me.

@sfdb
Copy link

sfdb commented May 4, 2020

Same problem here - the proposed fix did not work.

@lukastillmann
Copy link

I have the same or a similar problem. WSL hangs/freezes randomly, sometimes after a few minutes, sometimes after a couple of hours. Killing the process doesn't work, I always need to restart my pc.

Windows 10 Version 10.0.18363 Build 18363
Distribution: Ubuntu (Windows Store)

I have had this issue before last year and tried to describe it here:
https://superuser.com/questions/1430009/windows-wsl-ubuntu-hangs-freezes-randomly-when-listening-to-ports

At some pointit simply didn't happen any more until about last week.

I have noticed it only happening when I am running some kind of javascript dev server. But I usually do, so I cannot say for sure, that it wouldn't happen otherwise.

I did install a windows update last week kb4552931, which coincided with the error occuring again

The virtual machine fix by @giannisdravilas did also not work for me.

@edmond1948
Copy link

I have the same or a similar problem. WSL hangs/freezes randomly, sometimes after a few minutes, sometimes after a couple of hours. Killing the process doesn't work, I always need to restart my pc.

Windows 10 Version 10.0.18363 Build 18363
Distribution: Ubuntu (Windows Store)

I have had this issue before last year and tried to describe it here:
https://superuser.com/questions/1430009/windows-wsl-ubuntu-hangs-freezes-randomly-when-listening-to-ports

At some pointit simply didn't happen any more until about last week.

I have noticed it only happening when I am running some kind of javascript dev server. But I usually do, so I cannot say for sure, that it wouldn't happen otherwise.

I did install a windows update last week kb4552931, which coincided with the error occuring again

The virtual machine fix by @giannisdravilas did also not work for me.

uninstall kb4552931, it's worked to me.
3q

@alexravenna
Copy link

I am experiencing this problem too, which is qute unfortunate, as I was looking forward to using WSL as my development system on my new work laptop.

My Windows updates are administered by my company's IT, so I don't have any influence on them, meaning:

  • I can't update Windows to the latest version (I currently have 10.0.18363), so I can't use WSL2
  • I can't roll back updates (I uninstalled kb4552931 as suggested by @edmond1948, then my system reinstalled it immediately).

I'm a web frontend developer and was using VS Code with WSL1 Ubuntu 18.04 as a remote development environment and the new Windows Terminal as my command line tool.

The Virtual Machine Platform "workaround" from @giannisdravilas seemed to work for me for a about a day, until a tried a rm -rf node_modules in my project and the problem reared its ugly head again 😢. The effects of this problem when it occurs are severe and make WSL1 usage infeasible:

  • VS Code loses its connection to WSL
  • Windows Terminal and WSL itself won't start anymore
  • Other apps start behaving strangely or not responding
  • All percentages in the task manager freeze and don't update
  • Sometimes I can't even open the start menu anymore
  • System can only be shut down by holding down the power key (Start Menu -> Power -> Shut down does nothing)

Looks like I'll have to go back to Git Bash and installing everything under Windows until this is fixed or I can upgrade to WSL2 😞.

@AhrazA
Copy link

AhrazA commented Jun 24, 2020

@alexravenna I am experiencing this issue on WSL2 too sadly.

@onomatopellan
Copy link

@AhrazA This is a WSL1 issue. For WSL2 freezes the issue could be #4966.

@rodrigogs
Copy link

Randomly freezes when running npm scripts

@airtonix
Copy link

airtonix commented Jul 7, 2020

@SvenGroot , just sent a dump (15.8GB) to [email protected].

OS Build 18363.720 with Ubuntu 18.04 WSL1.

I found NVidia instructions for dump generation to be quite clear and useful.

Hope it helps.

you sent a 15gb email?

@fgarcia
Copy link

fgarcia commented Oct 29, 2020

I've been having randomly this problem too, but recently it got worse. It is hard to track because the terminal freezes and I try to find the buggy process from htop/top where it is easy to get the full path of the program. The ones usually blocking WSL terminal and background ports is vscode-server, specially the typescript server.

That being said, even when it is not really WSL fault, I wonder if I should expect WSL to not go down so easily from a rogue process. Like in being able to prioritize the load so the terminal and open ports are not highjacked by a high cpu/mem process

@Sp4Rx
Copy link

Sp4Rx commented May 5, 2021

Randomly freezes when running Docker inside wsl2

@ulftietze
Copy link

Randomly freezes when running Docker inside wsl2

Oh this seems to be a quite good hint to check on. A lot of times when i am connected to a remote ssh server, the connection wsl terminal freezes. Not the windows or the process itself but the ssh connection seems to be frozen. I can open a new tab or a new pane with "alt"+"shift"+"+".
Maybe this can really be an issue with docker, because i first detect that behavior during the time i started to run some docker container. Or it's because i run CLion, IntelliJ or PHPStorm inside the WSL.

@Sp4Rx
Copy link

Sp4Rx commented May 24, 2021

@ulftietze yeah it seems like when the docker takes too much memory it freezes.

And another problem with wsl I'm facing is, the max storage is defined as 250 GB regardless of available space on the hard drive. So if I build too many images windows drive get's full. Then there is no way we could start wsl unless we free up some space on that drive from the host windows

@ulftietze
Copy link

@Sp4Rx Maybe, maybe not, i dont know. I have 32 GB of RAM and there is about 12GB left, so this shouldn't cause the problem.
Also it's the ssh connection which freezes, not a connection to a docker or anything equal, and thats the strange behaviour.

@FibHeap
Copy link

FibHeap commented Jul 14, 2021

Same here. WSL1 hangs at least once a day. It happens during a lot of hard disk activity, I think. As mentioned above, deleting a big node_modules nearly triggers it with 100% certainty. Also, working on a big project in VS code can trigger it after some time without deleting anything.

I also have WSL1 and WSL2 running on the same machine and use Docker Desktop with WSL2 backend. However, it does not happen necessarily if I run docker commands.

@Sp4Rx
Copy link

Sp4Rx commented Jul 14, 2021

I update docker and windows both when ever a update is available. Currently I don't see any random freeze when I run docker in wsl2.

Don't know what fixes it the windows update or the docker update

@meta-meta
Copy link

meta-meta commented Sep 16, 2021

This is an issue for me on Docker Desktop on WSL2. Running jest tests inside my docker container takes over my CPU.

Virtual Machine Platform is already enabled.

@mrjrieke
Copy link

I've noticed that this has gotten a lot better over time with various driver and windows updates, but occasionally, when coming back from sleep (or just screen lock), my linux based X apps will be sluggish and/or frozen. The only workaround I've found so far is:
wsl --shutdown

But that means a whole lot of setup getting the apps running again.

@mattiatantardini
Copy link

mattiatantardini commented Oct 14, 2022

I've got the same problem on my system: Windows 10 Enterprise, Version 21H2, OS build 19044.2130.

The problem is not too severe on my side, just freezes once a week or like so, and in particular it seems to me that it freezes after coming back from sleep or hibernation. When WSL2 freezes, I've got a Vmmem process with 100% CPU in the task manager and never-stopping fan.

I just tried to restart WSL2 following this. I run the wsl -t command to stop my distro and it actually stopped it, but no effect on the Vmmem process. Tried to restart the distro with wsl -d command, but the following error message was returned:

The operation timed out because a response was not received from the virtual machine or container.

After a quite long time (I've managed to read all the discussion in this issue), suddenly everything started working again. Vmmem process stopped, the fan stopped, I could restart the WSL2 with wsl -d, and WSL2 was actually working without problems.

Don't know if this can be a true workaround, and obviously one cannot wait so long for restart.

@kierke-gaard
Copy link

same here. it freezes regularly. Especially after my computer hass been in sleep mode. What helps is shutting it down by force.
grafik

@mrdragonblack
Copy link

mrdragonblack commented Jan 10, 2023

hello my name dragonhacker1337 im not using wsl im using vm in win 11 but i have glitch in kali linux os this is the screenshot

IMG20230110134842

IMG20230110134837

sorry if anyone dont know about vm i'cant find vm forum
thank you if you want help me

sorry about the photo resolution im using my phone

Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

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

No branches or pull requests