podman 机器 - 无法连接到 MacOS 上的 Podman

Gin*_*esh 18 containers podman

更新:已解决,请查看答案。

\n

podman在 MacOS 上使用podman machine,现在podman无法连接到podman machine.

\n

(它之前可以工作,但不确定新的 macOS 版本导致了该问题)

\n

MacOS 蒙特利 (12.1)

\n
$ podman machine init\nExtracting compressed file\n\n$ podman machine start\nINFO[0000] waiting for clients...                       \nINFO[0000] listening tcp://127.0.0.1:7777               \nINFO[0000] new connection from  to /var/folders/8f/v0tpqxg56wsf9x6x6tntjt5h0000gn/T/podman/qemu_podman-machine-default.sock \nWaiting for VM ...\nMachine "podman-machine-default" started successfully\n\n$ podman machine ls\nNAME                     VM TYPE     CREATED             LAST UP            CPUS        MEMORY      DISK SIZE\npodman-machine-default*  qemu        About a minute ago  Currently running  1           2.147GB     10.74GB\n\n$ podman version\nCannot 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\nError: unable to connect to Podman. failed to create sshClient: dial unix /private/tmp/com.apple.launchd.WAh1QMSoLg/Listeners: connect: no such file or directory\n\n$ podman ps\nCannot 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\nError: unable to connect to Podman. failed to create sshClient: dial unix /private/tmp/com.apple.launchd.WAh1QMSoLg/Listeners: connect: no such file or directory\n\n$ podman run -dt -p 8080:80 nginx\nCannot 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\nError: unable to connect to Podman. failed to create sshClient: dial unix /private/tmp/com.apple.launchd.WAh1QMSoLg/Listeners: connect: no such file or directory\n\n$ podman --log-level=debug version\nINFO[0000] podman filtering at log level debug          \nDEBU[0000] Called version.PersistentPreRunE(podman --log-level=debug version) \nDEBU[0000] SSH Ident Key "/Users/gini/.ssh/podman-machine-default" SHA256:duxS/j3bzl90jSUtbXVIofL4O+FqZ5sUL63c26u2gdo ssh-ed25519 \nDEBU[0000] Found SSH_AUTH_SOCK "/private/tmp/com.apple.launchd.WAh1QMSoLg/Listeners", ssh-agent signer(s) enabled \nCannot 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\nError: unable to connect to Podman. failed to create sshClient: dial unix /private/tmp/com.apple.launchd.WAh1QMSoLg/Listeners: connect: no such file or directory\n
Run Code Online (Sandbox Code Playgroud)\n

描述您期望的结果:

\n

期望获得podman版本等信息。

\n

包裹信息:

\n
$ brew info podman\npodman: stable 3.4.4 (bottled), HEAD\nTool for managing OCI containers and pods\nhttps://podman.io/\n/usr/local/Cellar/podman/3.4.4 (170 files, 40MB) *\n  Poured from bottle on 2021-12-29 at 21:51:28\nFrom: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/podman.rb\nLicense: Apache-2.0\n==> Dependencies\nBuild: go \xe2\x9c\x98, go-md2man \xe2\x9c\x98\nRequired: qemu \xe2\x9c\x94\n==> Options\n--HEAD\n        Install HEAD version\n==> Caveats\nzsh completions have been installed to:\n  /usr/local/share/zsh/site-functions\n==> Analytics\ninstall: 11,107 (30 days), 38,817 (90 days), 78,249 (365 days)\ninstall-on-request: 11,111 (30 days), 38,825 (90 days), 78,240 (365 days)\nbuild-error: 2 (30 days)\n
Run Code Online (Sandbox Code Playgroud)\n
$ sw_vers \nProductName:    macOS\nProductVersion: 12.1\nBuildVersion:   21C52\n
Run Code Online (Sandbox Code Playgroud)\n

Gin*_*esh 13

感谢Luap99

podman 尝试连接到该$SSH_AUTH_SOCK地址,但失败。

执行以下命令,问题解决。

unset SSH_AUTH_SOCK
Run Code Online (Sandbox Code Playgroud)


小智 12

我有这个问题我用这个解决

之后一切运行正确

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

podman machine stop
podman machine rm -f
podman machine init --now
Run Code Online (Sandbox Code Playgroud)


小智 5

根据 Gineesh 的回答,我还需要设置默认连接。

podman machine stop
podman system connection default podman-machine-default    
unset SSH_AUTH_SOCK
podman machine start
Run Code Online (Sandbox Code Playgroud)