Skip to content

Instantly share code, notes, and snippets.

@jimsander
Last active May 18, 2023 00:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimsander/35df39566ddc709315e9acd469abb14c to your computer and use it in GitHub Desktop.
Save jimsander/35df39566ddc709315e9acd469abb14c to your computer and use it in GitHub Desktop.
Windows and hanging SSH Connections

SSH sessions hang if using WSL2 linux or any linux container

UPDATE : Nope, it's even PowerShell ... (discovered this after revision 4 of this gist)

TLDR; Suspect the virtual machine platform, requried for any containerized system (including Rancher/Docker desktop) is the source of the ssh hangs, as a PowerShell ssh has no hang issues.

This is a known issue for 4 years now

Tried using a Linux container and ssh behaves similarly

  • Used Rancher Desktop with the following command, running an ssh session hung the terminal in short order

Attempt to get around WSL2

So, tried disabling some Windows Features

  • disabled NO hyper-v service (it was already even prior the last ssh hang)
  • disabled virtual machine platform and that prevents WSL2 or any 'containerization' from running.

Why? Just wanted to confirm Docker needed the virtual macine platform service. It does.

Requires Admin Shell

Set-ExecutionPolicy Bypass -Scope
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

choco install kind

  • installs docker desktop
  • does it re-enable virtual machine platform? No, but it also doesn't start up.

Summary: Fuck Windows Subsystem for Linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment