I wanted to introduce a significant change we are making in Podman 6 for our machine function. To understand the problem and change, we first need to establish that Podman machine is based on a concept of providers. The provider is a generic term that describes how Podman runs the Linux virtual machine. The following table is a list of providers by platform.
| Platform | Supported Providers |
| Windows | WSL1 |
| HyperV | |
| Linux | QEMU1 |
| MacOS | Libkrun1 |
| Applehv2 |
1 default for platforms for Podman 6
2 default for Podman 5
In Podman 5, particularly with the use of Podman Desktop and with platforms that supported multiple providers, it was possible to create machines for either provider without changing the default provider as defined in ~/.config/containers/containers.conf. So if you created or ran a machine in the non-default provider with Podman Desktop and then decided to use the Podman CLI, the CLI would be unaware of the existence of the machine. This is because Podman was only aware of machines and the existence of machines within the confines of its default provider–with one or two minor exceptions. Consider the following:
$ podman -v podman version 5.7.0-dev
In Podman 5, the default provider per platform was hardcoded in the Podman binary. It could be overridden in containers.conf. This indicates that we are setting libkrun as the default machine provider.
$ cat ~/.config/containers/containers.conf [machine] provider="libkrun"
Now suppose in Podman Desktop or via other means, we created a machine and we know it is running. To get a global view of all machines in Podman 5, you could use the --all-providers command line switch with podman machine ls.
$ podman machine ls —all-providers NAME VM TYPE CREATED LAST UP CPUS MEMORY DISK SIZE applehv-machine-1 applehv 8 minutes ago Currently running 6 2GiB 100GiB podman-machine-default* libkrun 26 minutes ago 8 minutes ago 6 2GiB 100GiB
However, using the Podman 5 CLI, when attempting to stop the machine by name we see an error like the following:
$ podman machine stop applehv-machine-1 Error: applehv-machine-1: VM does not exist
In Podman 6, we have made an overt push to make the prominence of the machine provider less prevalent. For commands like rm, stop, start (and others), we want users to be able to simply provide the machine name and regardless of the provider, Podman will act. And now that our upstream main branch has switched over to Podman 6 development, I have begun to already alter this base function.
$ podman -v podman version 6.0.0-dev
And now with Podman 6.
$ podman machine stop applehv-machine-1 Machine "applehv-machine-1" stopped successfully
Also note, I have removed --all-providers from the machine command but the default behavior is now to show all machines across all supported providers.
$ podman machine ls
NAME VM TYPE CREATED LAST UP CPUS MEMORY DISK SIZE applehv-machine-1 applehv 8 minutes ago 15 seconds ago 6 2GiB 100GiB podman-machine-default* libkrun 27 minutes ago 9 minutes ago 6 2GiB 100GiB
The second advancement in this work is around the creation of machines. This is done with the podman machine init command. You can now create a machine in a non-default provider with the new --provider command line switch. Consider this case where libkrun is the default provider, but I want to create a new machine that uses the applehv provider.
$ podman machine init --now --provider applehv applehv-machine-2 Looking up Podman Machine image at quay.io/podman/machine-os:6.0 to create VM Extracting compressed file: applehv-machine-2-arm64.raw: done Machine init complete Starting machine "applehv-machine-2" … <omited for brevity> Machine "applehv-machine-2" started successfully
A quick machine ls confirms the new machine was created with the correct provider.
$ podman machine ls NAME VM TYPE CREATED LAST UP CPUS MEMORY DISK SIZE applehv-machine-2 applehv 56 seconds ago Currently running 6 2GiB 100GiB applehv-machine-1 applehv 10 minutes ago About a minute ago 6 2GiB 100GiB podman-machine-default* libkrun 28 minutes ago 10 minutes ago 6 2GiB 100GiB
If you are interested in the happenings and development of Podman 6, our upstream repository is the best place to get information. And we are always looking for people with all kinds of skills to help our project. There are many ways to contribute beyond coding.


Leave a Reply