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 · 215 comments
Open

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

isaporto opened this issue Aug 31, 2020 · 215 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.

@miszczu
Copy link

miszczu commented Aug 10, 2023

Just had this issue again,
Tried restarting lxssmanager, normal restart, but it did not help this time.
What helped was a "full" reboot of Windows. (Shift+Restart)

@tuff1z
Copy link

tuff1z commented Sep 15, 2023

I had the same issue. I opened up task manager and found a process that i forgot its name but it had the wsl symbol and i ended that process. After that i opened my ubuntu and it was working again.

@Stefan-HU
Copy link

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

for some odd reasen HyperV was disabled suddenly in the windows features. After enabling HyperV (again), WSL2 worked great again

@arijhajji-1
Copy link

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

did you find a solution for this?

@ahbanavi
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.

@wnicolaas
Copy link

If anyone is still having this issue, for me the issue was with my .bashrc file. Fixed it by entering as root: wsl -u root and then copying /etc/skel/.bashrc to my user's home directory. Exiting and opening wsl worked for me after this.

@LapisRaider
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!

@mrobold-servicetitan
Copy link

Had this happen today after installed Tuesday's updates (Windows 10). Found it because Rancher Desktop wouldn't start. Ended up having to disable/enable Hyper-V and then re-install Rancher.

@AmineDjeghri
Copy link

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

this worked for me

@sunxyw
Copy link

sunxyw commented Nov 24, 2023

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

confirmed in my end that this can fix the issue

@github-actions github-actions bot mentioned this issue Dec 6, 2023
2 tasks
@FANTAS666IXI
Copy link

For me the solution was to disable the automatic manage paging for all drives.
Source: https://www.youtube.com/watch?v=zyd_7tMKQh4&ab_channel=MaksudulHossainJewel

@giovannicappabianca
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.

Thank you for your hint!

  1. with adminsitrative right, I performed the following commands
netsh int ip reset all
netsh winsock reset
  1. without needing to reboot system. I updated wsl with command
wsl —update

to version 2.0.14. Finally, executing wsl worked

@vincerubinetti
Copy link

This happens to me consistently every time after I close a WSL terminal for the first time and open a new one.

Untitled

The LxssManager service is stuck on "Stopping". All combinations of the Stop-Service LxssManager -Force command (w/ or w/o force, different capitalizations, just "lxss", etc.) from an admin PowerShell give me:

stop-service : Service 'lxssmanager (LxssManager)' cannot be stopped due to the following error: Cannot stop
LxssManager service on computer '.'.
At line:1 char:1
+ stop-service lxssmanager
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (System.ServiceProcess.ServiceController:ServiceController) [Stop-Service],
   ServiceCommandException
    + FullyQualifiedErrorId : CouldNotStopService,Microsoft.PowerShell.Commands.StopServiceCommand

Running net stop LxssManager just gives me The service is starting or stopping. Please try again later.

sc stop lxssmanager does nothing. Any wsl command (list, update, etc) just hangs.

Tried all the solutions above that have a least one thumbs up. None work. The only thing that works, and at least it works reliably for me, is a restart.

A system restart every time I want to open another WSL terminal is unacceptable.

@deadcoder0904
Copy link

@a-kriuch
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!

Worked for me, thank you!

@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.

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