Help installing podman under MacOS

Hi, first time user here, and need help installing podman.

So I tried the nix-shell -p podman as recommended from the web page, but there are two problems.

  • the web page NixOS Search says the poman is of version: 4.7.2, however this is what I got:
$ nix-channel --list
nixpkgs https://nixos.org/channels/nixpkgs-stable

$ podman --version
podman version 4.8.2

and that version 4.8.2 should be only for unstable, as per NixOS Search.

BTW, I tried to swtich from the unstable channel to stable myself, and seem the above url is incorrect, as I’m getting:

$ nix-channel --update
error: unable to download 'https://nixos.org/channels/nixpkgs-stable': HTTP error 404

       response body:

       <html>
       <head><title>404 Not Found</title></head>
       <body>
       <h1>404 Not Found</h1>
       <ul>
       <li>Code: NoSuchKey</li>
       <li>Message: The specified key does not exist.</li>
       <li>Key: nixpkgs-stable</li>
       <li>RequestId: XHD9X2ZFQN8448XS</li>
       <li>HostId: M5/p9hEqHdctcSUP2YYXJYptZjv9of+0wD3wequoN/iUWJ2onDNu9SCh6oUX5At8VLyVL/iPrS8=</li>
       ...
  • the second problem I have is that installing podman with either homebrew or macports will install its dependencies automatically, however I found that installing podman with nix won’t – the qemu package is not auto-installed. I’m wondering it is nix’s “feature”, or the podman package’s problem.

UPDATE:

So I was trying to install the missing qemu package myself, and I’ve tried all the following commands, but they all end up with error message somehow:

nix-shell -p podman nixpkgs.qemu_full
nix-shell -p podman qemu_full
nix-shell -p podman ubootQemuAarch64
NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-shell -p podman ubootQemuAarch64

All in all, I want a working stable podman, please help this clueless poor guy. thx.

nixpkgs-stable is not a real channel. This is the list of available channels: https://channels.nixos.org/

You probably want:

nix-channel --add https://channels.nixos.org/nixpkgs-23.11 nixpkgs
nix-channel --update

That’s why you’re getting the error. You’re also likely getting the unstable version of podman because you haven’t been able to update your channels since switching to a nonexistent channel.

Well, its “dependencies” should be installed properly by nix. What might not be installed are things like system daemons, which homebrew & co can install (because they’re specifically designed to make services run inside MacOS, while nix and nixpkgs are largely not, they just build binaries that can run on most unixes - that doesn’t mean the software will be installed according to how the unix flavor wants things to be installed, for that you need nix-darwin), but afaik podman can run in user-only mode without needing any background services or setuid binaries or anything, so this should usually not be an issue.

Why exactly do you think the dependencies are not installed?

Oh, thanks for the reply. Please see my updated OP. thx.

Starting from scratch, this is all that I’m trying now under my MacOS:

nix-channel --add https://nixos.org/channels/nixpkgs-23.11-darwin
nix-channel --update

so far so good, but then,

nix-shell -p podman qemu_full
NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-shell -p podman qemu_full

they both end up with error message one way or another.

UPDATE:

I finally found a way to start nix-shell without any errors, but was stopped at next step:

nix-shell -p podman qemu edk2

[nix-shell:~]$ podman machine start
Starting machine "podman-machine-default"
Waiting for VM ...
Error: qemu exited unexpectedly with exit code 1, stderr: qemu-system-aarch64: -drive file=/opt/local/share/qemu/edk2-aarch64-code.fd,if=pflash,format=raw,readonly=on: Could  not open '/opt/local/share/qemu/edk2-aarch64-code.fd': No such file or directory

UPDATE2:

found a “solution” for the above problem,

https://github.com/containers/podman/issues/17026#issuecomment-1520815934

But everything mentioned there are Greek to me, and I have no idea what the fixes should be. thx for your help.