localhost:PORT from windows host no longer gets handled by process running in WSL2
Version
Microsoft Windows [Version 10.0.25169.1000]
WSL Version
- [X] WSL 2
- [ ] WSL 1
Kernel Version
5.15.57.1
Distro Version
Ubuntu 20.04
Other Software
No response
Repro Steps
- update WSL to the newest insider store version
- spin up any kind of server inside WSL (tried with node applications running on Port 3000, 4400, 8080 and a mysql instance running on docker on port 3306)
- try to access the exposed service from f.e. Edge by running http://localhost:3000
Expected Behavior
Whatever is running on localhost:3000 in WSL is getting delivered to the Browser requesting it.
Actual Behavior
Edge get's an ERR_CONNECTION_REFUSED error.
Accessing through the IP address of eth0 with the port works. So f.e. http://localhost:3000 or http://127.0.0.1:3000 fail, but http://172.25.170.221:3000 works.
This worked until this morning when I updated to the latest version (0.65.1) in the store.
Diagnostic Logs
No response
Thanks for reporting. @pmartincic could you please take a look?
Maybe this has something do with that: I cannot reach my Kubernetes cluster build with KinD anymore. I also tested the Kubernetes cluster from Docker Desktop
Suddenly, I got (for Docker Desktop)
The connection to the server kubernetes.docker.internal:6443 was refused - did you specify the right host or port?
or for the KinD cluster
The connection to the server 127.0.0.1:30000 was refused - did you specify the right host or port?
It worked perfectly for months. The only thing changed was a Windows Update with update of WSL to 0.65.1
❯ wsl --version
WSL version: 0.65.1.0
Kernel version: 5.15.57.1
WSLg version: 1.0.41
MSRDC version: 1.2.3213
Direct3D version: 1.601.0
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22622.450
Same here, minikube cannot ssh to it container anymore. I can SSH to it from a "normal" windows prompt, but not from WSL linux distro. Happen since the last update I got this morning :
WSL version: 0.65.1.0
Kernel version: 5.15.57.1
WSLg version: 1.0.41
MSRDC version: 1.2.3213
Direct3D version: 1.601.0
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22622.450
/logs
Hello! Could you please provide more logs to help us better diagnose your issue?
To collect WSL logs, download and execute 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
Thank you!
Are you guys by chance using a private kernel? Could you share the output of cat /proc/version?
❯ cat /proc/version
Linux version 5.15.57.1-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP Wed Jul 27 02:20:31 UTC 2022
Are you guys by chance using a private kernel? Could you share the output of
cat /proc/version?
I use the default Ubuntu 20.04 image
I will provide logs later, when I am home
uninstalling 10.0.22622.450 on Windows Update>Update history>Uninstall updates doesn't fix remain the message
The connection to the server kubernetes.docker.internal:6443 was refused - did you specify the right host or port?
I'm trying to find an option to downgrade wsl back to [0.64.0]
Versão do WSL: 0.65.1.0
Versão do kernel: 5.15.57.1
Versão do WSLg: 1.0.41
Versão do MSRDC: 1.2.3213
Versão do Direct3D: 1.601.0
Versão do DXCore: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows versão: 10.0.22622.440
WslLogs-2022-08-03_16-15-51.zip
on WSL Ubuntu:
telnet kubernetes.docker.internal 6443doesn't work,- name resolution returns 127.0.0.1
on Windows Host:
- port 6443 is listening in windows
- kubectl on powershell works.
Just an additional data point that I am not able to reproduce after installing 0.65.1 on Windows 11 non-Insider (10.0.22000.795). I installed from the Releases page using Add-AppxPackage in an Administrative PowerShell:
I can now reproduce in Windows 11 GA with 0.65.1 based on @mwidmann's updated description.
$ $env:WSL_UTF8=1
$ wsl --status | clip.exe
Default Distribution: Ubuntu-22.04
Default Version: 2
WSL version: 0.65.1.0
Kernel version: 5.15.57.1
WSLg version: 1.0.41
MSRDC version: 1.2.3213
Direct3D version: 1.601.0
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22000.795
In Ubuntu 22.04:
python3 -m http.server
And can browse in Edge to localhost:8000 and view the directory contents. Also tried with port 3000, which worked as well.
So perhaps it's something else in Insider causing the issue rather than the WSL update? Or perhaps an interaction between the two.
I'm using Insider back to 22622.450, the connection from windows to localhost:80 hosted in kubernetes WSL2 "Docker Desktop" worked.
from WSL2 Ubuntu docker ps worked
from WSL2 Ubuntu kubectl get namespaces doesn't work
from windows Powershell kubectl get namespaces worked
i'm trying to export my wsl Ubuntu distro, to uninstall wsl from windows, and try reinstall wsl without the Preview, in last scenario start work again in windows powershell until solution or work around was found 😥
I'm using Insider back to 22622.450, the connection from windows to localhost:80 hosted in kubernetes WSL2 "Docker Desktop" worked.
from WSL2 Ubuntu
docker psworkedfrom WSL2 Ubuntu
kubectl get namespacesdoesn't workfrom windows Powershell
kubectl get namespacesworkedi'm trying to export my wsl Ubuntu distro, to uninstall wsl from windows, and try reinstall wsl without the Preview, in last scenario start work again in windows powershell until solution or work around was found 😥
I can confirm the same behavior. I can also add, that I installed a new WSL distro Ubuntu 18.04 and got the same behavior with the freshly installed distro.
Ahhhh, this helps. I read the original bug description as saying that localhost:port was inaccessible from the windows host.
I'm using Insider back to 22622.450, the connection from windows to localhost:80 hosted in kubernetes WSL2 "Docker Desktop" worked.
from WSL2 Ubuntu
docker psworkedfrom WSL2 Ubuntu
kubectl get namespacesdoesn't workfrom windows Powershell
kubectl get namespacesworkedi'm trying to export my wsl Ubuntu distro, to uninstall wsl from windows, and try reinstall wsl without the Preview, in last scenario start work again in windows powershell until solution or work around was found 😥
I'm trying to find an option to downgrade wsl back to [0.64.0]
Any luck on this? [0.65.1] has broken Kind cluster.
Everything (docker desktop, kind) latest version, but since yesterday when this got updated it doesn't work, even with clean install.
Just as a work around: just using docker destop without WSL engine, everything still works.
@DmytryEmery - I'd suggest downloading a previous release from the github releases page.
@benhillis thanks! just to confirm reverting to 0.64.0 resolved the issue for me
While debugging this locally we have pushed https://github.com/microsoft/WSL/releases/tag/0.65.2 which will revert to the previous behavior.
~Sadly the update was installed before I could get the logs, but I can confirm that with this version, the described issues are gone.~
I have to revert this. While the first couple of requests worked fine, it is back to ERR_CONNECTION_REFUSED now.
Tried on ports 8080 and 4400. localhost and 127.0.0.1 don't work. The IP Address eth0 has in ubuntu instance can be used to connect.
I ran the collect-wsl-logs.ps1 command and have the following logs. Hope those help to identify the issue.
WslLogs-2022-08-04_08-02-22.zip
BTW, the machine is already updated to the latest DEV Insider build Microsoft Windows [Version 10.0.25174.1000]
This is what wsl --version outputs:
WSL-Version: 0.65.2.0
Kernelversion: 5.15.57.1
WSLg-Version: 1.0.41
MSRDC-Version: 1.2.3213
Direct3D-Version: 1.601.0
DXCore-Version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows Version: 10.0.25174.1000
and this is the output of cat /proc/version inside my Ubuntu installation:
Linux version 5.15.57.1-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP Wed Jul 27 02:20:31 UTC 2022
@benhillis thanks! just to confirm reverting to 0.64.0 resolved the issue for me
Can you explain how you did it ? Downloaded the packages and launched the installer but it wouldn't finish. Tried in Powershell via this command : Add-AppPackage -path "C:\Users\xxxxxx\Downloads\Microsoft.WSL_0.64.0.0_x64_ARM64.msixbundle" but to no avail. It states that the superior version is already installed and so cant downgrade...
Having the same problem after this night update , and of course the day it is most needed (merge and review for client project release...)
~Sadly the update was installed before I could get the logs, but I can confirm that with this version, the described issues are gone.~
I have to revert this. While the first couple of requests worked fine, it is back to
ERR_CONNECTION_REFUSEDnow.Tried on ports 8080 and 4400. localhost and 127.0.0.1 don't work. The IP Address eth0 has in ubuntu instance can be used to connect.
I ran the
collect-wsl-logs.ps1command and have the following logs. Hope those help to identify the issue. WslLogs-2022-08-04_08-02-22.zipBTW, the machine is already updated to the latest DEV Insider build
Microsoft Windows [Version 10.0.25174.1000]This is what
wsl --versionoutputs:WSL-Version: 0.65.2.0 Kernelversion: 5.15.57.1 WSLg-Version: 1.0.41 MSRDC-Version: 1.2.3213 Direct3D-Version: 1.601.0 DXCore-Version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows Version: 10.0.25174.1000and this is the output of
cat /proc/versioninside my Ubuntu installation:Linux version 5.15.57.1-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP Wed Jul 27 02:20:31 UTC 2022
I have the exact same problem, it works for a few http/https requests and then back to ERR_CONNECTION_REFUSED afterwards
@benhillis thanks! just to confirm reverting to 0.64.0 resolved the issue for me
Can you explain how you did it ? Downloaded the packages and launched the installer but it wouldn't finish. Tried in Powershell via this command : Add-AppPackage -path "C:\Users\xxxxxx\Downloads\Microsoft.WSL_0.64.0.0_x64_ARM64.msixbundle" but to no avail. It states that the superior version is already installed and so cant downgrade...
Having the same problem after this night update , and of course the day it is most needed (merge and review for client project release...)
The update was just offered to me through the Windows Store. That's why it was faster than my logs gathering.
This is getting stranger and stranger. It appears that the problems start when a second port is opened with the same process. Running one node process on port 8080 works, starting a second one on port 4400 produces the ERR_CONNECTION_REFUSED. Same with the simple python webserver. Running python3 -m http.server works, but starting a second instance python3 -m http.server 8080 breaks both.
Here's a new set of logs... WslLogs-2022-08-04_08-50-11.zip