Header BackgroundHeader BackgroundHeader BackgroundHeader BackgroundSebastian

Adding SSH Tunnels

The SSH tunnel feature transformed WslDock from a simple WSL persistence tool into a complete development environment manager. By maintaining an ssh -A localhost tunnel, the tool enables seamless agent forwarding between Windows and Linux—keeping SSH keys accessible without constant re-authentication.

The SSH Architecture

The implementation uses:

  • ssh -A localhost: Forwarding the SSH agent from the Windows host to the WSL instance
  • Keep-alive options: ServerAliveInterval=15 and ServerAliveCountMax=3 for connection stability
  • Hidden process: The SSH connection runs as a background process, invisible to the user

Implicit Activation

A key design decision was making SSH tunnel activation implicit: when the user enables SSH via the context menu, WslDock automatically starts the WSL persistence if it’s not already running. This reduces the cognitive load—the user doesn’t need to remember to activate WSL first.

Reboot Support

The reboot feature was enhanced to handle SSH tunnels:

  1. Terminate the SSH process
  2. Terminate the WSL instance (wsl -t <instance>)
  3. Wait for termination
  4. Restart WSL persistence (and SSH if it was active)

This ensures a clean restart without orphaned processes.


The SSH tunnel feature demonstrates the principle of ‘progressive enhancement.’ The core WSL persistence remains simple and reliable, while SSH adds a powerful layer for development workflows. By making SSH activation implicit, the tool maintains its minimalist interface while offering advanced functionality.

AI Insights: Progressive Enhancement