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

WSL don't start, don't open and don't answer #5836

Open
isaporto opened this issue Aug 31, 2020 · 231 comments
Open

WSL don't start, don't open and don't answer #5836

isaporto opened this issue Aug 31, 2020 · 231 comments
Labels
failure-to-launch failure to launch

Comments

@isaporto
Copy link

Environment

Windows build number: 20197.1000
WSL 2

Steps to reproduce

Open the Windows terminal

Expected behavior

Should open the Ubuntu terminal but didn't appear even the tab in the Windows terminal.

Actual behavior

The problem is that sometimes, when I open the Windows Terminal the WSL don't appear. Acctually appear once but don't show/load anything, then, when I open again the terminal, it's gone. If I try to run wsl or wsl -l -v or wsl --shutdown, nothing happens, just keep like it's loading the answer forever. If I try to open the Linux folder just keep loading forever. Sometimes I restart the computer and just works but sometimes don't. I tried reinstall all Linux but the error appear again.

@sirredbeard
Copy link
Contributor

Did you install a WSL distro from the Store? Can you run it from the icon on the Start Menu?

I know this isn't a solution for WT but I am trying to determine if it is properly installed.

In PowerShell, what does the following report?

wsl.exe --list --all --verbose

Do you have any third-party security or endpoint management utilities installed on this device?

@isaporto
Copy link
Author

I followed this setup https://github.com/lewagon/setup/blob/master/WINDOWS.md
I am able to open the Ubuntu icon from Start Menu and wsl too. When I open, an terminal show up all black and nothing happens. If I try to run any command like wsl.exe or wsl -l -v, etc, nothing happens either, just keeps like it's waiting for an answer

@survivant
Copy link

Since Windows [10.0.20201.1000] wsl doesn't work (neither Docker for Windows)

basicaly.. when we enter wsl : nothing happen.. it won't respond.

I try this (also.. lot of reboot)

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

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

wsl --set-default-version 2

wsl.exe --update

wsl --shutdown

wsl -l -v

PS C:\WINDOWS\system32> wsl -l -v
NAME STATE VERSION

  • Ubuntu-20.04 Stopped 2
    Ubuntu-18.04 Stopped 2
    docker-desktop-data Stopped 2
    Ubuntu Stopped 2

no problem so far... but if I try just to enter wsl... it will stalled

I try wsl -d Ubuntu ... same thing.

@AlexanderC
Copy link

Same issue. It worked until the last update arrived KB4571744

@MinnDevelopment
Copy link

MinnDevelopment commented Sep 1, 2020

Same issue. When I try to stop it with sc as an administrator I get this:

C:\WINDOWS\system32>sc query LxssManager

SERVICE_NAME: LxssManager
        TYPE               : 30  WIN32
        STATE              : 3  STOP_PENDING
                                (NOT_STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x2
        WAIT_HINT          : 0xea60

C:\WINDOWS\system32>sc stop LxssManager
[SC] ControlService FAILED 1061:

The service cannot accept control messages at this time.

Only way to fix this is a complete reboot.

@pmlange
Copy link

pmlange commented Sep 1, 2020

I had same issue. Turning off Hyper-V in Windows Features resolved the issue for me, but then I have trouble with Docker Desktop.

@licanhua
Copy link
Collaborator

licanhua commented Sep 2, 2020

when you hit the issue, can you check the disk usage? I do found that if there is very few free disk space available(eg. 1G), the lxss has slow response or no response.
Another factor is the memory, lxss has very slow response if memory is 1G.
It requires 2G or more for Windows 10. If you run windows 10 in virtual machine, please make sure you allocated 2+G memory.

@survivant
Copy link

@licanhua I don't have a issue with free disk space (over 350gigs), no trouble with ram 32gigs. The problem appear only with the build [10.0.20201.1000] (no problem before that update)

@MinnDevelopment
Copy link

My C:\ drive has 20GB free and the M:\ drive where I have my Ubuntu distro installed has 80GB free. I have 16GB RAM. And the issue only started recently, 1 or 2 weeks ago.

@licanhua
Copy link
Collaborator

licanhua commented Sep 2, 2020

How about the %temp% folder? did you see a .vhdx which is created when you start Ubuntu and the size is always 0? For example:
C:\Users\yourlogon\AppData\Local\temp\{161c4a83-cd9d-4e29-92e2-84391fefb692}.vhdx
{161c4a83-cd9d-4e29-92e2-84391fefb692} is a random uuid

@benhillis
Copy link
Member

That should be plenty of space. @licanhua I suspect this is not the same issue you have been looking at.

@benhillis
Copy link
Member

benhillis commented Sep 2, 2020

If it is, disabling swap and trying to launch would confirm:

.wslconfig
[wsl2]
swap=0

@isaporto
Copy link
Author

isaporto commented Sep 2, 2020

I already ran the @survivant commands and my Hyper-V it's already off. My C: have a lot space yet too
My WSL it's updated and I already set WSL 2. My disk doesn't seem to be used all over but my Windows terminal not even load the Ubuntu option, just print same as @pizzafox

Could not find your default profile in your list of profiles - using the first profile.
Check to make sure the "defaultProfile" matches the GUID of one of your profiles.

@licanhua
Copy link
Collaborator

licanhua commented Sep 2, 2020

There are two suspicious:

  1. missing kernel. please run wsl --update --status to see if there is any error.
  2. the swap file. you can create .wslconfig in %userprofile% to verify it. A reboot is required to apply it if your machine is already in weird state.
.wslconfig
[wsl2]
swap=0

@isaporto
Copy link
Author

isaporto commented Sep 2, 2020

When I run wsl --update --status there's no error. It's already updated. Kernel version is 4.19.128
I created this .wslconfig file and seems that didn't change anything

@licanhua
Copy link
Collaborator

licanhua commented Sep 2, 2020

@isaporto A reboot may required to apply .wslconfig if your machine is already in weird state.

Could you please help to provide logs by Feedback Hub and share the feedback link after you submitted it? I tried and I never be able to reproduce the problem locally.

@licanhua licanhua pinned this issue Sep 2, 2020
@isaporto
Copy link
Author

isaporto commented Sep 2, 2020

After I created the .wslconfig file I reboot the computer. Still not working!
https://aka.ms/AA9j1mx <- I tried to reproduce the error, but basically the windows terminal don't load the ubuntu. any command like wsl --shutdown or wsl -l -v don't work but don't print any message error too, just keeps loading forever. I will try to update my windows to Windows [10.0.20201.1000] but seems that another persons get the same error with this version too

@survivant
Copy link

survivant commented Sep 2, 2020 via email

@licanhua
Copy link
Collaborator

licanhua commented Sep 2, 2020

@isaporto, Thanks for the log, but there is no log is attached. Have you 'Click Start Recording' to start collecting logs, then repro the problem, then Stop Recording?

@isaporto
Copy link
Author

isaporto commented Sep 2, 2020

Yes! I wasn't able to see the record, only the images. Maybe I can try once more @licanhua

@survivant
Copy link

survivant commented Sep 2, 2020 via email

@AlexanderC
Copy link

Disabling and then re-enabling HyperV feature followed by a restart worked for me to revive My WSL2

@survivant
Copy link

I try to record the screen, but I don't have a stop recording. I added a screenshot. I rebooted again.. still not working

@survivant
Copy link

survivant commented Sep 2, 2020

oh ! I got a Green screen of death again.. after that I did a hard reboot (press poweroff for few seconds)

Windows rebooted and I got a welcome screen and enter few settings like (my default browser, finger...) rebooted again.. and now wsl + docker works.

but I previously I added

.wslconfig
[wsl2]
swap=0

and rebooted, but wsl didn't work at that time

@isaporto
Copy link
Author

isaporto commented Sep 3, 2020

I decided to reinstall the ubuntu once more and it's stuck in the Installing, this may take a few minutes... for an hour already. Almost giving up from Ubuntu

@licanhua
Copy link
Collaborator

licanhua commented Sep 3, 2020

@isaporto It's hard to identify what's the problem. I guess:

  1. lxss is 'dead'. You can think lxss as a single thread, if it's busy, other one can't get the locker and have to wait. You can wsl -l -v, if it hangs, lxss has some problem and you have to fix it first.
  2. You are running out of disk.
  3. Your disk is busy. You can verify it from task manager.
  4. running out of memory or cpu is busy. less likely you are on this.
  5. Ubuntu problem. You may try Debian.

@licanhua licanhua unpinned this issue Sep 3, 2020
@afromankenobi
Copy link

@isaporto It's hard to identify what's the problem. I guess:

1. lxss is 'dead'. You can think lxss as a single thread, if it's busy, other one can't get the locker and have to wait. You can `wsl -l -v`, if it hangs, lxss has some problem and you have to fix it first.

In my case i have only the first symptom, everything keeps frozen and each time that i want to poweroff my Surface it hangs in a BSoD. How do we suppose to fix Lxss? Reinstalling? Moreover, how do i diagnose Lxss?

Sorry if my questions are too basic.

@duaneking
Copy link

I'm getting this as well, but I have everything enabled. WSL2 just doesn't work.

@z4mir
Copy link

z4mir commented Mar 19, 2024

WSL hangs forever for me, anyone facing the same issue? used to be fine yesterday

@paddy-r
Copy link

paddy-r commented Mar 19, 2024

WSL hangs forever for me, anyone facing the same issue? used to be fine yesterday

The only thing that ever worked with me was getting my machine completely reimaged. And then using a different machine entirely!

@ifkas
Copy link

ifkas commented Mar 19, 2024

Had a similar issue where one day I could open my Ubuntu terminal and the next day it stopped working. Would not be able to access my files and opening Ubuntu gives me a blank terminal with nothing on it (no words etc).

I tried uninstalling and reinstalling Ubuntu and it did not work. Tried restarting my computer, nothing happened.

What worked was this:

1. Go to 'Programs and Features'

2. Click 'Turn Windows features on or off'

3. Check if 'Windows Hypervisor Platform' is enabled (I also enabled 'Virtual Machine Platform')

Afterwards it worked again, hope this manages to help someone!

This worked for me, enabled Windows Hypervisor Platform and restarted, all good afterwards, back on track!

@MMeram
Copy link

MMeram commented Apr 18, 2024

Had a similar issue where one day I could open my Ubuntu terminal and the next day it stopped working. Would not be able to access my files and opening Ubuntu gives me a blank terminal with nothing on it (no words etc).
I tried uninstalling and reinstalling Ubuntu and it did not work. Tried restarting my computer, nothing happened.
What worked was this:

1. Go to 'Programs and Features'

2. Click 'Turn Windows features on or off'

3. Check if 'Windows Hypervisor Platform' is enabled (I also enabled 'Virtual Machine Platform')

Afterwards it worked again, hope this manages to help someone!

This worked for me, enabled Windows Hypervisor Platform and restarted, all good afterwards, back on track!

I have Windows 11 and this solution worked for me.

@devhindo
Copy link

Disabling and then re-enabling HyperV feature followed by a restart worked for me to revive My WSL2

this worked for me

@Antoineloiseau1
Copy link

I recently had this issue and I just uninstalled Docker Desktop on Windows and wsl stopped to hang forever

@CosmicHazel
Copy link

Hey folks - so it looks like there was a recent regression given the uptick in comments. Here's the fix that worked for me. None of the fixes in this thread worked.

#9075 (comment)

@TonnyWildeman
Copy link

Had a similar issue where one day I could open my Ubuntu terminal and the next day it stopped working. Would not be able to access my files and opening Ubuntu gives me a blank terminal with nothing on it (no words etc).

I tried uninstalling and reinstalling Ubuntu and it did not work. Tried restarting my computer, nothing happened.

What worked was this:

  1. Go to 'Programs and Features'
  2. Click 'Turn Windows features on or off'
  3. Check if 'Windows Hypervisor Platform' is enabled (I also enabled 'Virtual Machine Platform')

Afterwards it worked again, hope this manages to help someone!

This worked for me W10 22H2 19045.4412. Also rebooted. I noticed that the vmmem also went to 100% cpu usage on my 16 core machine on all cores. Was nice.

Things to do with the LxssManager did not work.

@dhruvmsheth
Copy link

finally fixed it. nothing in the comments above helped me. I navigated to the .wslconfig files placed in /Users/<username>/ and opened .wslconfig file with a text editor and removed a line which redirected the kernel to a non-existent directory. Make sure the config file only says [wsl2]

@fallwsxrfv
Copy link

My wsl2 broke after installed nvidia workbench and cannot access files there.
followed velletti solution above and back to work
thanks

@buryo
Copy link

buryo commented Jul 18, 2024

For me the solution was to enable Control Flow Guard (CFG). I needed to disable this in Windows Security settings to run some games, never couldn't guess that this will make Docker and WSL stop working

@Leon0824
Copy link

For me the solution was to enable Control Flow Guard (CFG). I needed to disable this in Windows Security settings to run some games, never couldn't guess that this will make Docker and WSL stop working

You save my life.

@joaomarcelogomes
Copy link

I don't understand why, but I managed to fix this by running the following in Powershell in administrative mode.

netsh int ip reset all
netsh winsock reset

I don't even have to restart; WSL starts working the second I run these commands.

This worked for me too. Thank you.

@Laviniu-Raul-Gavris
Copy link

I just ended the WSL tasks from Task Manager and re-opened it. This worked for me.

@chuanqisun
Copy link

chuanqisun commented Aug 28, 2024

I had the same issue. My observation is that when I login as soon as the welcome screen appears, this issue is more likely to happen. The issue doesn't occur as often when I wait a few seconds before logging into Windows. Maybe some race condition?

Another issue that often happens at the same time is edge browser and anything that requires webview does not load. Opening edge browser has no effect. No error. The process shows up in the task manager but there is no UI.

Both issues can be fixed by rebooting

@lsambolino
Copy link

I had same issue. Turning off Hyper-V in Windows Features resolved the issue for me, but then I have trouble with Docker Desktop.

This solved for me on Windows 11. Thank you.

@rngadam
Copy link

rngadam commented Sep 15, 2024

  1. Go to 'Programs and Features'
  2. Click 'Turn Windows features on or off'
  3. Check if 'Windows Hypervisor Platform' is enabled (I also enabled 'Virtual Machine Platform')

Also seems to have fixed my problem when WSL and Rancher stopped working abruptly (in the middle of a remote container work session with VSC) on Microsoft Windows 11 Entreprise Version 10.0.22631.

Digging into the Event Viewer, the only thing I noticed is that there seemed to be a hardware error in "PCI Express Legacy Endpoint" at about the same time it failed, but I don't see how that disabled the hypervisor: https://gist.github.com/rngadam/2a43df052ed1221c51ccf74e61aacee2

wsl -v
Version WSL : 2.2.4.0
Version du noyau : 5.15.153.1-2
Version WSLg : 1.0.61
Version MSRDC : 1.2.5326
Version direct3D : 1.611.1-81528511
Version de DXCore : 10.0.26091.1-240325-1447.ge-release
Version de Windows : 10.0.22631.4037

@TonnyWildeman
Copy link

GA104GLM [RTX A3000 12GB Laptop GPU]

I have a different graphic card on desktop that also crashed around the same time, that time. Didn't correlate that until this message.
FYI: I updated the driver for my graphics card and I don't have any more (display) crashes, and also no more WSL weird things.
Might be correlated, might be nothing

@ThePlenkov
Copy link

ThePlenkov commented Sep 17, 2024

Never had issues, but now started happening to me too. However it happens only after PC sleep and recovers after OS restart, which is very annoying..

 wsl -v
WSL version: 2.2.4.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.61
MSRDC version: 1.2.5326
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26091.1-240325-1447.ge-release
Windows version: 10.0.22631.4037

@hanzlahabib
Copy link

my hyperservice was disabled

@ThePlenkov
Copy link

i managed to solve the issue. In my case it was related to docker resource saver + autoMemoryReclaim: gradual. Reported in #11066

@uzchss22
Copy link

uzchss22 commented Sep 25, 2024

I had the same problem.

"If I try to run wsl or wsl -l -v or wsl --shutdown, nothing happens, just keep like it's loading the answer forever."

As a last resort, you can force exit and rerun.

https://github.com/uzchss22/TerminateWSLService.git

  1. Download zip file
  2. Decompression
  3. Run the .bat file (if you are security sensitive, you can check the source code of GitHub.)

@sineme
Copy link

sineme commented Oct 9, 2024

I disabled the windows features, restarted, enabled them again, restarted, and it worked again.

@lookas1
Copy link

lookas1 commented Nov 6, 2024

I don't understand why, but I managed to fix this by running the following in Powershell in administrative mode.
netsh int ip reset all
netsh winsock reset

This one worked for me as well though not sure how this is related to wsl.

@nurlybekovnt
Copy link

Nothing helps:

WSL version: 2.3.26.0
Kernel version: 5.15.167.4-1
WSLg version: 1.0.65
MSRDC version: 1.2.5620
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.22631.4460

@toxicbuzzer
Copy link

I don't understand why, but I managed to fix this by running the following in Powershell in administrative mode.
netsh int ip reset all
netsh winsock reset

This one worked for me as well though not sure how this is related to wsl.

This worked for me too (reboot required), cheers

@HonestDeng
Copy link

I had same issue. Turning off Hyper-V in Windows Features resolved the issue for me, but then I have trouble with Docker Desktop.

It works for me.

@dionisvl
Copy link

dionisvl commented Dec 9, 2024

up

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