WSL: WSL2-Error: A connection attempt failed on Windows 19555.1001
After updating to Windows 19555 I get the following error, when starting WSL:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
PS C:\Users\add> wsl -l
Windows Subsystem for Linux Distributions:
Ubuntu-19.10 (Default)
docker-desktop
docker-desktop-data
PS C:\Users\add> wsl -d Ubuntu-19.10
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
PS C:\Users\add> wsl -d docker-desktop
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
PS C:\Users\add>
Update
I wanted to try this workaround on a fresh Alpine, https://github.com/microsoft/WSL/issues/4371#issuecomment-521107556 but neither /bin nor /sbin were symlinks.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 73
- Comments: 123 (9 by maintainers)
There’s really some strategic solution needed here regarding Windows 10 Updates and especially WSL.
What I mean is, yes, we opted for the Fast Ring and we know what risks we are taking as Beta-Testers. But WSL2 has become a crucial part of our work environment. Iin fact, so crucial, that we do rely more on a stable working WSL than we do on a stable Windows itself. We spend more time in WSL, Terminal and VSCode than we do with Explorer or [insert any other fancy-shmency Windows feature here].
So please, for the sake of our work and time, can you guys at MS be more careful with such updates. We really love WSL, and are looking forward to all the new features you’re going to provide us with. And most importantly, we are truly thankful for that.🤘
Same issue on build 19564:
PS C:\Users\willy> wslA connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.I’m running build 19564 and the following commands work for me.
PS C:\Users\willy> wsl --shutdownPS C:\Users\willy> wslWe were able to debug what the issue is here and are pushing the fix. This issue triggers if you have a somewhat a long %PATH%, so one potential workaround (until a new build comes out with the fix) would be to do some “spring cleaning” on your %PATH% variable to make it shorter.
Sorry, but this is absolutely no workaround. There are obvious reasons why we use v2 and not v1.
I’m not sure why the down vote on my comment. I should made myself clear in that post I’m speaking for myself and not in any official capacity from Microsoft. I was trying to be helpful to the community to folks who need to have their wsl distros up and functional.
v2 is vastly better than v1. We all love v2 but if it’s a matter between up but limping along versus being down then I’ll take being up while the issue is being worked on.
I also had the issue that one ubunut 20.04 distro would not start.
I just executed
wsl --shutdownonce and then it worked again, i.e.Same Problem here, I really can’t believe how you play with our environments. Don’t you have a QA department to test all of this things? I’m contractor, who will pay for the hours that I’ll have to lose to fix this?.
C’mon, be professional guys, for once in life.
i was hitting the same issue with my v2 distro then i successfully converted it back to v1. I can now access the distro. Took about an hour to convert down but at least it’s a viable workaround until the issue is resolved.
PS C:\Users\brian> wsl --list -v NAME STATE VERSION
I pushed new versions of the Remote - WSL extension (0.41.9, 0.42.3) with a workaround to overcome the PATH length issues (the extension uses a empty PATH when internally calling wsl.exe).
Thanks, we are debugging this internally - trying to figure out why only some users are hitting this.
By volunteering for fast ring you volunteered to join the QA department.
Build 19564 resolved the issue for me.
Here’s a workaround for those who don’t want to roll back Win10 to use VS Code with WSL:
First, shorten the PATH enough to ensure WSL can run again. Then, shorten it some more (probably a lot) to get VS Code to run.
I could not get my Windows PATH pruned enough to risk breaking what I need in Windows. 391 in Windows and 471 in WSL were still too long. Instead, reset the PATH for the session by starting up WSL within Powershell:
Hope this helps someone!
Regarding $PATH length, just in case this helps anybody: I didn’t want to make any persistent changes to my system $PATH. So I just did some temporary $PATH-pruning within Powershell, with decent results.
Similar message for me. I upgraded to build 19555 and now WSL 2 is totally dead:
Not to be too dramatic, but I depend on this to do my work all day long, so this is very much impacting me.
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.Interestingly, the icon on my taskbar that launches Ubuntu is also wrong now. It used to be a little picture of a command prompt, but now it’s a white blank page. That shortcut does still open Terminal, but with the error above. From that window I can still open powershell fine, just not Ubuntu.Thanks for the workarounds everyone. I didn’t feel like fiddling too much so gave the rollback approach a try. I went from 19555 to 19551 - it took about 15 minutes. generic disclaimer about removing updates
Start -> Settings -> Update and Security -> Recovery -> Go back to the previous version of Windows 10
Rolling back worked for me and it was less time than it took to make a cup of tea. Kudos to all the MS engineers that make the Insiders program reliable enough that the rest of us can be at the leading edge, while still having a dependable safety net for these occasional hiccups.
Reporting back: I cleaned up my PATH (there were terribly long Intel Management Engine related PATHs for both /Program Files/ and /Program Files (x86)/ so I removed the x86 ones) and rebooted. I just put Ubuntu back (from the Windows Store) and VOILA! It started fine.
However, VSCode is still showing the same error. So to get it all clean, I uninstalled/reinstalled VSCode again, and removed and reinstalled the Remote - WSL extension; no help. I also pruned my path some more and reset it from the command line (and exited and re-entered to make sure the new path was retained) and tried again - same thing. Here’s VSCode’s Terminal output after trying a Remote-WSL: New Window command:
Windows Insider build 19546 is out today and has a fix for this issue. Please give it a try and let us know if this is resolved for you!
No way. Rule #1 of software development… TEST things before push anything. We’re in 2020, we have a tons of tools for testing.
This is not serious.
reduced my windows $PATH length to 458 characters, WSL2 path length 637 and wsl2 started but vscode cant connect to server. same error as others https://github.com/microsoft/WSL/issues/4860#issuecomment-580967091 adding startup output below as text.
wsl --shutdown then restart wsl that worked for me… on ubntu 20.04
we are in fast ring. these things are expected… i suggest stop your update at 19551 or move to slow ring (slow ring version now supports wsl2)
Why is this issue closed? This is constantly happening and has been ever since WSL2 came out. It’s blatantly obvious that after running WSL2 with memory demanding processeses inside, such as the Docker Desktop WSL2 integration with multiple containers and several open consoles - this issue manifests without fail. Shutting down or restarting WSL2, while being a proprietary “fix” for Microsoft products (especially Windows), is still like saying “it is what it is - deal with it” in a ridiculing and mockful manner. It is quite naive to offer a “solution” that involves shutting down a huge project, which depends on a Docker Compose stack with 20-30 containers, kill the Docker Desktop, shutdown WSL2, obviously quit all processes, which depend on this ecosystem like IDE integrations and consoles, start this whole circus again from scratch, just to hit the same problem 5 minutes later.
For me this issue is resolved by starting LxssManager service :– Steps to start “LxssManager” service are as follows:
Now, open windows powershell as administrator and type below commands PS C:\WINDOWS\system32> wsl -l -v NAME STATE VERSION _ Ubuntu-18.04 Running 2_* docker-desktop-data Stopped 2 docker-desktop Stopped 2
If you find state as “Stopped” for your linux distro (ie; ubuntu-18.04, ubuntu 20.04, etc) then type below command
PS C:\WINDOWS\system32> wsl -d <distro-name>
For example: PS C:\WINDOWS\system32> wsl -d Ubuntu-18.04
This will help to start your linux distro.
Please reach out me if facing any issue on below mail id
techiegeek1994@gmail.com
So rollback it is as truncating PATH is not an option if one have tons and tons of software that needs to be there. This PATH length limit in windows is just terrible, especially when software such as intel or razer pollute it with several really long paths.
For folks who can get into their WSL 2 shell on 19555, but are experiencing the “VS Code Remote - WSL” problem mentioned above (looks like screencap), you can work-around by using “VS Code Remote SSH”.
I am facing similar issue on ubuntu 20.04 wsl 2 especially after installing docker desktop
only after shutting down the wsl and then login in again as suggested by will-1222 works
The insiders program is part of the testing, for before features are pushed to the masses.
I’d argue that it’s irresponsible/unprofessional to depend solely on the stability of insiders to do your job, especially when virtual box + remote-ssh in vscode works just as well as wsl remoting does.
That’s not to say that this issue isn’t an inconvenience, but the entitlement being displayed here by many is laughable.
Equivalent in
cmd.exeissetPATH=<min path you need for interop>. [Contrastsetx.]Roll back was the only solution here. Reducing path <1000 chars (and even rebooting) had no effect. Thankfully I backed up my .vhdx before I rolled back here, because rolling back destroyed all my wsl installs.
So, shut down the lsxx service, copy out the .vhdx files for anything that matters, rollback. Reinstall any required WSL installations, create your users, then shut down lsxx service again, copy back your .vhdx files and you should be back exactly where you were.
Not quite 15 minutes because of the copying (my .vhdx is quite large), but still better than the wall of hurt this bug (whatever it is) causes.
This doesn’t work.
I’ve managed to shorten my path to 956 chars and WSL2 now launches but the VS code extension still fails
Shortened my path down to 1048, appears to be working fine now. Thanks to everyone for all of the tips, I was honestly surprised to see so much activity on an issue created 3 days ago! Its cool to see that the community is adopting these WSL features as quickly as they’re released! I don’t say this often, but keep up the great work MS! 🙌
same boat here. just truncate Windows %PATH% from lengthy string to some: C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\HashiCorp\Vagrant\bin;C:\Users\username\AppData\Local\Microsoft\WindowsApps;C:\Users\username\AppData\Local\Programs\Microsoft VS Code\bin
and now code can open wsl2 dir’s
Same problem using IntelliJ+Git on projects inside WSL2. (also running: ssh-agent, Docker)
Error code: Wsl/Service/0x8007274cHappens around once or twice a week. (Windows 11, Ubuntu 20.04)
workaround: restart WSL2:
wsl --shutdownwslAfter an VSC update in WSL2 Ubuntu 22.04 distro, WSL2 started to fail and showed me this error. I coudn’t be able to fix it. So I unistalled and reinstalled Ubuntu 22.04 in WSL2. It worked again, but I lost all my configuration.
worked for me Ubuntu 20.04
Yeah guys, after installing VSCode daemon in WSL (by running
code .in wsl) wsl stopped accepting connections something strange really happens, thanks to guys in this topichelped
Clicking on left hand corner of VS Code and choosing to open new Window did it for me
Having this issue with Arch, Windows ver 19624.
On Build 19559.1000 and WSL2 complained to start, but upgrading to 19577.1000 fixed that 😃
Did NOT fix for me, was working fine until I shutdown WSL2 and tried to restart it for other things, I’m running build 19569.
#4892 is still broken in 19569, any update?
This is working for me again now - 19564 Insider Preview. I had trimmed down my $PATH in earlier builds with no success. It did take a while to start though.
I’m also on 19564 and am still struggling to open WSL #4892
@appurist - This bug has never made it to the slow ring.
Yep, 19564 fixed it!
Not to split hairs, but WSL2 has still not officially “released” - It is still only in Insider builds.
If you are on the Fast ring you will occasionally be impacted by bugs in WSL or other components. Having insiders test pre release versions of Windows is invaluable, and catches things like this that were missed during testing. Rolling back builds takes minutes, it is no great hardship.
To help people, I think you still need vscode path in your $PATH for the vscode server to launch. I tuned it so it works for both powershell and vscode. Remember to backup your old path! Here are my configs
User’s Path
System’s path
Hi,
I just also wanted to confirm that reducing the path variable length works: I had a PATH with the length of 1330 character and reducing it to 1005 characters makes WSL2 work again.
I also tried the tip shared by @lengthmin, but it didn’t work for me, unfortunately.
Like the other above, shortening your
%PATH%seems to work. The length of my %PATH% was 1800+ and now down to 1288 and wsl now works fine.To shorten my PATH, I removed duplicates variables. You could edit your PATH by going to System Properties -> Advance -> Environment Variables. And under System Variables, look for Path, then edit.
I found that I had duplicate entries like
C:\WINDOWS,C:\Windows,%SystemRoot%,C:\WINDOWS\System32,C:\Windows\System32,%SystemRoot%\System32etc… So i removed the%SystemRoot%andC:\WINDOWS(capitals) duplicate entries, and this significantly reduced my PATH variable.Thanks, this actually worked for me. I had no idea my $PATH was that large. I cut mine down to ~700, it works. Weird issue
Even though I rolled back, I checked my Windows PATH out of curiosity, and I wouldn’t consider them to be long, since therer are only 4 lines, AppData, VScode, Flutter-sdk and Dashlane paths, which are crucial for me.
If you use WSL to just play around with Linux, and want to try all these geeky stuff everyone is talking about, then sure, there are many options.
But, if you work on client projects, where time and reliability play a significant role, you definitely don’t want to waste time experimenting with nonsense workarounds. Especially not when you have projects (sourcecode) stored inside WSL (in a vhdx-file) which could eventually end up in data corruption or even data loss.
You just want to get back to a working environment as soon as possible. Thankfully restoring Windows nowadays is just a matter of minutes and not hours.
@JMBBunch
Check, please, Wsl version:wsl -l -vDo you changed version to 2?wsl --set-versionUPD: Yes! I made PATH short and now WSL2 is working.
@benhillis thanks for saying that about rolling back. I’ve never actually done that on Win10 and was afraid it would corrupt my system. (That happened to many, many, … many years ago.) And you’re right, it was pretty quick and it fixed the problem. Thanks!
Since the title already says “WSL2-Error…” there’s really no need to suggest a workaround for converting to v1.
It’s not about which one is better. There are features that v1 can do but v2 can’t, and vice versa. Depending on these features and based on our needs, we have distros running as v1 or v2, simultaneously.
i got this bug, i am using ubuntu 18.04 distro and i cant seem to start wsl2 instance