Skip to content

Network Settings

WSL Dashboard simplifies the network communication configuration between WSL 2 and the host machine (Windows), with support for port forwarding and a global HTTP proxy.

Port Forwarding

Because WSL 2 uses a virtual network adapter, accessing services running inside WSL from other devices on the local network can be complex.

  • Core feature: Map a specific Windows port to a port inside a WSL instance.
  • Automatic firewall rules: When creating a forwarding rule, WSL Dashboard automatically adds the necessary inbound rules to Windows Defender Firewall, ensuring external traffic can pass through.
  • Configuration options:
    • Host IP: Typically 0.0.0.0 (listen on all interfaces) or 127.0.0.1.
    • Host Port: The port exposed on the Windows side.
    • WSL Port: The port that the service inside the instance is listening on.

Global HTTP Proxy

Configuring a proxy inside WSL (e.g., when git clone or apt install is slow) usually requires modifying multiple configuration files.

  • Quick setup: WSL Dashboard provides a global proxy toggle.
  • How it works: Based on your settings, it automatically configures proxy environment variables or service-specific proxy options for the selected instance, eliminating the need to manually look up the host IP.
  • Supported protocols: Common http:// and socks5:// protocols.

Network Status Monitoring

In the network panel, you can view in real time:

  • WSL Host IP: The IP address of the Windows virtual network adapter.
  • WSL Instance IP: The actual IP address assigned inside the instance.
  • Active Connections: Monitor the currently active port forwarding rules and traffic status.

Advanced Network Mode (Mirrored Mode)

For Windows 11 users, WSL 2 supports a "mirrored" network mode.

  • Advantage: Mirrored mode allows the WSL instance to share the host's network interface directly, resolving many complex VPN or local network discovery issues.
  • Configuration note: If you have mirrored mode enabled, WSL Dashboard's port forwarding feature still works, but you may prefer to access services directly via the host IP.

TIP

Setting auto_shutdown_distros = true in settings.toml ensures that no lingering network listeners are left in the background after closing the Dashboard.

Troubleshooting

Port Conflicts

If a port forwarding rule isn't working, check the following:

  1. Is the host port already in use? Use netstat -ano | findstr :<port> to check.
  2. Administrator privileges: Some ports (e.g., ports below 1024) may require administrator privileges to listen on.

Firewall Blocking

While WSL Dashboard attempts to configure firewall rules automatically, if you have a third-party firewall installed (e.g., Huorong, 360), you may need to manually allow wsldashboard.exe network access.