WSL2 Networking Guide
Published: January 25, 2024
Networking WSL2 Guide
WSL2 Networking Guide
Understanding networking in WSL2 can be tricky. This guide will help you navigate common networking scenarios.
Network Architecture
WSL2 uses a virtualized network adapter with its own IP address. This is different from WSL1, which shared the Windows network stack.
Port Forwarding
To access services running in WSL2 from Windows, you may need to set up port forwarding:
netsh interface portproxy add v4tov4 listenport=8080 listenaddress=0.0.0.0 connectport=8080 connectaddress=<WSL2_IP>
Accessing Windows from WSL2
You can access Windows services using localhost or the Windows host IP address.