microsoft / WSL

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

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

Open isaporto opened 4 years ago

isaporto commented 4 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.

dkijkuit commented 3 years ago

Same issue here, I followed #849 (comment) solution but I hope this is only temporal...

A three year old fix still seems to work, it fixed it for me as well. Can we please fix this permanently, I depend heavily on WSL now.

vicpril commented 3 years ago

Hi! I have the same problem too, but only for one windows user. I created another user-administrator and install subsystem via official guide and it works. But it still doesn't work from the first user. Maybe this information will be helpful.

vicpril commented 3 years ago

This is helped me:

PS C:\WINDOWS\system32> wslconfig /L docker-desktop-data (default) Ubuntu-18.04 docker-desktop

The default system for wsl was docker-desktop-data. Then I changed it on Ubuntu-18.04 via wslconfig /s Ubuntu-18.04

connershoop commented 3 years ago

This problem started for me after rebooting WSL2 to get the time synced (it becomes un-synced when comp sleeps apparently). Computer restart solved the problem for me, but switching to a Linux OS is the real solution.

vladdg-dev commented 3 years ago

I ran into this problem today too, just after doing this kind of work, but with Jekyll serve

followed this entire thread + #849 :

As anyone would do (I guess) I tried:

My solution (even if not so technical)

Important

You can also try out this newer guide from the official Microsoft Documentation.

However, this is not a reliable solution if you had important configurations inside WSL itself, as a reinstall will erase everything. What can you do in this case? Well, before proceeding with the reinstallation, follow this thread.

Edit: This problem seems to happen when the WSL is corrupted, moved, uninstalled or if the settings.json file defaultProfile doesn't match any profile. One more thing that is worth trying is this: Image 1 Image 2

yanhong-zhao-ef commented 3 years ago

My situation is a bit different. I could launch the wsl with PowerShell but using PowerShell ise wsl hangs forever.

francogp commented 3 years ago

I have the same problem. Only a reboot fix it.

ShmuelTreiger commented 3 years ago

Same issue today.

#849 (comment) has a solution

Seems to have fixed it (for now). Commenting so you can know it's effecting more people.

Edit: It was only temporary. Broken again.

Inzagio commented 3 years ago

From: https://github.com/microsoft/WSL/issues/5836#issuecomment-801663441

This is helped me:

PS C:\WINDOWS\system32> wslconfig /L docker-desktop-data (default) Ubuntu-18.04 docker-desktop

The default system for wsl was docker-desktop-data. Then I changed it on Ubuntu-18.04 via wslconfig /s Ubuntu-18.04

This was my case, the docker wsl2 was simply set as default, switching to my distro worked perfectly fine

aa2686 commented 3 years ago

This worked for me. Thanks a lot.

francogp commented 3 years ago

This worked for me. Thanks a lot.

It does not work for me. The problem continues

mcDandy commented 3 years ago

I do not know if I have the same problem, but if I open wsl from start menu it closes after probably 30s. If I open it from start menu and record with Centrum feedback it shows "Vypršel časový limit operace, protože z virtuálního počítače nebo kontejneru nepřišla odpověď." -> "Time limit for operation expired, becouse of no response from virtual computer or container." and hangs. Same happens when I run wsl from command line or powershell as admin or not. Began when I updated to windows 10 version 21390.1000. Other wsl commands work.

ThoNogueira commented 3 years ago

I've been using WSL2 for the last year and I was very satisfied. But today, when I tried just open Ubuntu 20.04 terminal inside WSL2 nothing appers, just the coursor blinking during a several minutes. This problem break me. I have lost one day of work and give up. I will back for the dual boot.

jgwinner commented 3 years ago

@ThoNogueira instead of dual boot, go for (free) Hyper-V

@ all - it's still a bug

In any event, the problem happened to me a couple of days ago as well. I had a pending Windows update. Same symptoms, blank screen, wouldn't start. I rebooted and the problem went away.

Plenty of disk space, RAM, and other "resources". (if it's been a while since rebooting, I think file handles exaust themselves; keeping a lot of web pages open in the browser makes this significantly worse)

    == John ==
Parth909 commented 3 years ago

Got it working by doing the following.

Control Panel => Programs & Features => Click on Turn Windows Features On/Off => Turn Off Windows subsystem for linux => (Turn it on again) => Click on Restart Now

This should do it.

jpkop commented 3 years ago

I had this problem either and solved it by setting a default distribution - since no one was set.

Find your preferred distro name using wsl --list and set it as default with wsl --setdefault <DistributionName>.

francogp commented 3 years ago

I had this problem either and solved it by setting a default distribution - since no one was set.

Find your preferred distro name using wsl --list and set it as default with wsl --setdefault <DistributionName>.

It does not work for me

cristianuibar commented 3 years ago

Still a problem. This just happened to me. Win 10 Pro v 21H1build 19043.1052.

My fix was to disable WSL, reboot, and then re-enable WSL. However, hope this sticks and will not happen every day :)

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

Same for me

shafiedavalath commented 3 years ago

Ln PowerShell (Windows Shell): wslconfig /L

This lists WSL distributions. For me "docker-desktop-data (Default)" was listed as default not my Ubuntu distribution.

To change this:

In PowerShell (Windows Shell): wslconfig /setdefault

francogp commented 3 years ago

Ln PowerShell (Windows Shell): wslconfig /L

This lists WSL distributions. For me "docker-desktop-data (Default)" was listed as default not my Ubuntu distribution.

To change this:

In PowerShell (Windows Shell): wslconfig /setdefault

I only have one OS in WSL and this problem persist

WhiteX commented 3 years ago
  • Search for "features" in Windows
  • Open up "Turn Windows features on or off"
  • Look for the WSL feature
  • Disable the feature and reboot
  • Enabled it again and reboot

This helped! Thanks @n8eloy

notthelewis 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

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

At first I couldn't get version info using: wsl -l -v . However, once I'd turned WSL off & on using dism commands, I could see this prompt. I found that setting the default wsl as Ubuntu wsl -s Ubuntu-20.04 seemed to resolve the issues I was having.

TuvelRan commented 2 years ago

Looks like updating WSL worked out for me.

wsl --update
francogp commented 2 years ago

Looks like updating WSL worked out for me.

wsl --update

image

I'm using windows 11... and the problem continues, and is updated. The only way to fix it is a full windows restart

abhishek540 commented 2 years ago

I just faced this issue Ubuntu distro was unable to respond.

Then I look into microsoft documentation: https://docs.microsoft.com/en-us/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package

I have to update linux kernel package for 64 bit.

Now it is working fine for me :)

francogp commented 2 years ago

I just faced this issue Ubuntu distro was unable to respond.

Then I look into microsoft documentation: https://docs.microsoft.com/en-us/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package

I have to update linux kernel package for 64 bit.

Now it is working fine for me :)

It work because it force a reset. In my case the problem appears again later.

savormix commented 2 years ago

So why exactly it is still a problem in 21H2 22000.282? Kernel version: 5.10.60.1 LxssManager is running, the fullest disk drive has >400G free, all disks @ 0% utilization, CPU < 5%, memory < 20%, this is happening right after a cold start.

A simple OS restart fixes the issue, but why would this happen in the first place?

b-hayes commented 2 years ago

Has this happened again to anyone? WSLv2 died today and was unable to recover at all. Reinstalling my distros didn't work and in fact, I even when and set up a brand new machine trying to get back to work but I can't even install a distro with the current version of windows 10.

I've spent 18hours at work today and still have no way to continue working. I actually had to go install Linux on an old rig as a backup so that I can at least get something done tomorrow.

I am ropable right now and have no idea wtf I can do. Windows is basically just a dead platform to me right now and I just bought a $3000 laptop that can only run Windows and its just an expensive paper weight.

francogp commented 2 years ago

Has this happened again to anyone? WSLv2 died today and was unable to recover at all. Reinstalling my distros didn't work and in fact, I even when and set up a brand new machine trying to get back to work but I can't even install a distro with the current version of windows 10.

I've spent 18hours at work today and still have no way to continue working. I actually had to go install Linux on an old rig as a backup so that I can at least get something done tomorrow.

I am ropable right now and have no idea wtf I can do. Windows is basically just a dead platform to me right now and I just bought a $3000 laptop that can only run Windows and its just an expensive paper weight.

yes, reproducible with windows 11. BTW: if it can run windows, it can run linux ;)

danielfdickinson commented 2 years ago

TL;DR: \\wsl$ "Does not exist" (but the Linux root filesystem does)

OS: Windows 10 Pro Version: 21H1 OS build: 19043.1288 Experience: 120.2212.3920.0

Possibly relevant: I recently used Hyper-V Manager and was using a normal Hyper-V VM. Perhaps this has caused a permissions issue?

danielfdickinson commented 2 years ago

And course, after applying the latest "Cumulative Update Preview" (KB5006738) and yet another restart, the issue has disappeared. Fun 😦, but at least it is working again. It may have been networking related as well, as I rebooted my router as well (although this 'should' be a purely local thing). Unfortunately, not able to troubleshoot now since it's magically resolved.

b-hayes commented 2 years ago

I wasn't able to get it working again at all. I didn't install the feature update tho as I figured, its just a feature update I don't need. Deleted windows and using native Ubuntu ATM. Just sick opf windows doing crap like this to me out of nowhere and costing precious time in the middle of serious fixes for my work. When did windows become so dam unreliable? Are they doing this on purpose to make us go to win11?

francogp commented 2 years ago

I wasn't able to get it working again at all. I didn't install the feature update tho as I figured, its just a feature update I don't need. Deleted windows and using native Ubuntu ATM. Just sick opf windows doing crap like this to me out of nowhere and costing precious time in the middle of serious fixes for my work. When did windows become so dam unreliable? Are they doing this on purpose to make us go to win11?

It fail on Win11 too.. so....

b-hayes commented 2 years ago

How can I avoid this problem happening again if I go back to windows? Its cost me pretty dearly.

francogp commented 2 years ago

How can I avoid this problem happening again if I go back to windows? Its cost me pretty dearly.

the bug is opt for like 2 years or more... you cannot prevent it until they fix it

danielfdickinson commented 2 years ago

One more data point. It appeared again after switching to wifi from wired, but a reboot got things working again. Smells like it may be a 'metric' issue on the network routes.

sumitankitg130 commented 2 years ago

Its happening with me too. I'm on win 11. It was working an hour ago, I closed terminal after using and when I tried to start again it just won't.

b-hayes commented 2 years ago

I finally got back up and running nearly 2 weeks later. Installed feature updates (windows 10) and rebooted. Had to actually install Ubuntu on another machine to keep working. (FYI Ubuntu was awesome but it too has problems so glad to be back on windows and have my hardware working properly again.)

Not being able to rely on WSL is a huge problem. Knowing my entire dev environment with 50 docker containers can just die for no reason is horrifying.

MahdiGhiasi commented 2 years ago

This has happened twice for me so far on Windows 11.

I turned off "Windows Subsystem for Linux" from Windows Features, rebooted, then turned it back on again and then rebooted again. This fixed the issue, and thankfully my Ubuntu distro (installed from Store) and files in it were intact.

I'm on Windows 11 build 22000.318 right now (this happened just now and was fixed by the method I described), and it had happened once before too but I'm not sure about the exact build number back then.

danielfdickinson commented 2 years ago

A question for those still on the thread: Aside from WSL2 and a wired interface, do you use other network interfaces? If you also have wireless, do you switch between a wired and wireless connection?

I'm suspecting the WSL2 networking is getting 'bunged up' on certain network transitions.

francogp commented 2 years ago

A question for those still on the thread: Aside from WSL2 and a wired interface, do you use other network interfaces? If you also have wireless, do you switch between a wired and wireless connection?

I'm suspecting the WSL2 networking is getting 'bunged up' on certain network transitions.

that's not how a bug report works... try creating a specific teread about that.

danielfdickinson commented 2 years ago

@francogp Two points:

  1. I'm specifically interested in those of us who have experienced this issue and whether there is a common environmental factor (e.g. network change) that is triggering it. My question is therefore germane to this bug and not to a general discussion or thread.
  2. If there isn't going to be any effort to do anything useful with the info provided in this issue, it should be closed and users requested to file a new (and separate) issue. Otherwise this 'issue' is just a complaints department.
francogp commented 2 years ago

@francogp Two points:

  1. I'm specifically interested in those of us who have experienced this issue and whether there is a common environmental factor (e.g. network change) that is triggering it. My question is therefore germane to this bug and not to a general discussion or thread.
  2. If there isn't going to be any effort to do anything useful with the info provided in this issue, it should be closed and users requested to file a new (and separate) issue. Otherwise this 'issue' is just a complaints department.

I have 3 PC, 1 with 2 networks (wifi + ethernet), 2 with 1 ethernet. Can reproduce the problem without any network change.

rredbird66 commented 2 years ago

This has happened twice for me so far on Windows 11.

I turned off "Windows Subsystem for Linux" from Windows Features, rebooted, then turned it back on again and then rebooted again. This fixed the issue, and thankfully my Ubuntu distro (installed from Store) and files in it were intact.

I'm on Windows 11 build 22000.318 right now (this happened just now and was fixed by the method I described), and it had happened once before too but I'm not sure about the exact build number back then.

I'm on the same Windows 11 build. Turning the WSL feature on/off didn't work for me. I guess the problem may be the strange behavior of the Hyper-V Virtual Switch Adapter device (in Network Adapters). Because it's state is always "Windows is still setting up the class configuration for this device. (Code 56)" and then system(or idk who) deletes it. This happens every time I try to interact with WSL or its filesystem.

rredbird66 commented 2 years ago

Solved it for myself. VMWare issue. Some weird problem with bugged VMWare Workstation uninstall. After uninstalling VMWare Bridge Protocol from all network adapters my WSL problem was finally solved. I'm so happy about it :D

lucien-F commented 2 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.

work for me ! thinks

nicl-dev commented 2 years ago

@danielfdickinson

I'm specifically interested in those of us who have experienced this issue and whether there is a common environmental factor (e.g. network change) that is triggering it. My question is therefore germane to this bug and not to a general discussion or thread.

Yes, changing my connection from wired to wireless is exactly what I did before WSL 2 stopped responding. It's the only thing that changed on my side. A reboot did not fix the issue. I am using Windows 11 Pro Build 22000.318.

Edit: Okay, I had exactly the same symptoms @isaporto had after switching from a wired to a wireless connection. Commands like wsl -l -v gave no response, and I was unable to install Ubuntu 20.04 LTS. I then disabled the WSL feature and rebooted. This led to the wsl -l -v command giving me the expected output immediately.

After enabling the feature again and another reboot, the command still worked. I then booted Ubuntu 20.04 LTS, and it started the installation process. Et voilà, I am able to use my WSL again! So simply the disable⇾reboot⇾enable⇾reboot cycle worked for me.

freelaxdeveloper commented 2 years ago

Got the same behavior today on WIN 11 (22000.348). System reboots didn't help. Disabling Hyper-V services worked for me. After restarting my PC, I got other errors when using the wsl command. After which I re-enabled Hyper-V and WSL started working.

tameralshazly commented 2 years ago

hi, I faced the same problem - trying to run wsl in general and make a connection through VSCode specifically. and here is how i resolved:-

  1. i had Anaconda installed previously, so i removed it
  2. i had Docker, so i removed it also.
  3. turned off Hyper-V
  4. changed the system cache to be 800 and max 1024 (as advised by some1 i couldn't recall where i saw the post)

and now it is live and kicking in both env.s