Fix WSL2 network connectivity issues with Windows host. Solves the common ERR_NETWORK_ACCESS_DENIED error when accessing WSL2 services from Windows.
- Download the latest release
- Run
install.batas Administrator - Restart WSL:
wsl --shutdown - Access your services via
localhost!
This solution has been tested and confirmed working on Windows 11 with WSL2 v2.5.7.0 (June 2025).
See VERIFIED-SOLUTION.md for detailed test results.
This tool configures WSL2 with networkingMode=mirrored, which:
- Shares the same IP address between WSL2 and Windows
- Eliminates NAT issues
- Allows
localhostto work seamlessly - No more port forwarding needed!
- Windows 10/11 with WSL2
- PowerShell 5.0 or higher
- Administrator privileges (for first-time setup)
install.batCreate/edit %USERPROFILE%\.wslconfig:
[wsl2]
networkingMode=mirrored
memory=4GB
processors=2
autoMemoryReclaim=gradual
sparseVhd=trueAfter installation:
- Restart WSL:
wsl --shutdown - Start your service in WSL (e.g.,
npm run dev) - Access from Windows:
http://localhost:3000
- Ensure WSL is updated:
wsl --update - Restart Windows completely
- Check Windows Firewall settings
- Run
diagnose.batfor detailed troubleshooting
Adjust memory allocation in .wslconfig:
memory=8GB # Increase if neededContributions are welcome! Please feel free to submit a Pull Request.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Microsoft WSL Team for the
networkingMode=mirroredfeature - Community members who reported and helped solve network issues
- Contributors to this project
Made with ❤️ by Oratual