podman: `podman machine init` fails on M1 Macbook Air with exit status 1
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Steps to reproduce the issue:
- Run
brew install podman && podman machine initon M1 Macbook Air
Describe the results you received:
$ podman machine init
Extracting compressed file
Error: exit status 1
I don’t see any flags increasing verbosity for the machine init command.
Subsequent call results in:
$ podman machine init
Error: podman-machine-default: VM already exists
Trying to start the machine:
$ podman machine start
INFO[0000] waiting for clients...
INFO[0000] listening tcp://0.0.0.0:7777
INFO[0000] new connection from to /var/folders/f8/n4kgy1dd4qn0lwrfjp66g0p80000gn/T/podman/qemu_podman-machine-default.sock
Waiting for VM ...
qemu-system-aarch64: -drive file=/Users/kopiczko/.local/share/containers/podman/machine/qemu/podman-machine-default_ovmf_vars.fd,if=pflash,format=raw: Could not open '/Users/kopiczko/.local/share/containers/podman/machine/qemu/podman-machine-default_ovmf_vars.fd': No such file or directory
Error: dial unix /var/folders/f8/n4kgy1dd4qn0lwrfjp66g0p80000gn/T/podman/podman-machine-default_ready.sock: connect: connection refused
ERRO[0003] cannot receive packets from , disconnecting: cannot read size from socket: EOF
ERRO[0003] cannot read size from socket: EOF
Trying to SSH:
$ podman machine ssh
Error: "podman-machine-default" service destination not found
When deleting:
$ podman machine rm
The following files will be deleted:
/Users/kopiczko/.ssh/podman-machine-default
/Users/kopiczko/.ssh/podman-machine-default.pub
/Users/kopiczko/.config/containers/podman/machine/qemu/podman-machine-default.ign
/Users/kopiczko/.local/share/containers/podman/machine/qemu/podman-machine-default_fedora-coreos-35.20211029.2.0-qemu.aarch64.qcow2
/Users/kopiczko/.local/share/containers/podman/machine/qemu/podman-machine-default_ovmf_vars.fd
/Users/kopiczko/.config/containers/podman/machine/qemu/podman-machine-default.json
Are you sure you want to continue? [y/N] y
ERRO[0001] remove /Users/kopiczko/.config/containers/podman/machine/qemu/podman-machine-default.ign: no such file or directory
ERRO[0001] remove /Users/kopiczko/.local/share/containers/podman/machine/qemu/podman-machine-default_ovmf_vars.fd: no such file or directory
Describe the results you expected:
Having running usable podman VM on Apple Silicon.
Additional information you deem important (e.g. issue happens only occasionally):
N/A
Output of podman version:
$ podman -v
podman version 3.4.2
podman version errors because it can’t connect to the vm:
$ 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 socket: Get "http://d/v3.4.2/libpod/_ping": dial unix ///var/folders/f8/n4kgy1dd4qn0lwrfjp66g0p80000gn/T/podman-run--1/podman/podman.sock: connect: no such file or directory
Output of podman info --debug:
$ podman info --debug
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: Get "http://d/v3.4.2/libpod/_ping": dial unix ///var/folders/f8/n4kgy1dd4qn0lwrfjp66g0p80000gn/T/podman-run--1/podman/podman.sock: connect: no such file or directory
Package info (e.g. output of rpm -q podman or apt list podman):
$ brew info podman
podman: stable 3.4.2 (bottled), HEAD
Tool for managing OCI containers and pods
https://podman.io/
/opt/homebrew/Cellar/podman/3.4.2 (170 files, 40.9MB) *
Poured from bottle on 2021-11-20 at 23:09:16
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:
/opt/homebrew/share/zsh/site-functions
==> Analytics
install: 13,187 (30 days), 39,480 (90 days), 67,327 (365 days)
install-on-request: 13,191 (30 days), 39,484 (90 days), 67,268 (365 days)
build-error: 0 (30 days)
Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
$ uname -a
Darwin pawel-air 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:24 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T8101 arm64 arm64 MacBookAir10,1 Darwin
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 6
- Comments: 28 (8 by maintainers)
I was having the same problem. My guess is that since my podman machine(along with the entire brew apps stack) is migrated from old Intel MacBook, so the image was Intel based, on which the Qemu bin was located in
/usr/local/bin. My solution was simply removing the old machine and creating a new one.Everything works like a charm.
I got it working now as well, but with a slightly different approach I added this dir as a helper binary. Don’t quite remember if that was for gvproxy or something else to be picked up correctly.
~/.config/containers/containers.confAlso changed the actual machines qemu config so that the file it looks for uses a abs path
~/.config/containers/podman/machine/qemu/podman-machine-default.jsonSo this is also not a very good solution, hehe.
@baude do you know if there is a way to set some location for qemu to look for the edk2-file in similar to the helper_binaries_dir? Then maybe one could do something in the nix derivation in order to fix it. Not sure if this is possible or a good idea though
Confirmed. Everything works with
PATH=/bin:$PATH podman.Removing
/opt/homebrew/opt/coreutils/libexec/gnubinfrom my$PATH(then apodman machine rmfirst) fixes the issue withpodman machine initfor me.@baude apologies, I deleted my comment and later noticed your reply; you’re basically correct. My issue was that I had very recently migrated from an Intel Mac and hadn’t set up the separate aarch64 Homebrew install - so I ended up with x86_64 copies of qemu and podman. Everything worked once I corrected that, so my issue wasn’t the one described here.