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

WSL2 terminal won't start #5912

Closed
luisliborio opened this issue Sep 13, 2020 · 78 comments
Closed

WSL2 terminal won't start #5912

luisliborio opened this issue Sep 13, 2020 · 78 comments

Comments

@luisliborio
Copy link

After updating to build 20211, I worked for some minutes in Ubuntu 18.04 with WSL2. just installed some pip packages and restart the PC.

Now the terminal doesn't load. It keep blinking the cursor indefinitely.

@vcatafesta
Copy link

I have the same problem; after upgrading to 20211.1000 Wsl2 it stopped working properly; I tried a few steps to correct the problem.
1 - uninstalled windows subsystem for linux, restarted the pc and reinstalled again;
2 - the first time it worked perfectly, but after turning off the pc, the same problem returned.

@woodygithub
Copy link

I have the same problem after upgrading to 20211.1000 Wsl2,but reinstall wsl not work for me

@kanghoon-won
Copy link

#5902 (comment)

@vcatafesta
Copy link

After countless unsuccessful attempts to fix WSL2 under v20211.1000, there was no other way but to reinstall W10 from scratch.

  1. Installed version 19041.058 from scratch
  2. Apparently KB4571756 is NOT the cause of the bug;
  3. Update the WSL kernel https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
  4. Now working fine!

@zyazhb
Copy link

zyazhb commented Sep 17, 2020

Seems still not fix in 20215.1000

@Inphyy
Copy link

Inphyy commented Sep 17, 2020

still not fix in 20215.1000

@bycloudai
Copy link

#5902 (comment)
How do we exactly revert the build? Tried the recovery option but didn't help.

@luisliborio
Copy link
Author

guys, I managed to fix it just by uninstalling WSL2 and installing again. Just follow common Microsoft guide:

Run in PowerShell as admin:

DISM /online /disable-feature /featurename:VirtualMachinePlatform /norestart
DISM /online /disable-feature /featurename:Microsoft-Windows-Subsystem-Linux /norestart

Reboot, and again:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Reboot, and again:

wsl --set-default-version 2

Note: you won't lose your Linux subsystem settings or files.

This happened two times with me, both solved the same way, now it's apparently stable. And now I've just updated to build 20215, let's see how it goes...

@rozetkinrobot
Copy link

This happened two times with me, both solved the same way, now it's apparently stable. And now I've just updated to build 20215, let's see how it goes...

No, it's not give any result

@EtienneT
Copy link

guys, I managed to fix it just by uninstalling WSL2 and installing again. Just follow common Microsoft guide:

Run in PowerShell as admin:

DISM /online /disable-feature /featurename:VirtualMachinePlatform /norestart
DISM /online /disable-feature /featurename:Microsoft-Windows-Subsystem-Linux /norestart

Reboot, and again:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Reboot, and again:

wsl --set-default-version 2

Note: you won't lose your Linux subsystem settings or files.

This happened two times with me, both solved the same way, now it's apparently stable. And now I've just updated to build 20215, let's see how it goes...

This did not work.

@xexpanderx
Copy link

This is a critical issue and affects my work from day to day. WSL is simply useless. Two critical things that should be addressed are followng:

(1) WSL is not working, fix it.
(2) Everytime I connect o VPN, the network within WSL is not working anymore.

Until those issues are seriously fixed, I am running Linux natively for now.

@woodygithub
Copy link

maybe I should use Ubuntu natively

@frankdavidcorona
Copy link

Please update the system: https://blogs.windows.com/windows-insider/2020/09/22/announcing-windows-10-insider-preview-build-19042-541-20h2/

@wadjeroudi
Copy link

@xexpanderx @woodygithub can someone confirm that this update fixes the problem ? thx!

@diannaojiang
Copy link

insider 20221.1000 dont work

@xexpanderx
Copy link

Can confirm with 20221.1000, it is still not working. Same symptoms as before.

@Shahaed
Copy link

Shahaed commented Sep 29, 2020

20221.1000 is not working. Even wsl typed into a admin powershell just hangs.

@woodygithub
Copy link

@wadjeroudi what update

@JeromeFarin
Copy link

Is fix for me in 20226

@xexpanderx
Copy link

Yes, me to in 20226. Now, just the network issue, and WSL can finally be used.

@xexpanderx
Copy link

xexpanderx commented Oct 2, 2020

Unfortunately, it does not work again. I just did a restart of the computer. Back to square zero... Not sure if 20226 really did anything related to this problem.

Again, WSL does not start, no errors, no warnings, nothing is printed out, it just does not start.

@xexpanderx
Copy link

Here is a demonstration: https://www.youtube.com/watch?v=YShMixfmrIM&feature=youtu.be

@Inphyy
Copy link

Inphyy commented Oct 10, 2020

WSL2 can be used in 20231

@xexpanderx
Copy link

No, it does not work.

@AbdelNak
Copy link

AbdelNak commented Nov 4, 2020

Any solution for this issue yet ?

I'm having the same problem, after multiple attempts to restart WSL 2 using :

  • restart of windows (doesn't work)
  • wsl --shutdown : shutdown of wsl and restarting it (doesn't work)

none of the WSL 2 commands work, just hanging in the terminal, very annoying.

@xexpanderx
Copy link

Nope, it is amazing they do not prioritize this bug.

@AbdelNak
Copy link

AbdelNak commented Nov 4, 2020

This is a critical issue :

  • WSL 2 isn't starting, and apparently there isn't a turn around solution, so anyone with this issue will just give up and return to WSL1 and Hyper-V wich seems to be more stable.
  • The number of people having the same problem is realy hight (based of the number of posts I've seen trying to figure out the problem).

FYI : it worked for me for some time and I confirm it's a really cool feature, BUT this kind of issues makes it UNFORTUNATELY unusable, especially if one is working with Docker.

@jonathanheijmans
Copy link

Same issue here, the weird thing is that some terminals are still working, but new ones are not starting up and showing only the cursor. Even my docker containers are still running without problems which have been spun up when wsl2 was stil working properly

@luxu
Copy link

luxu commented Nov 10, 2020

guys, I managed to fix it just by uninstalling WSL2 and installing again. Just follow common Microsoft guide:

Run in PowerShell as admin:

DISM /online /disable-feature /featurename:VirtualMachinePlatform /norestart
DISM /online /disable-feature /featurename:Microsoft-Windows-Subsystem-Linux /norestart

Reboot, and again:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Reboot, and again:

wsl --set-default-version 2

Note: you won't lose your Linux subsystem settings or files.

This happened two times with me, both solved the same way, now it's apparently stable. And now I've just updated to build 20215, let's see how it goes...

For me this solution worked ... thanks!

@xexpanderx
Copy link

Hi!

I just find a very weird solution. If you happen to have Virtualbox installed, that may in a very weird way contribute to WSL2 not starting. Simply uninstalling Virtualbox did it for me....

There seems to be more people fixing this problem by uninstalling Virtualbox: #5982 and #5845.

This definitely is not a "solution", but since Microsoft does not give a crap about this problem, this is at least a workaround.

@jorgebsa
Copy link

just had this problem as well, resolved the issue by following the steps provided on @Gstar1525 comment

@NA-Dev
Copy link

NA-Dev commented Jan 19, 2022

Some updates came to Windows last night and broke me WSL2 in this way. Can't see file system, terminal won't load. This solution fixed it for now.

Run in PowerShell as admin:

DISM /online /disable-feature /featurename:VirtualMachinePlatform /norestart
DISM /online /disable-feature /featurename:Microsoft-Windows-Subsystem-Linux /norestart

Reboot, and again:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Reboot, and again:

wsl --set-default-version 2

Note: you won't lose your Linux subsystem settings or files.

@leohmoraes
Copy link

guys, I managed to fix it just by uninstalling WSL2 and installing again. Just follow common Microsoft guide:

Thanksss,

Run in PowerShell as admin:

DISM /online /disable-feature /featurename:VirtualMachinePlatform /norestart
DISM /online /disable-feature /featurename:Microsoft-Windows-Subsystem-Linux /norestart

Reboot, and again:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Worked for me. Thank you.
But I don't run the last command: "wsl --set-default-version 2"

@kyma
Copy link

kyma commented Apr 6, 2022

If anyone else gets this, for some reason for me, running WSL just hangs as the others described, but if I type:
wsl --install -d ubuntu (ubuntu is the distro I already have installed), it opens up and runs almost instantly. No idea why but at least I can work with it

@dsidirop
Copy link

dsidirop commented Apr 22, 2022

Very annoying. Thought I had messed up my installation somehow until I stumbled upon this thread and realized it's a general issue. I have Docker 4.7.1 and I use WSL2 (wsl --set-default-version 2) with Ubuntu 20.04 (latest updates). Steps I follow to fix the issue:

  1. shutdown down 'wsl --shutdown'
  2. relaunch wsl
  3. relaunch docker

Everything works for a couple of hours and then it hands again. This issue started happening about a month ago.

Update: It turned out that WSL goes haywire when I have multiple VSCode instances open and I run load-tests on local constellations I have launched through docker-compose in WSL2. I increased the memory I allocate to WSL via .wslconfig to 12GB (up from 4GB) and the problems I described above disappeared at least for now

  [wsl2]
  memory=12GB
  processors=3
  
  [automount]
  enabled=true
  root = /
  options="metadata,uid=1000,gid=1000,umask=002,dmask=002,fmask=002"

@himansh-u
Copy link

  1. wsl --list --all
  2. wsl --unregister Ubuntu-18.04 (enter the name as shown in the wee above list)
  3. install linux kernel update package for x64 machines
    https://docs.microsoft.com/en-us/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package
  4. try rebooting the device if it doesn't work and then check

@SergAndrs
Copy link

it's still happened, why this issue were closed?

@on3dd
Copy link

on3dd commented Jul 19, 2022

July 2022, still not fixed. Had to reinstall whole subsystem...

@erdigokce
Copy link

erdigokce commented Jul 19, 2022

This problem made my WSL adventure come to end so early. Reinstalling all the environment two times was not a good experience at all and it does not feel like it is going to be OK in the next releases.

Over one year, still getting not fixed notifs from this issue. I switched to macOS eventually (not the only reason but very significant one).

@xexpanderx
Copy link

This is pissing me off, I cant do my work since wsl is not starting. I had this problem since 2020. When are you gonna fix this issue?

@Eric-DiGiorgio-PGTI
Copy link

For me this wasn't an issue with windows but a conflict with docker desktop. uninstalling docker desktop and reinstalling immediately fixed it. Haven't restarted yet to ensure the fix is permanent but I believe it may of had to do with incorrect installation procedures on my part.

@ctrebo
Copy link

ctrebo commented Sep 17, 2022

How can it be that this still is not fixed??????? I have windows11 21H2 (Build 22000.978) with wsl kernel 5.10.102.1. This happened to me today. Ubuntu22.04 distro just will not start again!

@tbarbette
Copy link

Still affected too... I deinstalled, reinstalled, rebooted etc and now I can access it. But not after every reboots :(

@hwebb
Copy link

hwebb commented Nov 20, 2022

I found a solution to my specific problem, I don't know if it's the same as the others in this thread. My issue was that the terminal was stuck in the black screen with the cursor blinking. What I had is something that I've installed that edited my .bashrc file and put something that was blocking!
To solve it open PowerShell and type:

wsl -e sh
nano ~/.bashrc

Go to the bottom of the file and check if there isn't anything strange, save the file and try again.

@BewareMyPower
Copy link

@hwebb Great! It works for me! After I removing the NVM related startup scripts, WSL recovered.

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

@tbarbette
Copy link

Those last two issues are not related with this problem I think, as WSL itself is not stuck in the "bash" case :)
wsl --shutdown would not hang if the problem is in bash.

@hwebb
Copy link

hwebb commented Nov 24, 2022

Those last two issues are not related with this problem I think, as WSL itself is not stuck in the "bash" case :) wsl --shutdown would not hang if the problem is in bash.

Actually it looks exactly like the OP, "WSL2 terminal won't start - just installed some pip packages and restart the PC. Now the terminal doesn't load. It keep blinking the cursor indefinitely." Which is exactly that, after installing a package, the cursor keeps blinking, so that means the terminal is loaded, he doesn't mention wsl --shutdown not working. However, his fix didn't work for me.

@tbarbette
Copy link

Well the rest of the thread converge on a WSL problem (see the OP post here #5912 (comment) ) which eventually leads to bug being closed without being fixed ( #5912 (comment) ) anyway this thread is lost, so you're right we might as well document anything that looks like it :)

@BewareMyPower
Copy link

Just encountered this issue again. I think before running wsl -e sh, we still need to reinstall the WSL by following #5912 (comment). Otherwise, wsl -e sh could still be blocked. I'm not sure if WSL2 is already recovered when wsl -e sh can work.

@gibboniser
Copy link

@hwebb - many thanks for your input here. This was the exact problem I had, too, and your fix worked perfectly. Much appreciated!

@LiamKarlMitchell
Copy link

Still a problem.

@leonardofel
Copy link

guys, I managed to fix it just by uninstalling WSL2 and installing again. Just follow common Microsoft guide:

Run in PowerShell as admin:

DISM /online /disable-feature /featurename:VirtualMachinePlatform /norestart DISM /online /disable-feature /featurename:Microsoft-Windows-Subsystem-Linux /norestart

Reboot, and again:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Reboot, and again:

wsl --set-default-version 2

Note: you won't lose your Linux subsystem settings or files.

This happened two times with me, both solved the same way, now it's apparently stable. And now I've just updated to build 20215, let's see how it goes...

Tried #5912 (comment) + #4084 (comment)
Now it's working, thanks a lot guys 🎉

@winne42
Copy link

winne42 commented Mar 13, 2023

Just for reference: I've had that problem several times when there were Windows Updates "pending". Just restarting the PC and applying the updates helped.

@de777v
Copy link

de777v commented Mar 24, 2023

I found a solution to my specific problem, I don't know if it's the same as the others in this thread. My issue was that the terminal was stuck in the black screen with the cursor blinking. What I had is something that I've installed that edited my .bashrc file and put something that was blocking! To solve it open PowerShell and type:

wsl -e sh
nano ~/.bashrc

Go to the bottom of the file and check if there isn't anything strange, save the file and try again.

Thank you very much, @hwebb ! This was exactly my problem. commented source <(ng completion script) out at the end of the file and the terminal runs.

@mendesrl
Copy link

Run in PowerShell as admin:

DISM /online /disable-feature /featurename:VirtualMachinePlatform /norestart
DISM /online /disable-feature /featurename:Microsoft-Windows-Subsystem-Linux /norestart

Reboot, and worked for me.
Thank you.

@NguyenKz
Copy link

guys, I managed to fix it just by uninstalling WSL2 and installing again. Just follow common Microsoft guide:

Run in PowerShell as admin:

DISM /online /disable-feature /featurename:VirtualMachinePlatform /norestart DISM /online /disable-feature /featurename:Microsoft-Windows-Subsystem-Linux /norestart

Reboot, and again:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Reboot, and again:

wsl --set-default-version 2

Note: you won't lose your Linux subsystem settings or files.

This happened two times with me, both solved the same way, now it's apparently stable. And now I've just updated to build 20215, let's see how it goes...

You save my day! Thanks!

@djidji09
Copy link

djidji09 commented May 31, 2023

guys, I managed to fix it just by uninstalling WSL2 and installing again. Just follow common Microsoft guide:

Run in PowerShell as admin:

DISM /online /disable-feature /featurename:VirtualMachinePlatform /norestart DISM /online /disable-feature /featurename:Microsoft-Windows-Subsystem-Linux /norestart

Reboot, and again:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Reboot, and again:

wsl --set-default-version 2

Note: you won't lose your Linux subsystem settings or files.

This happened two times with me, both solved the same way, now it's apparently stable. And now I've just updated to build 20215, let's see how it goes...

idk if this what fixed it but its fixed now i hope it doesnt break again because its a huge pain to re setup another wsl workespace and the git and ssh key and github now i am scared it will break on me the moment i need it so reliability is an issue here last time it broke i couldnt even acces my codebase and i didnt even push it to github i hope it doesnt break on me again

@pcschreiber1
Copy link

I found a solution to my specific problem, I don't know if it's the same as the others in this thread. My issue was that the terminal was stuck in the black screen with the cursor blinking. What I had is something that I've installed that edited my .bashrc file and put something that was blocking! To solve it open PowerShell and type:

wsl -e sh
nano ~/.bashrc

Go to the bottom of the file and check if there isn't anything strange, save the file and try again.

This worked for me - issue was faulty Angular CLI installation that was trying to be loaded for autocompletion.

@flavsxavier
Copy link

guys, I managed to fix it just by uninstalling WSL2 and installing again. Just follow common Microsoft guide:

Run in PowerShell as admin:

DISM /online /disable-feature /featurename:VirtualMachinePlatform /norestart DISM /online /disable-feature /featurename:Microsoft-Windows-Subsystem-Linux /norestart

Reboot, and again:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Reboot, and again:

wsl --set-default-version 2

Note: you won't lose your Linux subsystem settings or files.

This happened two times with me, both solved the same way, now it's apparently stable. And now I've just updated to build 20215, let's see how it goes...

This worked for me! thx!

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