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

WSL2-Error: A connection attempt failed on Windows 19555.1001 #4860

Closed
ad-on-is opened this issue Jan 31, 2020 · 122 comments
Closed

WSL2-Error: A connection attempt failed on Windows 19555.1001 #4860

ad-on-is opened this issue Jan 31, 2020 · 122 comments
Labels

Comments

@ad-on-is
Copy link

ad-on-is commented Jan 31, 2020

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, #4371 (comment) but neither /bin nor /sbin were symlinks.

@ad-on-is ad-on-is changed the title WSL2-Error: A connection attempt failed on Windows 19555 WSL2-Error: A connection attempt failed on Windows 19555.1001 Jan 31, 2020
@olafkfreund
Copy link

Same problem here. All the WSL1 instances are working.

@gel-mashup
Copy link

i got this bug, i am using ubuntu 18.04 distro and i cant seem to start wsl2 instance

@FabienD
Copy link

FabienD commented Jan 31, 2020

Hi,

+1, VSCode can't established connection.

  • VSCode Version: 1.42.0-insiders or stable 1.41.1
  • Local OS Version: Microsoft Windows [Version 10.0.19555.1001]
  • Remote OS Version: Ubuntu 18.04
  • Remote Extension/Connection Type: WSL
  • WSL Version: 2

@FabienD
Copy link

FabienD commented Jan 31, 2020

Hi,

For me, uninstalled / re-install openssh-server on the linux host fix the connection issue.

cf. https://docs.microsoft.com/fr-fr/windows/wsl/troubleshooting

@benhillis
Copy link
Member

Thanks, we are debugging this internally - trying to figure out why only some users are hitting this.

@briandenicola
Copy link

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

  • Ubuntu-18.04 Stopped 2
    PS C:\Users\brian> wsl --set-version Ubuntu-18.04 1
    PS C:\Users\brian> wsl --list -v
    NAME STATE VERSION
  • Ubuntu-18.04 Running 1
    PS C:\Users\brian>wsl
    brian@brian_pc:~$

@ad-on-is
Copy link
Author

ad-on-is commented Jan 31, 2020

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

  • Ubuntu-18.04 Stopped 2
    PS C:\Users\brian> wsl --set-version Ubuntu-18.04 1
    PS C:\Users\brian> wsl --list -v
    NAME STATE VERSION
  • Ubuntu-18.04 Running 1
    PS C:\Users\brian>wsl
    brian@brian_pc:~$

Sorry, but this is absolutely no workaround. There are obvious reasons why we use v2 and not v1.

@briandenicola
Copy link

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

  • Ubuntu-18.04 Stopped 2
    PS C:\Users\brian> wsl --set-version Ubuntu-18.04 1
    PS C:\Users\brian> wsl --list -v
    NAME STATE VERSION
  • Ubuntu-18.04 Running 1
    PS C:\Users\brian>wsl
    brian@brian_pc:~$

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.

@ad-on-is
Copy link
Author

Thanks, we are debugging this internally - trying to figure out why only some users are hitting this.

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

@ad-on-is
Copy link
Author

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

  • Ubuntu-18.04 Stopped 2
    PS C:\Users\brian> wsl --set-version Ubuntu-18.04 1
    PS C:\Users\brian> wsl --list -v
    NAME STATE VERSION
  • Ubuntu-18.04 Running 1
    PS C:\Users\brian>wsl
    brian@brian_pc:~$

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.

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.

@therealkenc
Copy link
Collaborator

therealkenc commented Jan 31, 2020

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

image

@nunix
Copy link

nunix commented Jan 31, 2020

quick questions:
do you use a custom kernel?
what does your .wslconfig looks like?
your distro 19-10 is custom tight? do you face the same issue with a store one?

I know the team is debugging, but I got some time this error when playing around with the kernel 🤔

@ad-on-is
Copy link
Author

quick questions:
do you use a custom kernel?
what does your .wslconfig looks like?
your distro 19-10 is custom tight? do you face the same issue with a store one?

I know the team is debugging, but I got some time this error when playing around with the kernel

I've already reverted Windows back to the previous version. It's the official WSL-Ubuntu downloaded from the Ubuntu-Website, nothing custom and also no custom kernel here.

@JMBBunch
Copy link

I updated to Windows 10 Pro Insider Preview 19555.rs_prerelease.200127-0900 this morning. I first noticed the above issues with WSL when opening VSCode after the update (same problem with VSCode x64 v1.41.0 and 1.41.1 and I also did update its Remote - WSL extension to 0.41.7).

I have nothing of importance in my WSL so upon experiencing these symptoms (and trying the SSL-related fix mentioned above which did not help), I figured I'd get rid of the Ubuntu 18.04 LTS distro I have installed and have a fresh go at it.

Upon opening the WSL window to finish the installation, I get this:
image

In case I didn't paste that in right, the upshot is the new installation prompts for a new default user account, as expected. I created one ("ubuntu") and it said the password was updated successfully, but then it came back with a connection attempt failure, which looks a lot like the same problem in my previously-working setup even though that error was within VSCode's terminal window and this one is in the WSL command window: "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."

As you can see in the screenshot, I thought I'd try a different name just in case, but the same error came up and came back to another new UNIX username prompt.

In case it matters, after I updated Win10, I also installed (for the first time) the new cross-platform Powershell (6.2.4 x64). It was then I discovered VSCode couldn't open WSL.

@kobenauf
Copy link

kobenauf commented Jan 31, 2020

Similar message for me. I upgraded to build 19555 and now WSL 2 is totally dead:
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.
image
Not to be too dramatic, but I depend on this to do my work all day long, so this is very much impacting me.

@benhillis
Copy link
Member

@kobenauf - The roll back feature works very well and is actually quite quick.

@benhillis
Copy link
Member

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

@ad-on-is
Copy link
Author

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

By %PATH% variable you mean the user defined one within Windows?

@benhillis
Copy link
Member

@ad-on-is - Correct.

@kobenauf
Copy link

kobenauf commented Jan 31, 2020

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

@JMBBunch
Copy link

JMBBunch commented Feb 1, 2020

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:
image

@laoshancun
Copy link

laoshancun commented Feb 1, 2020

same issue on 19555.1001
WSL2 Ubuntu

@benszymkow
Copy link

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

Is the new build going to come out in next few days or is it going to be a week+? Just want to figure out whether to roll back or just wait

@philwilliammee
Copy link

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 #4860 (comment) adding startup output below as text.

[2020-02-01 12:06:06.597] Resolving wsl+Ubuntu, resolveAttempt: 1
[2020-02-01 12:06:06.648] Starting VS Code Server inside WSL (Ubuntu)
[2020-02-01 12:06:06.648] Extension version: 0.41.7, Windows build: 19555. Multi distro support: available. WSL path support: enabled
[2020-02-01 12:06:06.795] Probing if server is already installed: C:\WINDOWS\System32\wsl.exe -d Ubuntu -e sh -c "[ -d ~/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0 ] && printf found || ([ -f /etc/alpine-release ] && printf alpine-; uname -m)"
[2020-02-01 12:06:16.880] Unable to detect if server is already installed: Error: Command failed: C:\WINDOWS\System32\wsl.exe -d Ubuntu -e sh -c "[ -d ~/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0 ] && printf found || ([ -f /etc/alpine-release ] && printf alpine-; uname -m)"
[2020-02-01 12:06:16.880] 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.
[2020-02-01 12:06:16.880] Launching C:\WINDOWS\System32\wsl.exe -d Ubuntu sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 26076a4de974ead31f97692a0d32f90d735645c0 stable .vscode-server 0  ' in c:\Users\USER\.vscode\extensions\ms-vscode-remote.remote-wsl-0.41.7
[2020-02-01 12:06:26.953] 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.
[2020-02-01 12:06:26.953] VS Code Server for WSL closed unexpectedly.
[2020-02-01 12:06:26.953] For help with startup problems, go to
[2020-02-01 12:06:26.953] https://code.visualstudio.com/docs/remote/troubleshooting#_wsl-tips
[2020-02-01 12:06:26.965] WSL Daemon exited with code 0

@tylerjkline
Copy link

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!

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.

@mafshin
Copy link

mafshin commented Mar 12, 2020

On Build 19559.1000 and WSL2 complained to start, but upgrading to 19577.1000 fixed that :-)

@pkostelnik
Copy link

No Problem anymore with WSL2 since 19582

@grantyuc
Copy link

grantyuc commented Apr 9, 2020

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!

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.

Same issue on build 19564:
PS C:\Users\willy> 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.

I'm running build 19564 and the following commands work for me.
PS C:\Users\willy> wsl --shutdown
PS C:\Users\willy> wsl

@kendofriendo
Copy link

Having this issue with Arch, Windows ver 19624.

@rs-13-11
Copy link

rs-13-11 commented Jun 23, 2020

I am facing similar issue on ubuntu 20.04 wsl 2 especially after installing docker desktop

image

image

only after shutting down the wsl and then login in again as suggested by will-1222 works

@homandiy
Copy link

How can I make WSL automatically shut down if the error pops up again?

@therealkenc
Copy link
Collaborator

There are some open landing zones #5459 #5092 for the same error but with presumably unrelated cause. This issue, which could be triggered reliably with a long %path% in a narrow window between 19555 and 19564 came and went.

@arakno
Copy link

arakno commented Sep 27, 2020

Clicking on left hand corner of VS Code and choosing to open new Window did it for me
image

@rogatec
Copy link

rogatec commented Sep 30, 2020

@arakno nice catch!

Some strange behavior occurs when a vs code instance with a remoted connected project from wsl was opened.
After a reboot of the PC and reopening vs code, it tries to reopen the last opened folder/project, which fails.
In this situation the complete wsl vm is blocked wsl --list -v shows that the vm is stopped. VS Code could therefore also not establish a connection.

After @arakno 's hint of opening a new "clean" window from vs code with no open remote connection, suddenly the wsl --list -v command showed that the wsl vm is running.

Maybe the WSL and VS Code Team can investigate this strange behavior, somewhat blocks it. @benhillis

@tmtron
Copy link

tmtron commented Oct 12, 2020

I also had the issue that one ubunut 20.04 distro would not start.

I just executed wsl --shutdown once and then it worked again, i.e.

  • then the (first start) of the distro worked (but it took a while)
  • the next starts were then normal (fast, almost instant)
  • even after a reboot the distro started fast, as usual
  • not sure why this worked: maybe it was just an intermittent resource issue...

@ANORAK-MATTFLY
Copy link

wsl --shutdown

I can confirm that this solution worked for me too thanks!!!

@harem234
Copy link

this worked for me
on WSL 2

wsl -d Debian

@hazardland
Copy link

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 topic

wsl --shutdown
wsl

helped

@qhaas
Copy link

qhaas commented Apr 8, 2021

Ubuntu 20.04 in WSL2 on Windows 10 Pro for Workstations V20H2

> wsl --shutdown
> 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.

@Source61
Copy link

Unfortunately none of these worked for me. I got this issue right after using diskpart to compact / reduce file disk since I was running out of disk space and my wsl Debian installation had a 10GB useless file so I deleted it and closed wsl but that didn't help, so I ran diskpart. The disk was successfully compacted after attaching in read-only mode, then I detached and tried to run wsl and got this. I've tried wsl --shutdown, it didn't help. I also tried reattaching drive with diskpart, but then running wsl gave me an error that the disk was already being used by a different application :/

@Vontei
Copy link

Vontei commented Feb 17, 2022

Hi, checking in because I do not see any resolution and the linked issue has been locked.
Rebooting my system did not work (I'm sure everyone here has tried it). Still stuck and development has halted. So much so that this keeps happening and competitor machines are being considered.

Are there any known solutions to restarting/reconnecting at this time?
Do we know the cause?

@codertjay
Copy link

I fixed mine by moving windows app then searched for ubuntu
i clicked on reset app after that i ran the app and it worked

@Umoren
Copy link

Umoren commented Mar 23, 2022

wsl --shutdown
wsl

worked for me
Ubuntu 20.04

@ankitgoel739674
Copy link

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, #4371 (comment) but neither /bin nor /sbin were symlinks.

For me this issue is resolved by starting LxssManager service :--
Steps to start "LxssManager" service are as follows:

  1. Press "Windows + R" key to open Run dialog.
  2. Type "services.msc" and press "Ok".
  3. In services list look for "LxssManager" service and start the service.

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

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

@chriscodex
Copy link

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

@Iano-theDev
Copy link

wsl --shutdown
then restart wsl
that worked for me... on ubntu 20.04

@VasLem
Copy link

VasLem commented Nov 22, 2023

I am able to reproduce this error with WSL2 and Ubuntu 20.04:
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.
Error code: Wsl/Service/0x8007274c

@biberesser
Copy link

biberesser commented Feb 7, 2024

Same problem using IntelliJ+Git on projects inside WSL2. (also running: ssh-agent, Docker)
Error code: Wsl/Service/0x8007274c

Happens around once or twice a week.
(Windows 11, Ubuntu 20.04)

workaround: restart WSL2:
wsl --shutdown
wsl

@pradiptaagus
Copy link

After figuring out what is happen I got the solution as follows

  1. Open services manager by press Windows + R and type services.msc and press OK.
  2. Find LxssManager and stop it.
  3. Open the CMD or Powershell and type wsl -l -v, it will shows the list of installed distributions. For me, I got Ubuntu.
  4. Now run the desired distribution by command wsl -d Ubuntu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests