錯誤:qemu 意外退出,並顯示無法開啟 edk2-aarch64-code:沒有這樣的檔案或目錄

錯誤:qemu 意外退出,並顯示無法開啟 edk2-aarch64-code:沒有這樣的檔案或目錄

在brew升級後,podman機器不再工作。

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

我該如何修復這個錯誤?

答案1

問題是所使用的路徑對於配置的機器來說不正確。

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/

如果您編輯電腦的配置,您可以更新磁碟映像的路徑

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

尋找不正確的配置。

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",

編輯設定檔

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

將路徑更新為新的正確版本號。從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",

就我而言,我必須開始、停止並重新開始才能讓一切正常運作。

❯ 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

相關內容