Skip to content

Instantly share code, notes, and snippets.

View hashnoxt's full-sized avatar
🎯
Focusing

Hashan Nalaka hashnoxt

🎯
Focusing
View GitHub Profile
@nivranaitsirhc
nivranaitsirhc / winhost.md
Last active July 17, 2025 07:47
WSL2 ~ WINHOST (windows localhost from WSL)

Update: September 19, 2023 - A New Experimental Feature was added

A new experimental feature was added by Microsoft that will resolve this issue in the future. You will need to update to Windows Insider Build for Windows 10 or latest Windows 11 and update WSL. More info here.

The WSL2 localhost issue?

On WSL1 we can access windows services running on localhost ports directly, but when WSL2 was introduced things started breaking. One of those issue is access to windows localhost ports [^1]

To understand this issue we need to learn what is WSL2:

  • WSL2 is a Managed Virtual Machine Running on Windows contrary to WSL1.
  • Windows implements a virtual NIC for WSL2 thus the distro's host ip is different from the Windows host ip. [^2]