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

Hangs under WSL2 #19

Open
Kalamatee opened this issue Dec 17, 2020 · 5 comments
Open

Hangs under WSL2 #19

Kalamatee opened this issue Dec 17, 2020 · 5 comments

Comments

@Kalamatee
Copy link

Im trying to connect the serial port as described in the instructions, but when the script is run, it just hangs and goes no further?

@RomanDanyk
Copy link

Sometimes I experience a similar issue. I use the npiperelay tool to communicate SSH agents in Windows and WSL2. Usually, it works great, but sometimes SSH commands in WSL2 hang. I'm not sure the npiperelay tool is a genuine reason for this problem, though.
Is there a way to debug such an issue?

@ktetzlaff
Copy link

I have the same problem as @RomanDanyk. Using npiperelay to communicate from WSL2 with windows native ssh-agent works fine for weeks and then suddenly stops working. All ssh commands in WSL2 just hang forever. I already tried:

  1. restart socat/npiperelay in WSL2
  2. restarting ssh-agent on Windows side
  3. restart WSL2 (wsl -shutdown)

But so far, no success. A reboot fixes the issue, but that seems like overkill. Any ideas on how to debug or fix the issue would be great.

@stuartleeks
Copy link
Contributor

I've been hitting similar issues with git commands hanging as I use SSH key auth and forward key requests to the Windows SSH Agent with npiperelay.

What I noticed is that when this stops working for me, it seems like the WSL -> Windows interop is broken. E.g. running notepad.exe from a shell in the WSL distro also fails. I created an issue in the WSL repo, so it might be worth upvoting that if you're hitting the same issue?

@ktetzlaff
Copy link

I can confirm the observation of @stuartleeks: starting any (even console executable) windows program from WSL2 just fails. The terminal blocks forever (Ctrl-C doesn't work) - the w32 executable has to be killed from a second terminal.

So the problem doesn't seem to be a npiperelay issue. Still, it might make sense to keep this issue around as a pointer to the WSL2 issue.

@rda0
Copy link

rda0 commented Apr 5, 2024

I use npiperelay to conenct the SSH_AUTH_SOCK to the ssh-agent running on Windows.
Very recently my ssh connections (logins) started to be very slow (6s), hanging at:

debug1: rekey in after 134217728 blocks
🦗 6s
debug1: get_agent_identities: agent returned 2 keys

Also ssh-add -l in WSL hangs for the same amount of time, as well as:

$ time npiperelay.exe --help
Usage of npiperelay.exe:
...
real    0m5.256s

It was caused by Windows Defender Real-time protection. I was able to resolve it by adding an exclude for the directory where npiperelay.exe is located, like that:

\\wsl.localhost\<dist>\<npiperelay_directory>

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

No branches or pull requests

5 participants