WSL icon indicating copy to clipboard operation
WSL copied to clipboard

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

Open isaporto opened this issue 5 years ago • 245 comments

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.

isaporto avatar Aug 31 '20 20:08 isaporto

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?

sirredbeard avatar Aug 31 '20 20:08 sirredbeard

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

isaporto avatar Aug 31 '20 20:08 isaporto

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.

survivant avatar Sep 01 '20 01:09 survivant

Same issue. It worked until the last update arrived KB4571744

AlexanderC avatar Sep 01 '20 08:09 AlexanderC

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.

MinnDevelopment avatar Sep 01 '20 09:09 MinnDevelopment

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

pmlange avatar Sep 01 '20 11:09 pmlange

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.

licanhua avatar Sep 02 '20 00:09 licanhua

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

survivant avatar Sep 02 '20 01:09 survivant

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.

MinnDevelopment avatar Sep 02 '20 06:09 MinnDevelopment

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

licanhua avatar Sep 02 '20 14:09 licanhua

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

benhillis avatar Sep 02 '20 14:09 benhillis

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

.wslconfig [wsl2] swap=0

benhillis avatar Sep 02 '20 14:09 benhillis

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.

isaporto avatar Sep 02 '20 15:09 isaporto

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

licanhua avatar Sep 02 '20 15:09 licanhua

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

isaporto avatar Sep 02 '20 15:09 isaporto

@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 avatar Sep 02 '20 16:09 licanhua

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

isaporto avatar Sep 02 '20 16:09 isaporto

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

survivant avatar Sep 02 '20 16:09 survivant

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

licanhua avatar Sep 02 '20 18:09 licanhua

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

isaporto avatar Sep 02 '20 18:09 isaporto

I'll try after work

survivant avatar Sep 02 '20 18:09 survivant

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

AlexanderC avatar Sep 02 '20 18:09 AlexanderC

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 avatar Sep 02 '20 20:09 survivant

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

survivant avatar Sep 02 '20 23:09 survivant

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

isaporto avatar Sep 03 '20 15:09 isaporto

@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 avatar Sep 03 '20 17:09 licanhua

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

afromankenobi avatar Sep 04 '20 06:09 afromankenobi

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

Seems resolved now. Here the steps i followed:

  • windows features -> remove hyper-v -> reboot

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.

giuppi avatar Sep 04 '20 09:09 giuppi

Could you please collect wsl log?

licanhua avatar Sep 05 '20 05:09 licanhua

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 avatar Sep 05 '20 06:09 isaporto