microsoft / WSL

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

Windows programs unable to communicate on localhost, maybe due to mirrored mode wsl bug. #11417

Open peigongdsd opened 6 months ago

peigongdsd commented 6 months ago

Windows Version

Microsoft Windows [Version 10.0.26090.112]

WSL Version

WSL version: 2.2.1.0 Kernel version: 5.15.150.1-2 WSLg version: 1.0.60 MSRDC version: 1.2.5105 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.26090.112

Are you using WSL 1 or WSL 2?

Kernel Version

5.15.150.1-microsoft-standard-WSL2

Distro Version

PRETTY_NAME="Ubuntu 22.04.3 LTS" NAME="Ubuntu" VERSION_ID="22.04" VERSION="22.04.3 LTS (Jammy Jellyfish)" VERSION_CODENAME=jammy ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=jammy

Other Software

No response

Repro Steps

Expected Behavior

As above.

Actual Behavior

As above.

Diagnostic Logs

No response

github-actions[bot] commented 6 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.

peigongdsd commented 6 months ago

Well, just rebooting my machine to capture the bug. This is the screenshot when I was trying to connect to sing-box dashboard on 127.0.0.1:9090/ui.

1 0

Seems the response TCP package is truncated. Here is another experiment. Use miniserve to serve a folder on port 3015, localhost, and try to connect. At first the connection just die, but when wsl is started, the connection suddenly works.

https://github.com/microsoft/WSL/assets/51317171/c240b255-dd3d-4a89-b281-0a6733b018da

peigongdsd commented 6 months ago

This is very annoying since it has happened for quite a while, and I need to start wsl every time on windows boot. I tried to debug this but due to lack of knowledge of the internal mechanism of mirrored mode network of wsl and windows network stack, little could be done.

chanpreetdhanjal commented 5 months ago

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