-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No connection could be made because the target machine actively refused it #19554
Comments
cc @lstocchi @jeffmaury do you have faced this issue on Windows ? @bwgjoseph are you using a firewall or connected to a VPN ? |
Yes generally happens when podman machine state and wsl are not in sync.
|
and |
Don't think there's firewall but I can double check. No VPN. |
Not sure what does not in sync means. Is there something I can run to check? I'm pretty sure my wsl is running when I'm testing on podman. Anything else for me to check? |
After I run
|
Yes when you're in this start, try to enter the wsl machine by running |
This is windows machine, so there isn't Anyway, my wsl is alive, but the connection is still null |
could you list all wsl instances ? AFAIK podman brings a fedora wsl instance and here we're seeing Ubuntu so I guess there is something that happened |
The 1. |
Alright. It is now the default. I rebooted my machine after I set Not sure if relevant but This is the output for
|
Seems your WSL instance is fine now. What's about |
Here's the log. I tried to run
|
Seems the sshd service stopped around 22:36:44 so maybe checking why it stopped |
Sorry, I have no idea. I'm not familiar with this, but if there's something for me to run, I can do that. If it helps, I am running within a VM. Pretty much a fresh VM with WSL and podman installed only. |
For what it's worth, I've been running into this as well from time to time on my Windows 10 machine running WSL 2. Like others, occasionally it seems to resolve itself, but today I haven't been able to figure out how to coax my podman machine back to a working state. That being said, this is what I'm seeing on my end. Not sure if it helps to find a lasting solution or not, but maybe it can help narrow out some other debugging paths. In my case, a On the Windows side, I run TCPView and can't see anything listening on port 49312. That's enough to explain the connection refused errors I get from any client on the Windows side. It's almost like WSL isn't exposing to Windows the ports services running inside the Linux distributions are listening on. Interestingly enough, when I launch my Ubuntu WSL distro with On top of that, if I start netcat inside my Ubuntu machine using At this point I'm not sure why some ports get exposed through WSL vs. not. I'm continuing to try things on my end, and I'd be happy to try to collect any debug output I can on my end. Hopefully though that this helps narrow down where to look for the underlying fault. |
I am having this same issue. Have been a longtime Docker user, but now working for a new firm, they asked that I switch over to Podman. Note, this is a NEW PC: Windows 11 Pro; Version22H2; OS Build: 22621.1265 I had Podman working fine, shutdown and restarted machine after some of the latest Windows Updates and now can't get Podman to work. Please let me know what logs or diagnostics I can provide to help resolve. |
What is the output of |
|
So what kind of error do you have. What happen when you run |
|
Seems that my base Windows terminal doesn't connect to the machine, but when I go into the running machine it can run?
|
From the Windows shell can you try:
|
Hi, was wondering if there's anything I can try with my issue. Thanks |
|
Can you run |
@tppalani So when that happens that means you have the previous generation of WSL that was a fixed / static component of the OS. In the older generation wsl --update will at least update the Linux kernel in use, so you could try that first, and instead of wsl --version, you can use wsl --status on that one to verify the version. Microsoft recently moved to a model where there is an independent update stream of WSL, allowing all recent variants and versions of Windows to stay current. However you need to be on 21H1, 21H2, or 22H2 of Windows 10, or 21H1 on Windows 11. If you run Windows update it should present you with the option to install one of these. Once that is done (and you have rebooted), wsl --install should install the current stream. |
Hi @n1hility here the output of wsl --status Default Distribution: podman-machine-default Windows Subsystem for Linux was last updated on 4/21/2023 |
I ran into this same issue after a Windows 10 update this week. Moving from 4.5.0 to 4.5.1 then running the following fixed it: |
Hi @n1hility Can you please help me about this
when I'm doing kubectl get pod i'm getting error connection refused with different port number
|
I have tried everything I can. Uninstalled, reinstalled, uninstalled WSL and let Podman reinstall that. The connection refused error is still sporadic even with the latest podman install 4.5.1. I got the So this last time I uninstalled WSL and now back to the failed to connect connectex errors. |
I have the same issue. It worked fine until Windows had crashed and restarted. podman.exe version 4.5.1 wsl -l -v
podman system connection ls Get-NetTCPConnection -LocalPort 11627 -State Listen
Windows event log shows:
What helped me fix it was to disable the "Start on login" in the settings. |
I did get mine resolved by completely going thru the uninstall process again. I also uninstalled WSL as well this time and rebooted. I got it all to install and |
This solved the issue for me. Podman v4.5.1 in W10 |
I encountered the same problem, and I think I found a solution, at least for my case.
And here's what I have tried.
After some research, I finally found this WSL issues: Not sure how WSL works for making the reserved ports, but somehow the port assigned by podman got reserved by WSL. I ran
and the result:
As you can see my assigned port After restarting the service:
And see the excluded port ranges again:
The podman port is not in the excluded list and thus working as expected now. I didn't dig too deep into why WSL is excluding tons of ports like that and somehow those ports covered podman's SSH port, could be a bug. People we are interested can dig deeper into the issue I found. But I guess podman desktop might need to find a way to workaround that issue by selecting a port less likely to be excluded by WSL or maybe come up with a way to dynamically select one not from the excluded range. |
@fangpenlin great observation! We should ensure the port selected is just below the dynamic range, since these can be tied up by WSL / hyperv for internal usage. Will get a fix in for that. |
For me the root cause was a DNS configuration issue in WSL, which sometimes arises after a Windows reboot. To address this:
This change redirects DNS requests to Google's nameserver and allowed podman to connect again. Hope it can help others... |
@recodingLife you were most likely experiencing a different connectivity issue than the primary issue described here since DNS should not be a factor. If you are using a VPN that drops VM traffic you might also be interested in the recently introduced user-mode-networking feature. |
FYI to those impacted by the issue described by the OP: #19557 (just merged) should address this problem. The new behavior will detect port conflicts on startup and automatically switch to a new available port, which will then be bindable by the wsl relay. You won't need to take any action other than updating to the new release when it's available. |
Bug description
note: realize this could be the same issue as podman-desktop/podman-desktop#1173, but I have tried to provide more information and am not sure if it's really the same. Ok to close as duplicate if deem so.
I have saved an image from the internet machine and bring into an air-gapped machine to load it in.
I encounter the following error
Operating system
Windows 10
Version
0.12.0
Steps to reproduce
Initially, I was thinking if this has something to do with
DOCKER_HOST
, so I followed the guide but when I ran the commandThe output
Relevant log output
Additional context
It looks a little related to
I also tried rebooted my machine. This is running on a Virtual Machine if this helps
The text was updated successfully, but these errors were encountered: