15

Update: This is solved, please see the answer.

I am using podman on MacOS with podman machine and now podman is unable to connect to the podman machine.

(It worked earlier but not sure the new macOS version causing the issue)

MacOS Monterey (12.1)

$ podman machine init
Extracting compressed file

$ podman machine start
INFO[0000] waiting for clients...                       
INFO[0000] listening tcp://127.0.0.1:7777               
INFO[0000] new connection from  to /var/folders/8f/v0tpqxg56wsf9x6x6tntjt5h0000gn/T/podman/qemu_podman-machine-default.sock 
Waiting for VM ...
Machine "podman-machine-default" started successfully

$ podman machine ls
NAME                     VM TYPE     CREATED             LAST UP            CPUS        MEMORY      DISK SIZE
podman-machine-default*  qemu        About a minute ago  Currently running  1           2.147GB     10.74GB

$ podman version
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. failed to create sshClient: dial unix /private/tmp/com.apple.launchd.WAh1QMSoLg/Listeners: connect: no such file or directory

$ podman ps
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. failed to create sshClient: dial unix /private/tmp/com.apple.launchd.WAh1QMSoLg/Listeners: connect: no such file or directory

$ podman run -dt -p 8080:80 nginx
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. failed to create sshClient: dial unix /private/tmp/com.apple.launchd.WAh1QMSoLg/Listeners: connect: no such file or directory

$ podman --log-level=debug version
INFO[0000] podman filtering at log level debug          
DEBU[0000] Called version.PersistentPreRunE(podman --log-level=debug version) 
DEBU[0000] SSH Ident Key "/Users/gini/.ssh/podman-machine-default" SHA256:duxS/j3bzl90jSUtbXVIofL4O+FqZ5sUL63c26u2gdo ssh-ed25519 
DEBU[0000] Found SSH_AUTH_SOCK "/private/tmp/com.apple.launchd.WAh1QMSoLg/Listeners", ssh-agent signer(s) enabled 
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. failed to create sshClient: dial unix /private/tmp/com.apple.launchd.WAh1QMSoLg/Listeners: connect: no such file or directory

Describe the results you expected:

Expecting to get the podman version and other information.

Package info:

$ brew info podman
podman: stable 3.4.4 (bottled), HEAD
Tool for managing OCI containers and pods
https://podman.io/
/usr/local/Cellar/podman/3.4.4 (170 files, 40MB) *
  Poured from bottle on 2021-12-29 at 21:51:28
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/podman.rb
License: Apache-2.0
==> Dependencies
Build: go ✘, go-md2man ✘
Required: qemu ✔
==> Options
--HEAD
        Install HEAD version
==> Caveats
zsh completions have been installed to:
  /usr/local/share/zsh/site-functions
==> Analytics
install: 11,107 (30 days), 38,817 (90 days), 78,249 (365 days)
install-on-request: 11,111 (30 days), 38,825 (90 days), 78,240 (365 days)
build-error: 2 (30 days)
$ sw_vers 
ProductName:    macOS
ProductVersion: 12.1
BuildVersion:   21C52
Gineesh
  • 429
  • 1
  • 5
  • 13
  • 1
    @jmort253, thanks, I have checked that but the issue was with `SSH_AUTH_SOCK` I have run `unset SSH_AUTH_SOCK` and it is resolved. – Gineesh Jan 22 '22 at 02:36
  • podman released 4.x, possible to upgrade the version and update the questions? this part could be changed – Larry Cai Apr 04 '22 at 11:21
  • it may popup some network permission issue which u skipped – Larry Cai Apr 04 '22 at 11:21
  • oh okay. I did not test since the workaround (below) was working. Thanks for sharing, will test it again. (I did not see any popup window though) – Gineesh Apr 06 '22 at 04:09
  • 2
    I've podman version 4.1.1, still having issue with that. unsetting SSH_AUTH_SOCK didn't work. It was working fine for couple of days and now I'm unable to start podman at all as it says `Error: dial unix /var/folders/ps/29ntn8ss037052ytz9s1jl_0v496q_/T/podman/connectionname_ready.sock: connect: connection refused`. – Tuhin Jun 29 '22 at 10:39
  • I was starting the podman machine with 16GB memory. after following the [discussion](https://github.com/containers/podman/issues/14303) here, I used the default memory allocation (without any `-m` switch) and the machine started without showing any error. – Tuhin Jun 29 '22 at 11:18

4 Answers4

11

Thanks to Luap99.

podman was trying to connect to the $SSH_AUTH_SOCK address but this is failing.

executed below command and the problem solved.

unset SSH_AUTH_SOCK
Gineesh
  • 429
  • 1
  • 5
  • 13
  • 1
    or `set -e SSH_AUTH_SOCK` on fish (cf. https://stackoom.com/en/question/24pTY) – dave Mar 18 '22 at 20:26
  • This worked, but I had to do a `podman machine stop` and `podman machine start` for it to take effect. – montjoy Mar 03 '23 at 20:40
10

I have this problem I solve with this

After this all run correct

mkdir -p /Applications/Docker.app/Contents/Resources/cli-plugin

podman machine stop
podman machine rm -f
podman machine init --now
0

Unsetting the SSH_AUTH_SOCK might work if there is one set. For me it did not apply. I also removed and initiated a machine a few times, alas no success. I set the machine to run rootful and that did the trick for me

podman machine set --rootful
Petronella
  • 2,327
  • 1
  • 15
  • 24
0

Building upon Gineesh's answer, I also needed to set a default connection.

podman machine stop
podman system connection default podman-machine-default    
unset SSH_AUTH_SOCK
podman machine start
desa
  • 48
  • 8