containers / podman

Podman: A tool for managing OCI containers and pods.
https://podman.io
Apache License 2.0
23.79k stars 2.42k forks source link

After starting a podman machine on Windows WSL with podman 5.2.5 - Error: unable to connect to Podman socket: failed to connect #24570

Open odockal opened 5 hours ago

odockal commented 5 hours ago

Issue Description

Using Podman 5.2.5 on Windows with WSL provider I can initialize and start the machine (at least it seems running), but podman info then shows an error: unable to connect to Podman socket

Full Error:

Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM
Error: unable to connect to Podman socket: failed to connect: dial tcp 127.0.0.1:54985: connectex: No connection could be made because the target machine actively refused it.

Steps to reproduce the issue

Steps to reproduce the issue

  1. Install Podman 5.2.5 on Windows 10 (might be occurring elsewhere)
  2. podman machine init --now
  3. podman info

Describe the results you received

 podman machine init --now
Downloading VM image: v20241112031159-5.2-rootfs-amd64.tar.zst: done
Extracting compressed file: podman-machine-default-amd64: done
Importing operating system into WSL (this may take a few minutes on a new WSL install)...
Import in progress, this may take a few minutes.
The operation completed successfully.
Configuring system...
Machine init complete
Starting machine "podman-machine-default"

This machine is currently configured in rootless mode. If your containers
require root permissions (e.g. ports < 1024), or if you run into compatibility
issues with non-podman clients, you can switch using the following command:

        podman machine set --rootful

API forwarding listening on: npipe:////./pipe/docker_engine

Docker API clients default to this address. You do not need to set DOCKER_HOST.
Machine "podman-machine-default" started successfully
PS C:\Users\podmanqe\pde2e> podman info
OS: windows/amd64
provider: wsl
version: 5.2.5

Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM
Error: unable to connect to Podman socket: failed to connect: dial tcp 127.0.0.1:54985: connectex: No connection could be made because the target machine actively refused it.
PS C:\Users\podmanqe\pde2e> podman machine ls
NAME                    VM TYPE     CREATED        LAST UP            CPUS        MEMORY      DISK SIZE
podman-machine-default  wsl         2 minutes ago  Currently running  2           2GiB        100GiB

Describe the results you expected

Podman info returns expected outcome.

podman info output

podman info
OS: windows/amd64
provider: wsl
version: 5.2.5

Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM
Error: unable to connect to Podman socket: failed to connect: dial tcp 127.0.0.1:54985: connectex: No connection could be made because the target machine actively refused it.

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

Yes

Additional environment details

Windows 10, x64, Podman 5.2.5.

Base podman image: v20241112031159-5.2-rootfs-amd64.tar.zst

Additional information

Since we have tested podman 5.2.5 on Windows with Podman Desktop 1.14.1 (last week) I can confirm that all worked like a charm. I suspect the base image, which has changed in a meantime (timestamp 20241112).

Luap99 commented 5 hours ago

Does 5.3.0 work? 5.2.5 is EOL with the release of 5.3

odockal commented 5 hours ago

I can ssh into machine and pull an image from there. The problem gonna be between client and socket.

I tried also to manually remove all possible leftovers:

# I always did podman machine reset -f
PS C:\Users\podmanqe> podman machine reset -f
# this time I also added
PS C:\Users\podmanqe> rm -r .\.config\containers\
PS C:\Users\podmanqe> rm -r .\.local\share\containers\podman\
PS C:\Users\podmanqe> rm -r .\AppData\Roaming\containers\

and it now works correctly. Is it possible that some leftover, ie. connection on one of the config folder caused the problem?