Connections refused after sometime
Environment
Windows build number: Microsoft Windows [Version 10.0.19041.388]
Your Distribution version: 20.04
Linux version 4.19.104-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Wed Feb 19 06:37:35 UTC 2020
Steps to reproduce
- Start wsl
- Launch any server on localhost in wsl
- In windows, make a request to the server running on localhost for wsl, and the connection is refused
Expected behavior
Expected to not reject any incoming connection on localhost even after a while.
Actual behavior
The connections are rejected after sometime. Have to run wsl.exe --shutdown to restart wsl and perfom successful connections on localhost. Another thing, when the wsl starts rejecting requests on localhost, it doesn't reject requests from internet. Internet is working fine all the time.
I can't help with the reproduction. It just happens after sometime. Although #4636 and #4353 look very similar. I am closing this issue and will follow on those issues.
I am experiencing exactly the same issue. The other issues are similar, but in my case it is exactly as mythio reported and I am running the same environment as mythio.
What I can add is. When I boot and start some services inside the guest it looks like this (TCPView):
wslhost.exe 18124 TCP 127.0.0.1 53 0.0.0.0 0 LISTENING
wslhost.exe 18124 TCP 127.0.0.1 4041 0.0.0.0 0 LISTENING
wslhost.exe 18124 TCP 127.0.0.1 8118 0.0.0.0 0 LISTENING
wslhost.exe 18124 TCP 127.0.0.1 8118 127.0.0.1 58605 ESTABLISHED
wslhost.exe 18124 TCP 127.0.0.1 8118 127.0.0.1 58604 ESTABLISHED
wslhost.exe 18124 TCP 127.0.0.1 8118 127.0.0.1 58578 ESTABLISHED
wslhost.exe 18124 TCP 127.0.0.1 8118 127.0.0.1 58598 ESTABLISHED
wslhost.exe 18124 TCP 127.0.0.1 8118 127.0.0.1 58596 ESTABLISHED
wslhost.exe 18124 TCP 127.0.0.1 8118 127.0.0.1 58597 ESTABLISHED
wslhost.exe 18124 TCP 127.0.0.1 8118 127.0.0.1 58601 ESTABLISHED
wslhost.exe 18124 TCP 127.0.0.1 8118 127.0.0.1 58599 ESTABLISHED
wslhost.exe 18124 TCP 127.0.0.1 8118 127.0.0.1 58600 ESTABLISHED
wslhost.exe 18124 TCP 127.0.0.1 8118 127.0.0.1 58595 ESTABLISHED
wslhost.exe 18124 TCP 127.0.0.1 8118 127.0.0.1 58594 ESTABLISHED
wslhost.exe 18124 TCPV6 [0:0:0:0:0:0:0:1] 53 [0:0:0:0:0:0:0:0] 0 LISTENING
wslhost.exe 18124 TCPV6 [0:0:0:0:0:0:0:1] 8118 [0:0:0:0:0:0:0:0] 0 LISTENING
Then after some time or event wslhost.exe just seems to die, and I need to perform wsl --shutdown.
Additional information probably related usage information:
Running on the host:
- VS Code
- Docker Desktop
- Windows Terminal
Running inside guest:
- Unbound
- Privoxy
- socat
- OpenVPN
The services inside the Guest are used since some time and did not seem to influence the problem. The problem occurred often, then disappeared with no apparent usage change and if my feeling is correct, appeared again after installing Docker Desktop recently. It could be related to something VS Code was doing and Docker Desktop is still doing...
But I am a Linux user, so I cannot help much more unless someone tells me what to do to further isolate the problem.