Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No path provided for ovmf_vars file in QEMU config with podman machine #20361

Closed
davidchisnall opened this issue Oct 14, 2023 · 0 comments · Fixed by #20400
Closed

No path provided for ovmf_vars file in QEMU config with podman machine #20361

davidchisnall opened this issue Oct 14, 2023 · 0 comments · Fixed by #20400
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@davidchisnall
Copy link

Issue Description

podman machine init on macOS (Apple Silicon, QEMU provider) results in the following line in the config:

  "file=podman-machine-default_ovmf_vars.fd,if=pflash,format=raw",

This then fails to start because podman-machine-default_ovmf_vars.fd is in .local/share/containers/podman/machine/qemu, which is not the working directory when qemu is launched.

$ podman -v
podman version 4.8.0-dev

Commit is: b5fec41

Steps to reproduce the issue

Steps to reproduce the issue

  1. Run podman machine init --now

Describe the results you received

The command exits during the start phase with:

Error: qemu exited unexpectedly with exit code 1, stderr: qemu-system-aarch64: -drive file=podman-machine-default_ovmf_vars.fd,if=pflash,format=raw: Could not open 'podman-machine-default_ovmf_vars.fd': No such file or directory

Describe the results you expected

The VM to start.

podman info output

OS: darwin/arm64
provider: qemu
version: 4.8.0-dev

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

Yes

Additional environment details

No response

Additional information

The issue appears to be because addArchOptions in the qemu provider (pkg/machine/qemu/options_darwin_arm64.go) is called from setNewMachineCMD (pkg/machine//qemu/config.go) early on. This expects to create the option based on the path of the image file, but the path of the image file has not yet been set and is "testing".

It is set by the time that the file is created, in prepare and so the file is created in the correct location, it just isn't referenced with a full path.

I am not sure what the right fix is here, I suspect it's either:

  • Set the flag in prepare, when the file is created.
  • Defer the adding arch options step until later when the image path is set.

I am not quite sufficiently familiar with the structure of this code yet to make either change and be sure that I haven't broken something else.

@davidchisnall davidchisnall added the kind/bug Categorizes issue or PR as related to a bug. label Oct 14, 2023
@baude baude self-assigned this Oct 14, 2023
baude added a commit to baude/podman that referenced this issue Oct 18, 2023
On darwin arm64, we need to set the location of the ovmf vars. It should be put into the imageDir (also known as as dataDir).  But because qemu determines the image path late in Init(), the image path is set something like a stream marker.

Fixes containers#20361

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Jan 17, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants