Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web apps from WSL2 not accessible from other devices in same LAN #12404

Open
1 of 2 tasks
PoProstuWitold opened this issue Dec 23, 2024 · 2 comments
Open
1 of 2 tasks

Comments

@PoProstuWitold
Copy link

Windows Version

Microsoft Windows [Version 10.0.22631.4602]

WSL Version

2.3.26.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.167.4-1

Distro Version

Ubuntu 24.04

Other Software

Windows 11 Education,

My .wslconfig:

[wsl2]
memory=8GB
networkingMode=mirrored
defaultVhdSize=256GB
autoProxy=true
dnsTunneling=true
firewall=true

[experimental]
autoMemoryReclaim=gradual
hostAddressLoopback=true

Repro Steps

Run following command from this issue in elevated prompt and then launch some web app (in my case simple Node.js server running on port 3005).

A safer alternative is to Only allow connection to wsl in a Trusted (Private) network:

New-NetFirewallHyperVRule `

-DisplayName 'Allow All Inbound Traffic to WSL in Private Network' `

-Name 'WSL Rule' `

-Profiles Private `

-Direction Inbound `

-Action Allow `

-VMCreatorId '{40E0AC32-46A5-438A-A0B2-2B479E8F2E90}' `

-Enabled True

This would block connection to wsl in a public (or untrusted) network, which is good.

In case you want to delete the rule, run:

Remove-NetFirewallHyperVRule -Name 'WSL Rule'

Originally posted by @tusharsnx in #10769

Expected Behavior

Web app is accessible on other LAN devices at WSL2_IPv4:PORT

Actual Behavior

Web app is only accesible on host machine via localhost:PORT and WSL2_IPv4:PORT

Diagnostic Logs

WslLogs-2024-12-23_16-15-20.zip

@PoProstuWitold
Copy link
Author

It was working last couple of days and today suddenly stopped. No idea why

Copy link

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

Diagnostic information
.wslconfig found
Detected appx version: 2.3.26.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant