microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.18k stars 805 forks source link

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

Open isaporto opened 3 years ago

isaporto commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

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

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

AlexanderC commented 3 years ago

Same issue. It worked until the last update arrived KB4571744

MinnDevelopment commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

@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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

benhillis commented 3 years ago

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

.wslconfig [wsl2] swap=0

isaporto commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

isaporto commented 3 years ago

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 commented 3 years ago

Yes same problems, and I found few posts that others persons have the same issues.

licanhua commented 3 years ago

@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 commented 3 years ago

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

survivant commented 3 years ago

I'll try after work

AlexanderC commented 3 years ago

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

survivant commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

@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.
afromankenobi commented 3 years ago

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

giuppi commented 3 years ago

Hello, i've had the same problem. wsl command unresponsive, waiting forever but no output.

Seems resolved now. Here the steps i followed:

After apply & reboot, wsl started working again.

As per this link I've applied the minimal wsl configuration, so from windows features I've enabled "Hyper-V > Hyper-V Platform > Hyper-V Services" and "Windows Hypervisor Platform" (this one I can't tell if was enabled before disabling hyper-v but was off now). "Virtual Machine Platform" was already enabled for me.

After apply & reboot, wsl is still working fine.

licanhua commented 3 years ago

Could you please collect wsl log?

isaporto commented 3 years ago

I also don't know how to fix Lxss, how to diagnose or even what it is, sorry! My disk C: have plent space, but my disk, in task manager, is always 100% :( Idk why, but I guess it's some kinda of bug because even I already erased all temp files, disables all prgrams to initialize in task manager and in System Config -> Services, but it's alwayrs 100% I just formatted the entire windows and now I am at 20206.1000 version. I will once more install the Ubuntu

isaporto commented 3 years ago

It's working again after I reinstall all Windows 10 and updated to 20206.1000 version. I guess the problem was the disk, maybe? The windows system itself consumes a lot, that's why always in task manager it's accusing 100% disk usage with System using like 80%

isaporto commented 3 years ago

So, sometimes I have the same problem and I just reboot and starts to work normally again. This time that didn't works my disk wasn't 100% in the task manager ยฏ_(ใƒ„)_/ยฏ

exane commented 3 years ago

I had similar symptoms with WSL not responding as well as lxss being dead. A reboot often fixed this issue. For me the issue disappeared completely after I disabled "Turn on fast startup" in the Windows power settings.

airtonix commented 3 years ago

@isaporto regarding lxss, usually it means the LxssManager.

Somethings you can try:

  1. If you're not already, use powershell instead of cmd.exe. while not really related to your problem, it's just nicer.
  2. restart LxssManager :
7-preview $ Get-Service | grep Lxss
Running  LxssManager        LxssManager
Stopped  LxssManagerUser_9รข?โ–Œ LxssManagerUser_9eb01
7-preview $ stop-service LxssManager
7-preview $ start-service LxssManager

or you can use the TaskManager:

2020-10-24_11-19-47

isaporto commented 3 years ago

I will test when the problem occurs again. Few times it happens after I reinstalled the Windows. Normally I just restart and it starts to work again, but now I disabled all services at msconfig and at initialize just in case

MinnDevelopment commented 3 years ago

This issue still happens for me. I don't think restarting the PC should be a desirable fix. Restarting through taskmanager doesn't work since it just gets stuck in "stoppping".

isaporto commented 3 years ago

@MinnDevelopment Have you tried go back to another windows version? Unfortunally I solve my problem reinstalling the entire Windows and doing all again the setup, because I was looking for a "quick" solution

licanhua commented 3 years ago

Are you using docker? If yes, try to disable 'start docker desktop when you log in'

MinnDevelopment commented 3 years ago

@licanhua yes I am, will try that.

Edit: looks like it already has that disabled.

image

Maybe I have to enable WSL 2?

licanhua commented 3 years ago

@MinnDevelopment Which Windows build are you using? Are you still using WSL 1?

If you are using WSL 2, You may collect logs:

  1. reboot the machine
  2. follow above link to collect the log and start recording
  3. reproduce the problem like launch Ubuntu
  4. stop recording, submit the logs and then share the link.
MinnDevelopment commented 3 years ago

I'm using Windows version 10.0.18363.1139 and WSL 1. I already committed this recording last time you mentioned this but I'll try again when I have time.

andrepg commented 3 years ago

I'm also having this problem. With a few particularities:

  1. All WSL commands from PowerShell as Admin hangs. Including --help.
  2. After a while waiting wsl --help it answers me with Failure on server execution
  3. I'm using a Debian distro from Store, and the only things installed are NPM and PHP to Laravel development with VueJS.
  4. Everything works fine after a reboot, and kill Lxss by Task Manager, Service Manager, SC or any other things don't work.
  5. When this happens, every single WSL distro also hangs, and Windows Terminal can't find GUID of my distros.
  6. I realized that every time my distro hangs was after development with commands like artisan serve and npm run watch-poll.

In other reports that I read it seems to be something with NTFS and NPM watcher, but still not sure about it.

For now, I'm using Insider 20H2, build 19042.

Peter-76 commented 3 years ago

I'm also having this problem. With a few particularities:

  1. All WSL commands from PowerShell as Admin hangs. Including --help.
  2. After a while waiting wsl --help it answers me with Failure on server execution
  3. I'm using a Debian distro from Store, and the only things installed are NPM and PHP to Laravel development with VueJS.
  4. Everything works fine after a reboot, and kill Lxss by Task Manager, Service Manager, SC or any other things don't work.
  5. When this happens, every single WSL distro also hangs, and Windows Terminal can't find GUID of my distros.
  6. I realized that every time my distro hangs was after development with commands like artisan serve and npm run watch-poll.

In other reports that I read it seems to be something with NTFS and NPM watcher, but still not sure about it.

For now, I'm using Insider 20H2, build 19042.

I'm experiencing the same behavior on W10 20H2:

stg101 commented 3 years ago

I'm using Docker Desktop and wsl2, I had the same problem, I solved this by disabling Docker Desktop to run on startup, and wait until wsl2 is fully running to start Docker DEsktop manually.

ghost commented 3 years ago

I am having the same problem. I am using windows 10 home, so I don't have Hyper-V and also I don't use Docker at all.

ElHasnaouiMus commented 3 years ago

For me it was just somthing that was executed in the WSL machine, i simply run a (Ctrl+C) and it works ๐Ÿ‘

ghost commented 3 years ago

https://github.com/microsoft/WSL/issues/849#issuecomment-322163360 has a solution

endalk200 commented 3 years ago

I had the same problem. WSL won't start and all commands related to WSL won't respond in PowerShell.

โœจ Turning off Hyper-V and Windows Hypervisor Platform and turning it on again fixed my problem. You should try that.

n8eloy commented 3 years ago

I've had a similar issue. Found this fix somewhere and wanted to share:

features

May be a temporary fix but it's working for now (I've just noticed there are other versions of this same fix in this very thread, may wanna go with those)

piraces commented 3 years ago

Same issue here, I followed https://github.com/microsoft/WSL/issues/849#issuecomment-322163360 solution but I hope this is only temporal...