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

Issue with bash hanging on startup #4968

Closed
ghost opened this issue Mar 13, 2020 · 22 comments
Closed

Issue with bash hanging on startup #4968

ghost opened this issue Mar 13, 2020 · 22 comments
Labels
failure-to-launch failure to launch

Comments

@ghost
Copy link

ghost commented Mar 13, 2020

System info: Microsoft Windows [Version 1909 18363.719]
Distribution: 20190521 build of Ubuntu 18.04 LTS

When I open it with Windows Terminal, Ubuntu, or even cmd, the result is the same. The terminal just hangs, I can't do anything. Ctrol + C doesn't do anything either. I can write all I want but nothing is ever done, it just shows what I write and does nothing.
The only way to get it operational again is rebooting the computer. And even then, sometimes it will just randomly stop working and hangs again, it just freezes. Plus, whenever this happens, there are like 8 files, all called "init" that appear on the Task Manager and takes up 70% of my CPU, rendering my computer useless until the next reboot.
I have seen this issue on other threads (#3392 for example) but those are quite old, I wouldn't know if they could work on my case. I am quite new to programming, so I don't understand a bunch of these things.
Any help would be greatly appreciated.

@KaytonFletcher
Copy link

Having the same issue

@VonDyring
Copy link

Same issue

1 similar comment
@Aenariss
Copy link

Same issue

@rcheng15jhu
Copy link

rcheng15jhu commented Mar 15, 2020

Same issue with Windows 10 Home 1903 18362.720, Ubuntu 16.04.

This problem only started happening recently. If I recall correctly, it started after some windows updates, namely after KB4537759, a little longer than a week ago.

image

The init file is in the CanoicalGroupLimited/LocalState/rootfs folder.

It looks like there is also a suspended mount process in task manager. mount is is rootfs/bin.

@rcheng15jhu
Copy link

rcheng15jhu commented Mar 15, 2020

In addition, the init processes sometimes start without even having to intentionally launch Ubuntu. It seems like this happens when I am checking windows update. When this happens, the CPU usage is also quite high. The LxssManager service is also not able to be stopped when this happens, although a message does appear in console that WSL has stopped, despite the init processes still going at it.

@boulderwebdev
Copy link

I'm having the same problem. My computer is Window 10 Pro, version 1903.

@LayBacc
Copy link

LayBacc commented Mar 16, 2020

had the same issue, followed this link to update the Linux kernel and it worked: https://docs.microsoft.com/en-us/windows/wsl/wsl2-kernel

for more context, I tried starting bash in the command prompt and got this error message:
WSL 2 requires an update to its kernel component. For information please visit https://aka.ms/wsl2kernel

@ghost
Copy link
Author

ghost commented Mar 16, 2020

had the same issue, followed this link to update the Linux kernel and it worked: https://docs.microsoft.com/en-us/windows/wsl/wsl2-kernel

for more context, I tried starting bash in the command prompt and got this error message:
WSL 2 requires an update to its kernel component. For information please visit https://aka.ms/wsl2kernel

The issue is that I don't have WSL 2, I have the first version. You can see that my version is 18363, not 18917 or higher

@sirredbeard
Copy link
Contributor

Seeing these multiple init processes go to that level is odd.

The WSL init should only be mounting /mnt/c and any other custom mounts you have configured in /etc/wsl.conf

This issue should not be confused with issues with the kernel in WSL2 in the recent change in slow ring that @laybak had.

KB4537759 was an Adobe flash security update, so I am not sure about that one.

I will monitor this thread for more reports.

Some things to try:

  • Shutting Ubuntu down with wsl --terminate Ubuntu...
  • Starting and stopping LXSS: sc stop LxssManager then sc start LxssManager
  • Disabling and re-enabling WSL in Windows
  • Resetting Ubuntu on WSL (after backing up your data using wsl --export... or Raft WSL)

@rcheng15jhu
Copy link

image

So, this is quite odd, but simply navigating to the LocalState folder seems to start up the init processes. It could also just be coincidence, but I believe this has happened to me multiple times already. There are only three init processes this time though.

I also don't seem to have a wsl.conf file in the rootfs/etc folder.

I'll try some of the other things sirredbeard mentioned when I have time.

@rcheng15jhu
Copy link

rcheng15jhu commented Mar 17, 2020

So, wsl --terminate Ubuntu-16.04 doesn't seem to do anything when there are multiple init processes. It just sits there until I Ctrl-C out of it.

LxssManager seems to be stuck on STOP_PENDING when I try to stop it and query it afterwords.

And there also seems to be a different number of init processes every time. Sometimes 3, 7, 9, etc.

I've also noticed that when working normally, there are also two init processes in task manager. When exiting or logging out of the shell, one init process ends immediately, while the other takes some time to end.

@sirredbeard
Copy link
Contributor

Do you have any third-party security software running that could be interfering with the init mounting process?

@ghost
Copy link
Author

ghost commented Mar 18, 2020

(Again, new at programming so not 100% following, so sorry)

I have tried your suggestions and nothing different happened. However, it is quite difficult to even try them, as having bash open for 10 minutes triggers the init processes, hanging the terminal and torturing my CPU to the point that a restart is necessary. So I end up restarting every few couple of minutes.
The only security software I have is Avast (which I'll try to uninstall as I don't use it), and the only three party software installed in general is VS Code.

I'm considering just reinstalling Windows, reseting the whole computer (I have a separate drive just for software and all of my Linux data backed up so it wouldn't be that bad). Do you think that would fix the error?

@sirredbeard
Copy link
Contributor

Third party security software will often detect things WSL is doing as malware and block it, it could be interfering with the mount process in your case @juannegro.

Before you reinstall Windows at least try DISM /Online /Cleanup-Image /RestoreHealth in the Command Prompt.

@aboulore
Copy link

Same issue,
Windows 10 home release 18363.720
When closing Ubuntu 18.04, there is one init process still running. If I close it manually, then I can start Ubuntu again.

@ghost
Copy link
Author

ghost commented Mar 19, 2020

Third party security software will often detect things WSL is doing as malware and block it, it could be interfering with the mount process in your case @juannegro.

Yep. Deleted Avast, restarted, now it's working as usual. Didn't hang in the 3 hours the computer was on, while before it hanged in the first 15 minutes. Will let you know if anything new happens.

I'm new to github. Should I close the thread? There are people who had the same issue and I doubt that they can fix it the same way I could.

@rcheng15jhu
Copy link

I have Avast too, so that might just be the issue. I'll try to see if I can make exceptions for the wsl processes.

@aboulore
Copy link

I completely reinstalled windows 10 home edition, with no antivirus software, no other software, just Windows 10. I foillowed the complete procedure to install WSL and Ubuntu 18.04 release. Just did the update and upgrade. I did not install Xming this time.
And the first time I start Ubuntu, 2 init processes start , when I closed the ubuntu window (with command exit), one init process stoped, but one remained active, untill I could kill it manually in the process manager of Windows.
So it does not seem to be something related to any interference between WSL and other softwares.
I don't know if this can help.

@boulderwebdev
Copy link

Removing Avast solved the problem for me.

@souradeep100
Copy link

souradeep100 commented May 3, 2020

I am running wsl 2 Ubuntu and I am having the same issue of multiple init process.
souradeep@LAPTOP-L9AIV34E:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04 LTS Release: 20.04 Codename: focal
souradeep@LAPTOP-L9AIV34E:~$ uname -a Linux LAPTOP-L9AIV34E 4.19.84-microsoft-standard #1 SMP Wed Nov 13 11:44:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

souradeep@LAPTOP-L9AIV34E:~$ ps -aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.2 0.0 1048 640 ? Sl 01:45 0:01 /init
root 7 0.0 0.0 892 80 ? Ss 01:45 0:00 /init
root 8 0.0 0.0 892 80 ? R 01:45 0:00 /init
sourade+ 9 0.0 0.0 10172 5212 pts/0 Ss 01:45 0:00 -bash
sourade+ 217 0.0 0.0 10836 3480 pts/0 R+ 01:55 0:00 ps -aux

I have already tried restarting the lxss daemon, shutdown of Ubuntu, restarting the OS and
DISM online health check. None has helped here.
This seems really odd, I guess this has come mostly after Ubuntu has done a update through the windows app store.

@souradeep100
Copy link

Seeing these multiple init processes go to that level is odd.

The WSL init should only be mounting /mnt/c and any other custom mounts you have configured in /etc/wsl.conf

This issue should not be confused with issues with the kernel in WSL2 in the recent change in slow ring that @laybak had.

KB4537759 was an Adobe flash security update, so I am not sure about that one.

I will monitor this thread for more reports.

Some things to try:

  • Shutting Ubuntu down with wsl --terminate Ubuntu...
  • Starting and stopping LXSS: sc stop LxssManager then sc start LxssManager
  • Disabling and re-enabling WSL in Windows
  • Resetting Ubuntu on WSL (after backing up your data using wsl --export... or Raft WSL)

I am running wsl 2 Ubuntu and I am having the same issue of multiple init process.
souradeep@LAPTOP-L9AIV34E:$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04 LTS Release: 20.04 Codename: focal
souradeep@LAPTOP-L9AIV34E:
$ uname -a Linux LAPTOP-L9AIV34E 4.19.84-microsoft-standard #1 SMP Wed Nov 13 11:44:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

souradeep@LAPTOP-L9AIV34E:~$ ps -aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.2 0.0 1048 640 ? Sl 01:45 0:01 /init
root 7 0.0 0.0 892 80 ? Ss 01:45 0:00 /init
root 8 0.0 0.0 892 80 ? R 01:45 0:00 /init
sourade+ 9 0.0 0.0 10172 5212 pts/0 Ss 01:45 0:00 -bash
sourade+ 217 0.0 0.0 10836 3480 pts/0 R+ 01:55 0:00 ps -aux

I have already tried restarting the lxss daemon, shutdown of Ubuntu, restarting the OS and
DISM online health check. None has helped here.
This seems really odd, I guess this has come mostly after Ubuntu has done a update through the windows app store.

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
Labels
failure-to-launch failure to launch
Projects
None yet
Development

No branches or pull requests

10 participants