WSL: SSH timeouts since switching to WSL2

Environment

Microsoft Windows [Version 10.0.19041.450]
Release:        9.13
Linux version 4.19.104-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Wed Feb 19 06:37:35 UTC 2020

Steps to reproduce

Since uplifting my existing WSL instance to WSL2 I am having regular SSH timeouts when connecting to external Linux servers. It is often when I have entered a command such as ls, cat, vi where a large amount of data is going to be returned.

The terminal is unresponsive for a number of minutes before it finally returns the following error.

[id@servername modules] (mat_demo)$ ls
Timeout, server servername not responding.

I am able to open up a second WSL2 terminal and immediately connect to the same external linux server without issue.

I’m not able to consistently replicate the behaviour but I’ll try my best to capture some WSL logs.

WSL logs:

Expected behavior

SSH connections operate without issue

Actual behavior

SSH connections timeout

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 6
  • Comments: 20 (1 by maintainers)

Commits related to this issue

Most upvoted comments

I’m getting the same issue after upgrading to WSL2 yesterday on one of my machines. I’m on Windows 10 Version 2004 Build 19041.508 I’ve currently tried the following on Ubuntu 18.04, Ubuntu 20.04 and also Pengwin:

  1. SSH into an existing external linux server
  2. Once the connection has been established, as soon as I start typing a command like ls or grep, the terminal window freezes and I cannot type anymore until it times out. This never happened on WSL1.

For me this is not an intermittent problem. It happens every time.

For those who use HP laptops - disable “Live QoS NDIS 6 Filter Driver” on all of physical adapters (WiFi, Ethernet etc). This finally helped me to sort out this SSH hangs.

We were able to fix the problem by adjusting the MTU size. There was a mismatch between the MTU size of the WSL and that of the VPN client.

Getting this to all my ssh connections from Ubuntu on wsl2. The same connection an a “real linux” laptop show no issues at all.

Hi #5764 seems like it would prevent all network traffic whereas in my issue it works initially but then times out. I’m not sure if this affects other WSL2 traffic because SSH is my primary use case of WSL to jump onto my works server fleet.

As soon as a SSH session starts to timeout I’m able to immediately establish another SSH session with a second WSL2 window.

I’ve had to switch back to WSL1 and not had a repeat of the issue since I’ve done that.

Please let me know what you need me to do to assist with the need-repro label.

Mat I’ve ha