Skip to content

If a podman VM is created via libkrun, all podman machine commands stop working #9860

Open
redhat-developer/podman-desktop-redhat-account-ext
#525
@tumido

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

  1. Use Apple silicon Mac
  2. Use Podman Desktop to create a new podman machine VM
  3. Select libkrun when creating the machine
  4. Wait for it to start
  5. I click a button in Podman Desktop to subscribe it to Red Hat subscription (via the Red Hat Authenticator plugin)
  6. See in Tasks that it fails with error 125.
merged.mp4

OR scenario "Follow Podman Desktop documentation":

We're following these 2 docs:

  1. Use Apple silicon Mac
  2. Use Podman Desktop to create a new podman machine VM
  3. Select libkrun when creating the machine
  4. Wait for it to start
  5. Try podman machine ssh command
  6. 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

  1. Use Apple silicon Mac
  2. Use Podman Desktop to create a new podman machine VM
  3. Select libkrun when creating the machine
  4. Wait for it to start
  5. Try running podman machine ssh - it fails
  6. 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"

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions