0

After brew upgrade podman machine no longer works.

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/homebrew/Cellar/qemu/8.0.2/share/qemu/edk2-aarch64-code.fd,if=pflash,format=raw,readonly=on: Could not open '/opt/homebrew/Cellar/qemu/8.0.2/share/qemu/edk2-aarch64-code.fd': No such file or directory

How do I fix this error?

nelaaro
  • 13,149
  • 30
  • 84
  • 111

1 Answers1

1

The problem is that the path used is incorrect for the machine configured.

ls /opt/homebrew/Cellar/qemu/8.0.2/
ls: /opt/homebrew/Cellar/qemu/8.0.2/: No such file or directory

ls /opt/homebrew/Cellar/qemu/
8.0.3/

If you edit the config for your machine you can update the path to the disk images

podman machine inspect podman-machine-default | jq .[].ConfigPath
{
"Path": "/Users/aaron/.config/containers/podman/machine/qemu/podman-machine-default.json"
}

Find the configuration that is incorrect.

jq .CmdLine ~/.config/containers/podman/machine/qemu/podman-machine-default.json | grep qemu\/8
"file=/opt/homebrew/Cellar/qemu/8.0.2/share/qemu/edk2-aarch64-code.fd,if=pflash,format=raw,readonly=on",

Edit the config file

nvim ~/.config/containers/podman/machine/qemu/podman-machine-default.json

Update the path to the new correct version number. From 8.0.2 -> 8.0.3

jq .CmdLine ~/.config/containers/podman/machine/qemu/podman-machine-default.json | grep qemu\/8
"file=/opt/homebrew/Cellar/qemu/8.0.3/share/qemu/edk2-aarch64-code.fd,if=pflash,format=raw,readonly=on",

In my case, I had to start, stop and start again to get every thing working correctly.

❯ podman machine set --rootful

❯ podman machine start
Starting machine "podman-machine-default"
Waiting for VM ...
Mounting volume... /Users/aaron:/Users/aaron
Error: exit status 255

❯ podman machine list
NAME                    VM TYPE     CREATED      LAST UP            CPUS        MEMORY      DISK SIZE
podman-machine-default  qemu        4 weeks ago  Currently running  3           3.221GB     107.4GB

❯ podman machine stop
Waiting for VM to exit...
Machine "podman-machine-default" stopped successfully

❯ podman machine set --rootful

❯ podman machine start
Starting machine "podman-machine-default"
Waiting for VM ...
Mounting volume... /Users/aaron:/Users/aaron
Mounting volume... /private/tmp:/private/tmp
Mounting volume... /var/folders/:/var/folders/
API forwarding listening on: /var/run/docker.sock
Docker API clients default to this address. You do not need to set DOCKER_HOST.

Machine "podman-machine-default" started successfully
nelaaro
  • 13,149
  • 30
  • 84
  • 111
  • `Error: exit status 255`, has various causes and fixes https://github.com/containers/podman/issues/17403 – nelaaro Jul 13 '23 at 12:20
  • Is there a more robust way to do that? Changing the config every time I update qemu doesn't seem like a very good solution – Matt3o12 Jul 14 '23 at 08:21
  • @Matt3o12 file a bug with podman mac or brew package maintainer. To fix the updates to change the paths correctly – nelaaro Jul 14 '23 at 16:05