If a podman VM is created via libkrun
, all podman machine
commands stop working #9860
Description
Issue rewritten as per @cbr7 's request. Original bug report below.
Bug description
Since #8247 we can now select libkrun
as "Provider type" when creating a new Podman VM. This breaks everything using podman machine *
commands including Podman Desktop extensions like Red Hat Authenticator etc...
If an extension uses a podman machine
command under the hood, it is broken, since Podman Desktop doesn't propagate the CONTAINERS_MACHINE_PROVIDER
environment variable it used when creating the VM.
Steps to reproduce
Scenario "never leave Podman Desktop UI":
- Use Apple silicon Mac
- Use Podman Desktop to create a new podman machine VM
- Select
libkrun
when creating the machine - Wait for it to start
- I click a button in Podman Desktop to subscribe it to Red Hat subscription (via the Red Hat Authenticator plugin)
- See in Tasks that it fails with error 125.
merged.mp4
OR scenario "Follow Podman Desktop documentation":
We're following these 2 docs:
- https://podman-desktop.io/docs/podman/gpu (select MacOS tab)
- https://podman-desktop.io/docs/podman/adding-certificates-to-a-podman-machine
- Use Apple silicon Mac
- Use Podman Desktop to create a new podman machine VM
- Select
libkrun
when creating the machine - Wait for it to start
- Try
podman machine ssh
command - See error:
$ podman machine ssh
Error: vm podman-machine-default not found: podman-machine-default: VM does not exist
Additional context
A simple workaround is to either propagate CONTAINERS_MACHINE_PROVIDER
to .profile|.zshrc|.bashrc
or create/update ~/.config/containers/containers.conf
with:
[machine]
provider = "libkrun"
Ideal solution would be either guide user to do so when creating the Podman VM in Podman Desktop or do it for them.
Original Bug report below:
Bug description
Since #8247 we can now select libkrun
as "Provider type" when creating a new Podman VM. Selecting this option results in a properly working VM and podman with a single caveat - the podman machine *
commands do not work out of the box anymore while podman itself works just fine:
$ podman machine list
NAME VM TYPE CREATED LAST UP CPUS MEMORY DISK SIZE
$ podman machine ssh
Error: vm podman-machine-default not found: podman-machine-default: VM does not exist
$ podman run -it registry.access.redhat.com/ubi9/toolbox cat /etc/redhat-release
Red Hat Enterprise Linux release 9.4 (Plow)
The way how the PR mentioned above implemented the libkrun
option is that it uses an environment variable CONTAINERS_MACHINE_PROVIDER=libkrun
.
This environment variable is never propagated anywhere else besides the machine install workflow and the user is also not made aware they need to apply this change for their future CLI AND Podman Desktop use.
This missing env variable has unintended sideffects for Podman Desktop itself, or rather its extensions - like Red Hat Authentication plugin never working, since it relies on podman machine
commands behind the scenes to subscribe the machine.
Operating system
macOS M1
Installation Method
Installer from website/GitHub releases
Version
1.14.0
Steps to reproduce
- Use Apple silicon Mac
- Use Podman Desktop to create a new podman machine VM
- Select
libkrun
when creating the machine - Wait for it to start
- Try running
podman machine ssh
- it fails - Try running
podman machine list
- returns empty list
Relevant log output
Additional context
A simple workaround is to either propagate CONTAINERS_MACHINE_PROVIDER
to .profile|.zshrc|.bashrc
or create/update ~/.config/containers/containers.conf
with:
[machine]
provider = "libkrun"