Open KingOfGitH opened 5 months ago
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.
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!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Here are the collected logs. I have reviewed the above-mentioned issues, and they do not match my problem. Additionally, I just tested on another computer on the LAN, and it can access both 10.0.0.140:6000 and 10.0.0.140:47990 simultaneously.
The log file doesn't contain any WSL traces. Please make sure that you reproduced the issue while the log collection was running.
Sorry, this is new logs WslLogs-2024-05-19_11-27-42.zip
I changed the network mode to NAT, but it failed to start with the error Error code: Wsl/Service/CreateInstance/CreateVm/ConfigureNetworking/HNS/ERROR_UNHANDLED_EXCEPTION
.
When I switched the network mode back to mirrored, something even stranger happened: computers on the LAN can no longer access port 6000 either.
Additionally, the ifconfig command fails to retrieve the host machine's IP 10.0.0.140.
WslLogs-2024-05-19_18-43-38.zip
# ifconfig
br-9154cb03c575: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.18.0.1 netmask 255.255.0.0 broadcast 172.18.255.255
ether 02:42:03:3c:9f:34 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2 bytes 180 (180.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
ether 02:42:a2:1c:04:f5 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2 bytes 180 (180.0 B)
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 12 bytes 1580 (1.5 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12 bytes 1580 (1.5 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
veth421c985: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether ce:9d:61:e0:0b:48 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2 bytes 180 (180.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
vethaa81b74: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether ee:05:7d:59:f8:eb txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2 bytes 180 (180.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
# echo "LOOPBACK: " $(ip r list table 127)
Error: ipv4: FIB table does not exist.
Dump terminated
LOOPBACK:
An HNS error seems to be causing WSL2 to fail to start. Adding network tag
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.
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!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
/question
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.
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!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
I changed the network mode to NAT, but it failed to start with the error
Error code: Wsl/Service/CreateInstance/CreateVm/ConfigureNetworking/HNS/ERROR_UNHANDLED_EXCEPTION
.When I switched the network mode back to mirrored, something even stranger happened: computers on the LAN can no longer access port 6000 either.
Additionally, the ifconfig command fails to retrieve the host machine's IP 10.0.0.140.
WslLogs-2024-05-19_18-43-38.zip
# ifconfig br-9154cb03c575: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 172.18.0.1 netmask 255.255.0.0 broadcast 172.18.255.255 ether 02:42:03:3c:9f:34 txqueuelen 0 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 2 bytes 180 (180.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255 ether 02:42:a2:1c:04:f5 txqueuelen 0 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 2 bytes 180 (180.0 B) 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 12 bytes 1580 (1.5 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 12 bytes 1580 (1.5 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 veth421c985: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 ether ce:9d:61:e0:0b:48 txqueuelen 0 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 2 bytes 180 (180.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 vethaa81b74: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 ether ee:05:7d:59:f8:eb txqueuelen 0 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 2 bytes 180 (180.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 # echo "LOOPBACK: " $(ip r list table 127) Error: ipv4: FIB table does not exist. Dump terminated LOOPBACK:
if fix this by https://github.com/microsoft/WSL/issues/11389
An HNS error seems to be causing WSL2 to fail to start. Adding network tag
Hi. Can you please collect networking logs by following the instructions below? https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues
Hi. Can you please collect networking logs by following the instructions below? https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues
of course, this is logs WslLogs-2024-06-15_15-30-30.zip
I investigated and found a temporary solution. After turning on the system's mobile hotspot on Windows, there was no problem with the communication between WSL and the host, and I repeated this solution at the end of collecting the logs.
But I don't know the specific reason, I hope I can give you some clues
this may have somthing to do with switching the primary network stack around. the issue started for me when I had to disconnect my cabled eithernet and switch to wifi/hotspot when my interenet was down. When the internet came back up and I changed the network back to wired eithernet I was no longer able to connect from windows to any wsl instance. The really weird part is WSL can still get to the internet, other WSL instances and external systems can still connect to WSL.
networkmode=mirrored local Windows to local Windows: works Remote to local windows: works remote to wsl: works wsl to wsl: works wsl to windows: does not work windows to wsl does not work wsl to remote: works windows to remote: works
both ufw and windows firewall were down.
If I switch WSL to NAT I can get from windows to wsl but remote system can no longer connect to wsl. and wsl can not connect to WSL.
this may have somthing to do with switching the primary network stack around. the issue started for me when I had to disconnect my cabled eithernet and switch to wifi/hotspot when my interenet was down. When the internet came back up and I changed the network back to wired eithernet I was no longer able to connect from windows to any wsl instance. The really weird part is WSL can still get to the internet, other WSL instances and external systems can still connect to WSL.
networkmode=mirrored local Windows to local Windows: works Remote to local windows: works remote to wsl: works wsl to wsl: works wsl to windows: does not work windows to wsl does not work wsl to remote: works windows to remote: works
both ufw and windows firewall were down.
If I switch WSL to NAT I can get from windows to wsl but remote system can no longer connect to wsl. and wsl can not connect to WSL.
I had the same problem, and the workaround I found was to turn on the hotspot on my computer in mirror mode, and everything worked fine. you can try it
I found I was able to "fix it" with npcap from wireshark. I'm guessing there is something screwed up in the bowels of the tcp/ip stack for local loop back ... for now I built myself a tool I can leave in the system tray and can activate when I need wsl/docker to work locally (I could also switch from mirrored to nat... but then I can't access it remotely.)
It would be nice to get an actual fix but yet another workaround is as good as anything else I guess (I've tried several of the other workarounds but they didn't work for me.)
https://github.com/microsoft/WSL/issues/10494#issuecomment-2184173520
I encountered the same problem, turning on the mobile hotspot or using wireshark to capture the local loopback port can work emm...
@KingOfGitH thanks for attaching logs, sorry for the delay following up on this
could you please collect WslNetworkingLogs, using https://github.com/microsoft/WSL/blob/master/diagnostics/collect-networking-logs.ps1 ?
please refer to the instructions at https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues
@KingOfGitH thanks for attaching logs, sorry for the delay following up on this感谢您附上日志,抱歉延迟跟进此问题
could you please collect WslNetworkingLogs, using https://github.com/microsoft/WSL/blob/master/diagnostics/collect-networking-logs.ps1 ?您可以使用https://github.com/microsoft/WSL/blob/master/diagnostics/collect-networking-logs.ps1收集 WslNetworkingLogs 吗?
please refer to the instructions at https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues请参阅https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues上的说明
I have collected the logs, but unfortunately, there doesn't seem to be any useful content. The only thing I can do is use curl on WSL to access the following existing services on Windows and wait for a timeout. Then, I repeated the operation after turning on the mobile hotspot, proving that access is possible.
@KingOfGitH thanks for following up. It looks like you collected logs using https://github.com/microsoft/WSL/blob/master/diagnostics/collect-wsl-logs.ps1
instead we need logs using https://github.com/microsoft/WSL/blob/master/diagnostics/collect-networking-logs.ps1
could you please collect logs using the second script?
thanks
@KingOfGitH thanks for following up. It looks like you collected logs using https://github.com/microsoft/WSL/blob/master/diagnostics/collect-wsl-logs.ps1
instead we need logs using https://github.com/microsoft/WSL/blob/master/diagnostics/collect-networking-logs.ps1
could you please collect logs using the second script?
thanks
No problem! Here’s the translation:
I apologize for previously missing this part of the log collection.
The collected logs are quite large,. I initially planned to send the logs as an email attachment. However, during the process, the file was uploaded to OneDrive and couldn't be converted into an attachment. Please check if you can access the logs using this link. If not, I will consider how to convert the link into an attachment. Thank you.
https://1drv.ms/u/c/cbedb7e1d4315f17/EYBGk57fS4pFgq01gX4fQ20B3UagrzgBYv-zsewSj8-c8A
The main operations were as follows:
First, I used the Windows curl
command to access the service, and the result was successful access.
Then, I used the WSL curl
command to access the service, but the result was a timeout.
Finally, after turning on the mobile hotspot, I used the WSL curl
command to access the service, and this time the access was successful.
this may have somthing to do with switching the primary network stack around. the issue started for me when I had to disconnect my cabled eithernet and switch to wifi/hotspot when my interenet was down. When the internet came back up and I changed the network back to wired eithernet I was no longer able to connect from windows to any wsl instance. The really weird part is WSL can still get to the internet, other WSL instances and external systems can still connect to WSL. networkmode=mirrored local Windows to local Windows: works Remote to local windows: works remote to wsl: works wsl to wsl: works wsl to windows: does not work windows to wsl does not work wsl to remote: works windows to remote: works both ufw and windows firewall were down. If I switch WSL to NAT I can get from windows to wsl but remote system can no longer connect to wsl. and wsl can not connect to WSL.
I had the same problem, and the workaround I found was to turn on the hotspot on my computer in mirror mode, and everything worked fine. you can try it
I have the exact same issue. The workaround of turning on the hotspot works for me, but I am curious why is this happening?
Windows Version
Microsoft Windows [版本 10.0.22631.3527]
WSL Version
2.2.4.0
Are you using WSL 1 or WSL 2?
Kernel Version
5.15.153.1-microsoft-standard-WSL2
Distro Version
Ubuntu 22.04
Other Software
NONE.
This network issue is not related to Docker. I am using python3 -m http.server 6000 to set up a simple service, and the Python version is 3.10.12.
Repro Steps
Set .wslconfig:
Turn off the WSL2 firewall.
Turn off the Hyper-V firewall.
Open port 6000 on the Windows Firewall.
I even tried turning off the entire firewall and restarting the computer.
Run
A service is running on the same host machine with port 47990, and WSL2 tries to access this service.
Expected Behavior
Actual Behavior
Diagnostic Logs
To be honest, I can't even determine the IP or other handles of Win11 and WSL2, which renders my network troubleshooting experience useless. I will try to troubleshoot further and send an email later.