[2026] How to Connect from a Mac to WSL 2 on Windows with VS Code (Remote SSH)
TL;DR
- WSL2 is a virtual machine, not "Linux in a terminal" — it has its own virtual NIC, NAT network, and dynamic IP. Mac cannot SSH into it directly. This is by design, not a bug.
- Port forwarding (netsh portproxy) is currently the most reliable approach — it covers the full Win10 + Win11 audience, and even NVIDIA's official docs use it. Mirrored mode, while officially promoted, has known bugs with inbound TCP/UDP (#10535/#12065), making it unreliable for the "Mac → WSL2" use case.
- By the end of this guide, you'll SSH from Mac into WSL2 in under 10 minutes — complete with step-by-step instructions, an auto-start script, and a layer-by-layer
connection refusedtroubleshooting flow.
Description
Target audience: Developers with a Windows desktop (Win10 or Win11) who use a MacBook as their daily driver and want to SSH from the Mac into WSL2 on the Windows machine for coding or running services.
Many people assume "Windows and WSL2 are on the same machine, so if SSH is running, I can connect" — then get smacked by connection refused. This article isn't about "why use WSL2." It's about one thing: how to connect from a Mac, and why the tutorial you found online still didn't work.
By the end, you'll have a PowerShell auto-forward script you can drop into Shell:Startup — so WSL2 IP changes after a reboot won't bother you again.
Author:AI Router
Link:https://www.airouter.me/blog/remote-mac-to-wsl2
Non-commercial reuse with attribution (CC BY-NC-SA 4.0).