microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.46k stars 822 forks source link

WSL does not have an access to the WiFi hotspot network #11741

Open Kosterio opened 4 months ago

Kosterio commented 4 months ago

Windows Version

Microsoft Windows [Version 10.0.22631.3593]

WSL Version

2.2.4.0

Are you using WSL 1 or WSL 2?

Kernel Version

5.15.153.1-2

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

I have a running UDP server in the WSL Ubuntu instance.\ I need to make it public for the network of the WiFi hotspot on Windows side.\ But when I activated the hotspot there is no access even to its local ip address from WSL (ping 192.168.137.1 is not responding).

I tried to use the networkingMode=mirrored in the .wslconfig, but the behavior is the same. Hotspot interface is not presented in the ifconfig, only interface with WiFi MAC (for using as client):

$ ifconfig -a
eth0: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 90:de:80:a3:10:fb  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.199.178.200  netmask 255.255.254.0  broadcast 10.199.179.255
        ether e8:9c:25:de:62:1b  txqueuelen 1000  (Ethernet)
        RX packets 7513  bytes 556095 (556.0 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 448  bytes 44396 (44.3 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 184  bytes 31013 (31.0 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 184  bytes 31013 (31.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

loopback0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 00:15:5d:bd:df:d5  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

my .wslconfig:

[wsl2]
memory=64GB
processors=24
networkingMode=mirrored
dnsTunneling=true
dnsProxy=false
firewall=false
autoProxy=false

[experimental]
hostAddressLoopback=true

How is it possible that I have an interface on Windows and it cannot be pinged from WSL?

Expected Behavior

ping 192.168.137.1 from WSL should be successful.

Actual Behavior

ping 192.168.137.1 is not responding.

Diagnostic Logs

No response

github-actions[bot] commented 4 months ago

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs Download and execute [collect-wsl-logs.ps1](https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-wsl-logs.ps1) in an **administrative powershell prompt**: ``` Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1 Set-ExecutionPolicy Bypass -Scope Process -Force .\collect-wsl-logs.ps1 ``` The scipt will output the path of the log file once done. Once completed please upload the output files to this Github issue. [Click here for more info on logging](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method) If you choose to email these logs instead of attaching to the bug, please send them to wsl-gh-logs@microsoft.com with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

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.

Kosterio commented 4 months ago

WslLogs-2024-07-03_13-54-22.zip

github-actions[bot] commented 4 months ago
Diagnostic information ``` .wslconfig found Detected appx version: 2.2.4.0 ```
Kosterio commented 4 months ago

I've tried to install one more repo (Debian), but on WSL 1, and it works - besides eth interfaces the wifi interfaces are appeared and wifi2 is hotspot interface with 192.168.137.1 address.\ So, it means that this is the bug of WSL 2 - in mirrored mode the wifi interfaces should be the same as on WSL 1, and in NAT mode the hotspot network should be accessible from the WSL. Hopefully Microsoft will fix it.

For now I cannot change WSL version for my distro and still looking for the workaround for this issue.

Zorik28 commented 2 months ago

Well, I have the same issue!

CatalinFetoiu commented 2 months ago

thanks for reporting the issue can you please collect networking logs using https://github.com/microsoft/WSL/blob/master/diagnostics/collect-networking-logs.ps1

please do the following steps: run collect-networking-logs.ps1 run net.exe stop WslService start WSL and reproduce the issue stop collect-networking-logs.ps1

the script should create a zip with name starting with WslNetworkingLogs