-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
podman machine
writes absolute QEMU path to the VM config
#13394
Comments
the path to qemu is discovered using FindExec at the time of init. So this is basically the same as using path at that time. It seems like you want to rediscover the qemu path each time we init, start, and stop? |
I'd prefer that it doesn't record the path to qemu at all and just always use |
@zowoq understood ... and I sincerely sympathize. here is the problem. In the past, we had bug reports that basically pleaded for the hardcoded path because other products had "side-installed" qemu for something else and they prepended that to the path, and that qemu failed to boot vms. in fact, i am considering doing the same but not prepending it to path. I will keep you in mind though and see if we can't make this work for everyone. |
I see From the same PR I see that some other paths are used on |
Yes, indeed. However, to make FindHelperBinary actually work, a change needs to be made in containers-common and be vendored through all of our container projects. I will create the PR for common once I am done getting the darwin mounting stuff working. very close now. |
@zowoq I created the following file under
Now podman writes the following path into the json: So you can just enter your |
@tricktron I'm trying to get this fixed for all nixpkgs users so they don't need to deal with manual configuration. |
Seems > where qemu-system-x86_64
qemu-system-x86_64 not found
> ./bin/darwin/podman machine rm --force
> CONTAINERS_HELPER_BINARY_DIR=/path/to/qemu_1 ./bin/darwin/podman machine init --now
> ./bin/darwin/podman machine stop
> rm -rf /path/to/qemu_1
> CONTAINERS_HELPER_BINARY_DIR=/path/to/qemu_2 ./bin/darwin/podman machine start
|
How about keeping the hardcoded path but in case the binary is no longer there still fall back to the same detection logic as for machine init. |
An improvement as it would avoid the breakage from the example in the top post but it is still rather problematic for us. Since I opened this issue the |
I think this is the best we can get: #13620 |
We store the full path to qemu in the machine config. When the path changes on the host the machine can longer be started. To fix it we get the path again when we fail to start the machine due the missing binary. We want to store and use the full path first because otherwise existing machines can break when the qemu version changed. [NO NEW TESTS NEEDED] We still have no machine tests. Fixes containers#13394 Signed-off-by: Paul Holzinger <[email protected]>
Is it not possible to have it always use the |
@Luap99 Should I open a new issue for this? |
Well the idea is to keep the behaviour as @baude said. First use the path which was used for init. Isn't this something you could patch downstream, this problems looks very nixos specific. |
I don't see how an env var being disregarded on subsequent invocations of We'd have to carry and rebase a patch forever for something that seems like it would be a relatively simple fix upstream? e.g. If |
I understand that. To this specific issue, are you proposing to first check the env var, use qemu from there when available, if not use stored path from config. If still not found fall back to full helper binaries in containers.conf and path? I guess that would work but it is a bit ugly because we would need to check the env var extra. To me this looks like a general problem with nix, if you keep you old qemu around why should it use the new one at a different path. I am really missing the concept here, why would the same package be installed with different version at different paths. Also note that FindHelperBinary() is called with true as second argument so you can already use $PATH for qemu. |
TBH I'd be very happy if
Yes, that would work.
We aren't choosing to keep it around and it isn't actually installed,
Afraid I don't understand what you mean with this. |
The function already looks in $PATH so I am not sure why you use |
$PATH not working because of recording the full path is why I originally opened the issue. I would like for
No it does not work. That is why I'm asking for this:
|
We store the full path to qemu in the machine config. When the path changes on the host the machine can longer be started. To fix it we get the path again when we fail to start the machine due the missing binary. We want to store and use the full path first because otherwise existing machines can break when the qemu version changed. [NO NEW TESTS NEEDED] We still have no machine tests. Fixes containers#13394 Signed-off-by: Paul Holzinger <[email protected]>
If there was some way for us to tell podman where qemus edk2 path was so non standard install setups will still function that would be great. Right now podman on darwin at least assumes that you have either installed qemu from source with standard install locations or that you installed via non-local brew. I have in the past done local brew installs as well as installed stuff in local only paths. podman won't work in those circumstances. |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Using an absolute path is a bit problematic for
nixpkgs
as the QEMU written to the config might not be the same as the QEMU currently in the users PATH or it may have been removed which then causes an error.Output of
podman version
:The text was updated successfully, but these errors were encountered: