-
Notifications
You must be signed in to change notification settings - Fork 1.7k
VSCode Remote-SSH SSH tunnel stuck on WSL2 2.7.1 #40109
Description
Windows Version
10.0.26200.8039
WSL Version
2.7.1
Are you using WSL 1 or WSL 2?
- WSL 2
- WSL 1
Kernel Version
6.6.114.1-microsoft-standard-WSL2
Distro Version
Ubuntu 24.04
Other Software
VSCode: 1.114.0
Remote-SSH extension 0.122.0
Network Mode:mirrored
Repro Steps
Run two WSL2 distros on the same Windows host (e.g. Ubuntu 22.04 × 2)
From distro A, open VSCode and connect via Remote-SSH to 127.0.0.1 (distro B's sshd)
Observe the connection hang
Expected Behavior
VSCode connects and the remote workspace opens normally.
Actual Behavior
The log shows the remote server starts successfully, then hangs permanently at:
Starting forwarding server. local port 45771 -> socksPort 45387 -> remotePort 45137
The remote vscode-server is listening and the SSH session is authenticated, but the SOCKS5 forwarding layer never completes the connection.
Diagnostic Logs
After upgrading WSL2 from 2.7.0 to 2.7.1, VSCode Remote-SSH hangs indefinitely when setting up the SSH tunnel. The connection succeeds and the remote vscode-server starts and reports its port, but the forwarding server never completes. Downgrading to 2.7.0 restores normal behaviour.
Manual SOCKS5 handshake via Node.js confirms the proxy itself works: SOCKS5 request granted, SSH banner received.
Direct ssh username@127.0.0.1 from distro A to distro B succeeds normally.
The issue is specific to WSL2 2.7.1 — likely a change in loopback / inter-distro networking behaviour that affects how VSCode's forwarding server process (Node.js) completes the SOCKS5 tunnel.