Closed kopiczko closed 2 years ago
Same error. Podman 3.4.2, nixpkgs, macos 12.0.1, m1 air.
@ashley-cui @baude PTAL
acui@Ashleys-Mac-mini podman % 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/zn/tds5mhcn3t14vhxc8jyvm4p40000gn/T/podman/qemu_podman-machine-default.sock
Waiting for VM ...
Machine "podman-machine-default" started successfully
acui@Ashleys-Mac-mini podman % brew info podman
podman: stable 3.4.2 (bottled), HEAD
It's working for me, but I'm on Darwin Kernel Version 20.6.0. Let me update the the mac and see if it still works
The failure is with podman machine init
not podman machine start
. If init failed start cannot work. Is this the same issue as https://github.com/containers/podman/issues/12329?
Ah sorry forgot to copy all the lines from my terminal, but init works as well for me. Let me try installing coreutils and seeing if that breaks anything...
Update: Still unable to reproduce:
acui@Ashleys-Mini podman % brew install coreutils
==> Downloading https://ghcr.io/v2/homebrew/core/coreutils/manifests/9.0
######################################################################## 100.0%
acui@Ashleys-Mini podman % podman machine init
Extracting compressed file
acui@Ashleys-Mini podman %
@kopiczko, can you do a podman --log-level=debug machine init
and a brew list
?
$ uname -a Darwin squirrel 21.0.1 Darwin Kernel Version 21.0.1: Tue Sep 14 20:56:24 PDT 2021; root:xnu-8019.30.61~4/RELEASE_ARM64_T6000 x86_64 $ podman --version podman version 3.4.2
I think your problem might be related to having rosetta installed? I believe I saw this once before where brew got confused or something confused brew about what architecture it was on.
@kopiczko can you verify that the path that is being reported in the error actually exists?
@baude I run it, if it helps. I'm using nix, not brew though, but i reproduced every step and i have 1:1 problem.
$ nix-env -q --meta --json podman
{
"1": {
"name": "podman-3.4.1",
"pname": "podman",
"version": "3.4.1",
"system": "aarch64-darwin",
"meta": {
"available": true,
"broken": false,
"changelog": "https://github.com/containers/podman/blob/v3.4.1/changelog.txt",
"description": "A program for managing pods, containers and container images",
"homepage": "https://podman.io/",
"insecure": false,
"license": {
"deprecated": false,
"free": true,
"fullName": "Apache License 2.0",
"redistributable": true,
"shortName": "asl20",
"spdxId": "Apache-2.0",
"url": "https://spdx.org/licenses/Apache-2.0.html"
}
...
$ nix-env -q --meta --json gvproxy
{
"0": {
"name": "gvproxy-0.2.0",
"pname": "gvproxy",
"version": "0.2.0",
"system": "aarch64-darwin",
"meta": {
"available": true,
"broken": false,
"description": "Network stack based on gVisor",
"homepage": "https://github.com/containers/gvisor-tap-vsock",
"insecure": false,
"license": {
"deprecated": false,
"free": true,
"fullName": "Apache License 2.0",
"redistributable": true,
"shortName": "asl20",
"spdxId": "Apache-2.0",
"url": "https://spdx.org/licenses/Apache-2.0.html"
}
...
I'm sorry, there was something wrong with data i sent before.
$ podman --log-level=debug machine init
INFO[0000] podman filtering at log level debug
Extracting compressed file
$ 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/f1/lcg51mqj797bj4nvq9y4lbd80000gn/T/podman/qemu_podman-machine-default.sock
Waiting for VM ...
qemu-system-aarch64: -drive file=edk2-aarch64-code.fd,if=pflash,format=raw,readonly=on: Could not open 'edk2-aarch64-code.fd': No such file or directory
Error: dial unix /var/folders/f1/lcg51mqj797bj4nvq9y4lbd80000gn/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
@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.
Thanks @Luap99 I think it's https://github.com/containers/podman/issues/12329 as I have coreutils
installed and PATH
changed on my machine. From my POV the fix looks good but I'm not sure if it will work with the nix setup mentioned by @DesantBucie. Waiting for the new release. I could try installing the latest main if there are instructions how to do so on MacOS.
Answering other questions just in case:
@ashley-cui --log-level=debug
doesn't show much more information:
$ podman --log-level=debug machine init
INFO[0000] podman filtering at log level debug
Downloading VM image: fedora-coreos-35.20211119.2.0-qemu.aarch64.qcow2.xz: done
Extracting compressed file
Error: exit status 1
@baude just in case:
$ ls /Users/kopiczko/.local/share/containers/podman/machine/qemu/podman-machine-default_ovmf_vars.fd
ls: cannot access '/Users/kopiczko/.local/share/containers/podman/machine/qemu/podman-machine-default_ovmf_vars.fd': No such file or directory
Not sure if I'm seeing the same or similar problem. I also had coreutils
installed and setup in a way that every GNU tool from homebrew would be found first in my path, including but not limited to dd
. I switched back to a more stock path to test.
#-❯ export "PATH=/opt/homebrew/sbin:/usr/local/sbin:/usr/sbin:/sbin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin"
#-❯ podman --version
podman version 3.4.2
#-❯ podman --log-level=debug machine init
INFO[0000] podman filtering at log level debug
Extracting compressed file
Error: cannot overwrite connection
#-❯ podman --log-level=debug machine list
INFO[0000] podman filtering at log level debug
NAME VM TYPE CREATED LAST UP CPUS MEMORY DISK SIZE
#-❯ ls -lh ~/.local/share/containers/podman/machine/qemu/
total 4263152
-rw-rw-r-- 1 danial.pearce staff 581M 1 Dec 12:33 fedora-coreos-35.20211119.2.0-qemu.aarch64.qcow2.xz
-rw------- 1 danial.pearce staff 1.4G 1 Dec 12:40 podman-machine-default_fedora-coreos-35.20211119.2.0-qemu.aarch64.qcow2
#-❯ file ~/.local/share/containers/podman/machine/qemu/*
/Users/danial.pearce/.local/share/containers/podman/machine/qemu/fedora-coreos-35.20211119.2.0-qemu.aarch64.qcow2.xz: XZ compressed data
/Users/danial.pearce/.local/share/containers/podman/machine/qemu/podman-machine-default_fedora-coreos-35.20211119.2.0-qemu.aarch64.qcow2: QEMU QCOW2 Image (v3), 10737418240 bytes
#-❯ brew --version
Homebrew 3.3.6
Homebrew/homebrew-core (git revision 267622f7344; last commit 2021-11-30)
Homebrew/homebrew-cask (git revision 3bbdbbf987; last commit 2021-12-01)
#-❯ brew list
==> Formulae
aom freeimage jbig2dec libtiff openjpeg shush
autoconf freetype jpeg libtool openldap six
automake gawk jpeg-xl libunistring openssl@1.1 snappy
awscli gdbm jq libusb p11-kit sqlite
bash gettext krb5 libuv pcre tcl-tk
bdw-gc gh less libvmaf pcre2 telnet
berkeley-db ghostscript libassuan libyaml perl the_silver_searcher
binutils giflib libde265 little-cms2 pinentry unbound
bison git libevent lua pixman unzip
bk glib libffi lz4 pkg-config vde
brotli gmp libgcrypt lzo podman vim
buildkite-agent gnu-getopt libgpg-error m4 popt webp
c-ares gnu-indent libheif make postgresql wget
ca-certificates gnu-sed libidn mpdecimal postgresql@13 x265
chruby gnu-tar libidn2 mpfr pv xmlto
coreutils gnu-which libksba ncurses python@3.9 xxhash
curl gnupg liblqr nettle qemu xz
diffutils gnutls libnghttp2 ninja rea-as zip
docbook grep libomp node readline zlib
docbook-xsl guile libpng npth rsync zstd
docker-credential-helper-ecr gzip libslirp ntfs-3g-mac rtmpdump
expect icu4c libssh nvm ruby
findutils imagemagick libssh2 oniguruma ruby-install
fontconfig imath libtasn1 openexr shared-mime-info
==> Casks
graphiql macfuse visual-studio-code
From my POV the fix looks good but I'm not sure if it will work with the nix setup mentioned by @DesantBucie.
No it probably won't as I think nix installs coreutils as a dependency.
Removing /opt/homebrew/opt/coreutils/libexec/gnubin
from my $PATH
(then a podman machine rm
first) fixes the issue with podman machine init
for me.
Confirmed. Everything works with PATH=/bin:$PATH podman
.
It'd be nice if podman supported GNU Coreutils on mac, or at least documented that it didn't/gave a better error. That said, I imagine this doesn't need to be run often, so the workaround is effective for now.
@DesantBucie did you manage to get a working Nix setup for this? I get the same error as you had above only I am running the ´podman machine start´ command
@momrak Not at all. I also tried to download from release, but it's the same error.
└─> 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/f1/lcg51mqj797bj4nvq9y4lbd80000gn/T/podman/qemu_podman-machine-default.sock
Waiting for VM ...
qemu-system-aarch64: -drive file=edk2-aarch64-code.fd,if=pflash,format=raw,readonly=on: Could not open 'edk2-aarch64-code.fd': No such file or directory
Error: dial unix /var/folders/f1/lcg51mqj797bj4nvq9y4lbd80000gn/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
@momrak It actually looks like issue with nix version of qemu rather than podman. Although i don't know how exactly but i did it.
Steps to reproduce
cd /nix/store/*qemu-6.1.0/share/qemu
sudo mkdir -p /usr/local/share/qemu/
sudo mkdir -p /opt/homebrew/share/qemu/
cp edk2-aarch64-code.fd /usr/local/share/qemu
cp edk2-aarch64-code.fd /opt/homebrew/share/qemu
cd ~/.local/share/
rm -rf containers
Not really beautiful but it works :v. Also you probably need to install gvproxy
if you hadn't already.
m1's require a patched version of qemu in brew for a little while. if you have a different version of qemu installed, it is likely the issue
Thank you both @baude and @DesantBucie
@DesantBucie nice! So you only used the default qemu from nix, not a patched one from brew or similar?
Do you know if the patch is only present in the brew version of this @baude ? In that case it could have been interesting to try and make the same patch available for m1 macs using nix
@DesantBucie nice! So you only used the default qemu from nix, not a patched one from brew or similar?
I used qemu 6.1.0, gvproxy 0.3 and podman 3.4.4 all from unstable channel.
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.conf
...
[engine]
helper_binaries_dir = ["/Users/momrak/.nix-profile/bin"]
...
Also 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.json
...
"file=/nix/store/sbjkaks28979lannj9a2mi5s8v7fchi1-qemu-6.1.0/share/qemu/edk2-aarch64-code.fd,if=pflash,format=raw,readonly=on"
...
So 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
There is not a way to do this currently in podman.
Why is this issue closed when it isn't fixed? I'm running M1 Max, installed podman as usual, podman machine init
works fine and the container is listed. However, I can't make it run. I couldn't find a cohesive answer as to why that is since M1 is already officially supported by podman. Thanks for any feedback.
➜ ~ podman --log-level=debug machine start
INFO[0000] podman filtering at log level debug
DEBU[0000] [/usr/local/bin/qemu-system-x86_64 -m 2048 -smp 1 -fw_cfg name=opt/com.coreos/config,file=/Users/mkrasa/.config/containers/podman/machine/qemu/podman-machine-default.ign -qmp unix://var/folders/_r/ym4h63j94l7b305575s09q200000gq/T/podman/qmp_podman-machine-default.sock,server=on,wait=off -netdev socket,id=vlan,fd=3 -device virtio-net-pci,netdev=vlan,mac=5a:94:ef:e4:0c:ee -device virtio-serial -chardev socket,path=/var/folders/_r/ym4h63j94l7b305575s09q200000gq/T/podman/podman-machine-default_ready.sock,server=on,wait=off,id=podman-machine-default_ready -device virtserialport,chardev=podman-machine-default_ready,name=org.fedoraproject.port.0 -machine q35,accel=tcg -cpu host -drive if=virtio,file=/Users/mkrasa/.local/share/containers/podman/machine/qemu/podman-machine-default_fedora-coreos-35.20220103.2.0-qemu.x86_64.qcow2]
[/usr/local/opt/podman/libexec/gvproxy -listen tcp://127.0.0.1:7777 -listen-qemu unix:///var/folders/_r/ym4h63j94l7b305575s09q200000gq/T/podman/qemu_podman-machine-default.sock -pid-file /var/folders/_r/ym4h63j94l7b305575s09q200000gq/T/podman/podman-machine-default.pid -ssh-port 53754 --debug]
INFO[0000] waiting for clients...
INFO[0000] listening tcp://127.0.0.1:7777
DEBU[0000] [/usr/local/bin/qemu-system-x86_64 -m 2048 -smp 1 -fw_cfg name=opt/com.coreos/config,file=/Users/mkrasa/.config/containers/podman/machine/qemu/podman-machine-default.ign -qmp unix://var/folders/_r/ym4h63j94l7b305575s09q200000gq/T/podman/qmp_podman-machine-default.sock,server=on,wait=off -netdev socket,id=vlan,fd=3 -device virtio-net-pci,netdev=vlan,mac=5a:94:ef:e4:0c:ee -device virtio-serial -chardev socket,path=/var/folders/_r/ym4h63j94l7b305575s09q200000gq/T/podman/podman-machine-default_ready.sock,server=on,wait=off,id=podman-machine-default_ready -device virtserialport,chardev=podman-machine-default_ready,name=org.fedoraproject.port.0 -machine q35,accel=tcg -cpu host -drive if=virtio,file=/Users/mkrasa/.local/share/containers/podman/machine/qemu/podman-machine-default_fedora-coreos-35.20220103.2.0-qemu.x86_64.qcow2]
INFO[0000] new connection from to /var/folders/_r/ym4h63j94l7b305575s09q200000gq/T/podman/qemu_podman-machine-default.sock
Waiting for VM ...
qemu-system-x86_64: CPU model 'host' requires KVM or HVF
Error: dial unix /var/folders/_r/ym4h63j94l7b305575s09q200000gq/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
@michaelkrasa This is probably due to running qemu x86-64 instead of aarch64.
I had this issue when running qemu from pkgsrc.
brew install simnalamburt/x/podman-apple-silicon
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.
podman machine rm
podman machine init
Everything works like a charm.
It just never works, no matter what I try :(
jwildeboer@JHWMBA ~ % brew remove podman-desktop
==> Uninstalling Cask podman-desktop
==> Backing App 'Podman Desktop.app' up to '/opt/homebrew/Caskroom/podman-deskto
==> Removing App '/Applications/Podman Desktop.app'
==> Purging files for version 0.9.1 of Cask podman-desktop
jwildeboer@JHWMBA ~ % brew remove podman
Uninstalling /opt/homebrew/Cellar/podman/4.3.0... (185 files, 47.6MB)
jwildeboer@JHWMBA ~ % brew install podman
==> Downloading https://ghcr.io/v2/homebrew/core/podman/manifests/4.3.0
Already downloaded: /Users/jwildeboer/Library/Caches/Homebrew/downloads/7360bf1699dcbb76150aea89eec8489fa47159edb55acd441ef406cb3a9eca99--podman-4.3.0.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/podman/blobs/sha256:1d00923c766
Already downloaded: /Users/jwildeboer/Library/Caches/Homebrew/downloads/0d6c8046b07544b0baf47ec94a54f757a02a634bbd4529bbd9b6c10aadc2c608--podman--4.3.0.arm64_ventura.bottle.tar.gz
==> Pouring podman--4.3.0.arm64_ventura.bottle.tar.gz
==> Caveats
zsh completions have been installed to:
/opt/homebrew/share/zsh/site-functions
To restart podman after an upgrade:
brew services restart podman
Or, if you don't want/need a background service you can just run:
/opt/homebrew/opt/podman/bin/podman system service --time=0
==> Summary
🍺 /opt/homebrew/Cellar/podman/4.3.0: 185 files, 47.6MB
==> Running brew cleanup podman
...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see man brew
).
jwildeboer@JHWMBA ~ % brew services restart podman
==> Tapping homebrew/services
Cloning into '/opt/homebrew/Library/Taps/homebrew/homebrew-services'...
remote: Enumerating objects: 2233, done.
remote: Counting objects: 100% (167/167), done.
remote: Compressing objects: 100% (62/62), done.
remote: Total 2233 (delta 120), reused 112 (delta 105), pack-reused 2066
Receiving objects: 100% (2233/2233), 614.54 KiB | 6.61 MiB/s, done.
Resolving deltas: 100% (1000/1000), done.
Tapped 1 command (45 files, 773.1KB).
==> Successfully started podman
(label: homebrew.mxcl.podman)
jwildeboer@JHWMBA ~ % podman machine init
Extracting compressed file
Error: cannot overwrite connection
jwildeboer@JHWMBA ~ %
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Steps to reproduce the issue:
brew install podman && podman machine init
on M1 Macbook AirDescribe the results you received:
I don't see any flags increasing verbosity for the
machine init
command.Subsequent call results in:
Trying to start the machine:
Trying to SSH:
When deleting:
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 version
errors because it can't connect to the vm:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):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.):