containers / podman

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

compatibility with coreutils on apple silicon #12329

Closed etenzy closed 2 years ago

etenzy commented 2 years ago

/kind bug

Description

podman machine does not create/start when coreutils are installed on mac

Steps to reproduce the issue:

  1. brew install coreutils

  2. podman machine init

Describe the results you received:

Error: exit status 1

Describe the results you expected: podman machine to be initialized

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman --version:

podman version 3.4.2

Output of 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. failed to create sshClient: Connection to bastion host (ssh://core@localhost:54880/run/user/1000/podman/podman.sock) failed.: dial tcp [::1]:54880: connect: connection refused

Package info brew list:

ack         clusterctl      gh          icu4c           libcbor         libssh2         mpdecimal       perl            screenresolution    vde
ansible         composer        ghostscript     imagemagick     libde265        libtasn1        mycli           php         shared-mime-info    vim
aom         coreutils       giflib          imath           libevent        libtiff         ncurses         php@7.4         six         watch
apr         cowsay          git         iproute2mac     libffi          libtool         neofetch        pinentry        snappy          webp
apr-util        curl            git-lfs         jbig2dec        libfido2        libunistring        nettle          pixman          sops            wget
argon2          direnv          git-sizer       jpeg            libgcrypt       libusb          no-more-secrets     pkg-config      speedtest-cli       x265
asciinema       docbook         glab            jpeg-xl         libgpg-error        libuv           node            podman          sqlite          xmlto
aspell          docbook-xsl     glib            jq          libheif         libvmaf         npth            popeye          starship        xz
autoconf        docker-clean        gmp         jsonpp          libidn          libyaml         oniguruma       prettyping      subversion      yarn
awscli          figlet          gnu-getopt      k9s         libidn2         libzip          openexr         progress        telnet          yh
azure-cli       flux            gnupg           kind            libksba         little-cms2     openjdk         pv          terraform       youtube-dl
bdw-gc          fontconfig      gnutls          krb5            liblqr          lolcat          openjpeg        python-tabulate     the_silver_searcher zplug
berkeley-db     fortune         go          kubectx         libnghttp2      lua         openldap        python@3.10     tidy-html5      zsh
bfg         freetds         grep            kubelogin       libomp          lz4         openssh         python@3.9      tmux            zsh-autosuggestions
brew-gem        freetype        guile           kubernetes-cli      libpng          lzo         openssl@1.1     qemu            trivy           zsh-completions
brew-pip        gd          hcloud          kubeseal        libpq           m4          openstackclient     readline        unbound         zsh-syntax-highlighting
brotli          gdbm            helm            ldns            libslirp        mackup          p11-kit         rtmpdump        unixodbc        zstd
c-ares          gem-colorls     htop            less            libsodium       mas         pcre            ruby            up
ca-certificates     gettext         httpie          libassuan       libssh          minikube        pcre2           screen          utf8proc

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.):

MacBook Pro (14-inch, 2021) Chip: Apple M1 Pro Memory: 32 GB macOS Monterey: 12.0.1 (21A559)

Tested Workaround:

PATH=/bin:$PATH podman machine init

Possible causes: https://github.com/containers/podman/blob/8430ffc72e74f1271174984674a1c2ee6118779e/pkg/machine/qemu/options_darwin_arm64.go#L25-L29

baude commented 2 years ago

are you saying that podman machine failed to init? or subsequent podman commands do not work.

etenzy commented 2 years ago

podman machine fails to init because it calls dd on Apple silicon.

if coreutils are installed dd is linked to a GNU version of dd, which only accepts uppercase units which results in an error.

imho the solution would be to call the system dd directly via /bin/dd (see my pr)

afbjorklund commented 2 years ago

Installing GNU tools without the "g" prefix breaks all kinds of stuff

etenzy commented 2 years ago

Installing GNU tools without the "g" prefix breaks all kinds of stuff

right, that's a thing about how brew deals with coreutils... so i thought we could use the system's dd exclusively, because /bin/dd shouldn't go anywhere

rhatdan commented 2 years ago

Makes sense to me.