Great you can SSH into the machine manually now! That’s an important milestone.
Your remaining error:
Error: unable to connect to Podman socket: Get "http://d/v5.4.0/libpod/_ping": ssh: rejected: connect failed (open failed)
means the Podman client tries to set up an SSH tunnel to the Podman API socket inside the VM, but the connection fails at that step.
What’s possibly wrong here?
- The Podman socket inside the VM is not running or not reachable.
- The port forwarding (used by Podman CLI to reach socket via SSH) is failing inside the VM SSH server.
- Podman machine or VM is misconfigured or corrupted.
- Firewall or security software on Windows is blocking the port forwarding.
- The SSH config used by Podman CLI is broken or incomplete.
Step-by-step resolution
1. Verify Podman daemon/socket inside the VM
SSH into the podman machine:
podman system info
This should give you general info about the Podman environment. If it errors, Podman might not be installed or running properly inside the VM.
You can also check if the socket exists and is listening:
ls -l /run/podman/podman.sock
ss -lx | grep podman.sock
(Replace /run/podman/podman.sock with correct socket path if different.)
2. Verify podman service
Podman daemon is typically socket-activated (no explicit running service).
You can try to restart podman services or reboot the VM:
systemctl status podman.service
systemctl restart podman.service
If systemctl is not available (VM may be a minimal setup), just reboot the VM:
sudo reboot
Then try again from Windows terminal:
podman run hello-world
3. Double check SSH config used by Podman CLI
Podman on Windows uses the SSH config file you discovered earlier.
Check which SSH config Podman CLI is using:
podman system connection list
Example output:
NAME URI
podman-machine-default ssh://machine@localhost:2222/run/podman/podman.sock
The URI here is very important.
Notice the part after : is the socket path inside the VM.
Try to connect to that socket manually:
podman --connection podman-machine-default info
or
podman --remote --url ssh://machine@localhost:2222/run/podman/podman.sock info
If this fails with the same error, try to recreate the connection:
4. Recreate the system connection
Sometimes the default system connection is broken or missing. You can recreate it based on the inspected info.
Example:
podman system connection remove podman-machine-default
podman system connection add podman-machine-default ssh://machine@localhost:2222/run/podman/podman.sock --identity "C:\Users\YourUser\.config\containers\podman-machine-default\id_rsa" --ssh-config "C:\Users\YourUser\.config\containers\podman-machine-default\ssh.config"
podman system connection default podman-machine-default
Then test:
podman run hello-world
5. Firewall and security software on Windows
- Check that Windows firewall or your antivirus is NOT blocking
ssh.exe or connections to localhost:2222.
- Try temporarily disabling them.
- Check if any VPNs that may interfere with localhost networking are active and try disabling.
6. Update Podman to a bugfix release or reinstall
If problem persists, try uninstalling Podman, removing all related data under %USERPROFILE%\.config\containers and %USERPROFILE%\.local\share\containers, reboot, and install the latest Podman Windows stable build.
Summary
- SSH into VM and verify podman socket is present and podman works inside.
- Verify podman socket path in
podman system connection list matches the real socket path in VM.
- Recreate Podman system connection.
- Confirm no firewall blocking localhost:2222.
- Try
podman --connection podman-machine-default run hello-world.
If you want, please share the outputs of:
podman system connection list
- The exact
podman run hello-world command output with --log-level=debug (add -v or set export CONTAINERS_LOG_LEVEL=debug in Windows shell)
- Output of
ls -l /run/podman/podman.sock inside VM (after SSH)
That will help dig deeper.
Let me know how it goes!