Windows Version
Microsoft Windows [Version 10.0.26200.8117]
WSL Version
2.6.3.0
Are you using WSL 1 or WSL 2?
Kernel Version
6.6.87.2-1
Distro Version
Ubuntu 24.04.4 LTS
Other Software
Python 3.11.4 (Running on Windows Host)
(This issue affects any host-side application trying to bind to these ports, e.g., Node.js, Java, etc.)
Repro Steps
- Open
%USERPROFILE%\.wslconfig on the Windows host.
- Add
networkingMode=mirrored under the [wsl2] section.
- Ensure no local services are currently running on the high ports (e.g., 48080).
- Start the WSL instance (e.g., open Ubuntu terminal).
- Open Windows PowerShell on the host and run:
python -m http.server 44620 --bind 127.0.0.1 or python -m http.server 48080 --bind 127.0.0.1
Expected Behavior
When networkingMode=mirrored is enabled, host applications should still be able to bind to unused localhost ports. If I configure ignoredPorts=48080, that specific port should be completely ignored by WSL and remain fully available to the Windows host.
Actual Behavior
When mirrored mode is enabled, the underlying network engine (likely HNS/WFP) silently and aggressively locks a massive, continuous range of high ports (as well as specific ignoredPorts).
When a host application attempts to bind to these ports on 127.0.0.1, it crashes with PermissionError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions.
Critical Note: These locked ports DO NOT show up in netstat -ano and are NOT listed in netsh interface ipv4 show excludedportrange. They are reserved at the driver/kernel level.
Control Variable Tests Performed:
- Test A: Verified no background services in Ubuntu (
sudo ss -tulnp).
- Test B: Disabled
autoProxy=true. The massive port lock persisted.
- Test C: Removed
ignoredPorts. The massive port lock persisted.
- Test D (The only workaround): Commented out
networkingMode=mirrored (reverting to NAT mode) and restarted WSL. All ports immediately became available, and the 10013 error disappeared.
Evidence of massive port locking (Scanned via Python socket script from port 40000 to 50000):
Total silently locked ports found: 4103
- Ports 44620 through 48715 are continuously locked
- Ports 49664 through 49668 are continuously locked
- Ports 49672 through 49673 are continuously locked
Diagnostic Logs
No specific Feedback Hub logs collected yet, but the issue is 100% reproducible by simply scanning localhost port availability (catching WinError 10013) immediately after a WSL instance starts in mirrored mode.
Windows Version
Microsoft Windows [Version 10.0.26200.8117]
WSL Version
2.6.3.0
Are you using WSL 1 or WSL 2?
Kernel Version
6.6.87.2-1
Distro Version
Ubuntu 24.04.4 LTS
Other Software
Python 3.11.4 (Running on Windows Host)
(This issue affects any host-side application trying to bind to these ports, e.g., Node.js, Java, etc.)
Repro Steps
%USERPROFILE%\.wslconfigon the Windows host.networkingMode=mirroredunder the[wsl2]section.python -m http.server 44620 --bind 127.0.0.1orpython -m http.server 48080 --bind 127.0.0.1Expected Behavior
When
networkingMode=mirroredis enabled, host applications should still be able to bind to unused localhost ports. If I configureignoredPorts=48080, that specific port should be completely ignored by WSL and remain fully available to the Windows host.Actual Behavior
When mirrored mode is enabled, the underlying network engine (likely HNS/WFP) silently and aggressively locks a massive, continuous range of high ports (as well as specific
ignoredPorts).When a host application attempts to bind to these ports on
127.0.0.1, it crashes withPermissionError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions.Critical Note: These locked ports DO NOT show up in
netstat -anoand are NOT listed innetsh interface ipv4 show excludedportrange. They are reserved at the driver/kernel level.Control Variable Tests Performed:
sudo ss -tulnp).autoProxy=true. The massive port lock persisted.ignoredPorts. The massive port lock persisted.networkingMode=mirrored(reverting to NAT mode) and restarted WSL. All ports immediately became available, and the10013error disappeared.Evidence of massive port locking (Scanned via Python socket script from port 40000 to 50000):
Total silently locked ports found: 4103
Diagnostic Logs
No specific Feedback Hub logs collected yet, but the issue is 100% reproducible by simply scanning localhost port availability (catching WinError 10013) immediately after a WSL instance starts in mirrored mode.