You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 3, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Jun 3, 2026. It is now read-only.
We had a thought a while ago that the functionality from podman-bootc might move to podman. However that has a large scope.
But what would have a much smaller and more obvious scope/match is moving just this functionality to podman:
Run a container that has a kernel embedded (in /usr/lib/modules) as a VM via direct boot (no bootloader) using the container's rootfs via virtiofs. The tool should support overriding init or just leave it with the default (which should work with systemd)
Maybe it shouldn't be --bootc-vm but a more generic name; again the key idea is that we're running the kernel from the target image, and we're also just default to the commandline from the target image (e.g. systemd) - unlike e.g. kata we wouldn't have a runtime embedded.
Details
A really key question is whether the result of the execution of this should itself be represented as a podman container. This question is entangled with questions that arose in the original issue of whether we should require a virt stack on the host (as podman machine does) or whether it should come from a container.
If it does not appear as a (podman) container then perhaps it shouldn't be under podman run, but something more like podman machine runc or so?
This would force a bit of generalization of podman's virtualization abstraction that is right now only used by podman-machine, but I think it makes sense.
(A detail that would make everything a lot more streamlined here is if we changed podman-machine (at least on Linux) to always run this way - instead of fetching disk images as OCI artifacts, we just fetch a bootc container! Only specific directories would persist (such as /var/lib/containers); those directories could persist on the host or in attached volumes. That'd be a huge change of course though)
That said let's gather some initial thoughts from maintainers here cc @baude
In the short term though what would probably make sense is to just implement this core functionality as podman-bootc run-ephemeral or so here (and then we'd be able to use it for doing a persistent install).
Yes it's hugely tricky in this case where the container files live inside the podman-machine VM. We don't want to do a copy - what we want is for a virtiofs mount for one VM to be backed by files stored in another. I don't think that's possible using the high level Virtualization API which just exposes the ability to mount host volumes. I guess it doesn't have to be a virtiofs mount, we could mount via e.g. NFS (over vsock e.g.) or so.
I didn't read carefully the history but my initial thought process is that if you like to run any bootc image as VM this sounds to me more like like a new "runtime", e.g. there is --runtime krun currently to run an image as a VM via libkrun. That AFAIK is implemented via extension/plugin in crun. There is also https://github.com/containers/crun-vm/.
So I think you could have something like podman --runtime bootc run <bootc-image> design wise rather easily and the the details get abstracted in the external runtime. That would avoid the need for podman changes I guess.
cc @mheon@baude
First, I think getting time at a Podman community meeting or cabal would be an appropriate forum. You would have most of the Podman maintainers available. I like this idea and topic and I am encouraged by it. I also see some possible benefits to Podman's workflow. Here are some of my additional thoughts:
Paul is onto something but I would offer that we should have a default approach that just works and requires no extra knowledge.
It makes sense somewhere in the podman machine subcommand context, though exactly where and how would be good design conversations.
I am currently writing a Podman 6 HLD and will open this up for review very soon. Podman 6 is due in Spring of 2026. If we want this to be part of Podman 6, we need to get cracking to understand scope.
I didn't read carefully the history but my initial thought process is that if you like to run any bootc image as VM this sounds to me more like like a new "runtime", e.g. there is --runtime krun currently to run an image as a VM via libkrun. That AFAIK is implemented via extension/plugin in crun. There is also https://github.com/containers/crun-vm/.
I didn't read carefully the history but my initial thought process is that if you like to run any bootc image as VM this sounds to me more like like a new "runtime", e.g. there is --runtime krun currently to run an image as a VM via libkrun.
Right, and one of those details is that krun currently uses its own kernel, not the kernel from the image. That's possible to change of course with a different variant. I'll investigate krun a bit more again.
(From a quick glance at the source, is the status quo with podman-machine that it only does krun on MacOS, not Linux?)
I keep wavering a bit on whether we actually want this thing to be via podman run with all that implies - basically in showing up as a pod. Sometimes I might want that, other times not; at least the core low level primitive should work without being represented necessarily as a pod/container. (This topic of course gets to the interesting one that on Linux one could imagine that the podman-machine VM actually showed up as a visible pod when using the default connection...would that be useful? Maybe? There's similar implications for the use cases of this outside of podman machine)
hi everyone, this discussion move in a different direction then what we have discussed #95. What the original PR covers is deploying an ephemeral rootless VM where we can build bootc images using podman from inside the VM to use all the privileged option and to be able to operate at disk level.
It relies on libvirt, so not calling directly QEMU, or libkrun. But for the rest it looks very close to what podman machine does.
In the original PR, the virt stack is deployed entirely in a container created by rootless podman, and then the bootc container is spawn inside the VM. The other options we were discussing in instead of having libvirt inside the container, to rely on libvirt from the host. My main question here is which one of the alternatives are the more desirable.
As Colin already mentioned, the goal is to boot from the artifacts from the bootc image.
IMO, a new runtime isn't necessary, since we aren't trying to launch containers, but only to create an ad-hoc environment for the bootc builds.
OK I really wanted to have this so I decided to spend a bit of time on it myself just to understand things better. There's a ~working PoC level result here: bootc-dev/bcvk@ad5aaeb
A key way this works is basically via a podman run that mounts the host/usr in (so we have access to the virt stack from there), and just runs in the context of the target container image. Though note we also mount the target image again at /run/source-image so what we see is the pristine source image that we export via virtiofsd.
In this case it's important to understand that qemu and virtiofsd binaries come from the host, but everything is lifecycle bound to the container image (so yes, closer to crunvm...arguably we could put this there).
This is a really tiny amount of code in the end; yeah it's in Rust because well it's me writing it but eh, we can easily carry a Go implementation of this too.
(Very tangential note but it took me a LOT of head scratching to figure out that in order to do nested containers that mount their own /proc I needed --security-opt=unmask=/proc/*)
(Very tangential note but it took me a LOT of head scratching to figure out that in order to do nested containers that mount their own /proc I needed --security-opt=unmask=/proc/*)
Right, and one of those details is that krun currently uses its own kernel, not the kernel from the image. That's possible to change of course with a different variant. I'll investigate krun a bit more again.
It's also going to have support for arbitrary FW/BIOS images later this month.
crun is already capable of making use of this API to set a kernel/initramfs that's present in the OCI image as payload. We also plan to expand the configuration file with more options to set up devices (by the end of the month we'll support booting Android, which requires a very specific machine definition).
But obviously we can fix that using the same logic as is done here.
I have some reservations about crun-vm in that I don't always want to bind vms to pods, and it feels a bit conceptually awkward to try to have every verb there try to map container runtime concepts; it's not the same as kata.
Anyways so yes obviously krun is doing the "virtiofs root of container" thing. Are you thinking we'd a flag to krun to auto-discover the kernel/initramfs from the target image? Otherwise we still need external tooling to at least orchestrate that.
And I guess to me what's still super important here is to also streamline the bootc install to-disk flow (like crun-vm is trying and podman-bootc does too) which seems to be outside the obvious scope of "OCI runtime".
Anyways so yes obviously krun is doing the "virtiofs root of container" thing. Are you thinking we'd a flag to krun to auto-discover the kernel/initramfs from the target image? Otherwise we still need external tooling to at least orchestrate that.
I don't know if I mentioned in one our of our meetings, but I was experimenting with this. Didn't finish it, but my idea was to use the oci runtime spec config VM:
And I guess to me what's still super important here is to also streamline the bootc install to-disk flow (like crun-vm is trying and podman-bootc does too) which seems to be outside the obvious scope of "OCI runtime".
It could still totally make sense to add the core "ephemeral" functionality more directly into podman, but at the same time there's IMO a big need for deeper integrations like libvirt and more, and that feels more outside of podman's scope.
So...for now I think it's good to just keep as a separate tool.
Activity
cgwalters commentedon Aug 19, 2025
This would force a bit of generalization of podman's virtualization abstraction that is right now only used by podman-machine, but I think it makes sense.
cgwalters commentedon Aug 19, 2025
(A detail that would make everything a lot more streamlined here is if we changed podman-machine (at least on Linux) to always run this way - instead of fetching disk images as OCI artifacts, we just fetch a bootc container! Only specific directories would persist (such as
/var/lib/containers); those directories could persist on the host or in attached volumes. That'd be a huge change of course though)alicefr commentedon Aug 21, 2025
@cgwalters is there a place where this should be broadly discussed?Any community meetings? Bootc meeting perhaps?
cgwalters commentedon Aug 21, 2025
For both podman and bootc there are community meetings for sure. Bootc's are listed at https://github.com/bootc-dev/bootc?tab=readme-ov-file#community-discussion and podman's at https://podman.io/community
That said let's gather some initial thoughts from maintainers here cc @baude
In the short term though what would probably make sense is to just implement this core functionality as
podman-bootc run-ephemeralor so here (and then we'd be able to use it for doing a persistent install).ericcurtin commentedon Aug 26, 2025
I think one of the tricky parts here is macOS... But still doable as part of podman remote there
cgwalters commentedon Aug 26, 2025
Yes it's hugely tricky in this case where the container files live inside the podman-machine VM. We don't want to do a copy - what we want is for a virtiofs mount for one VM to be backed by files stored in another. I don't think that's possible using the high level Virtualization API which just exposes the ability to mount host volumes. I guess it doesn't have to be a virtiofs mount, we could mount via e.g. NFS (over vsock e.g.) or so.
Luap99 commentedon Aug 26, 2025
I didn't read carefully the history but my initial thought process is that if you like to run any bootc image as VM this sounds to me more like like a new "runtime", e.g. there is
--runtime kruncurrently to run an image as a VM via libkrun. That AFAIK is implemented via extension/plugin in crun. There is also https://github.com/containers/crun-vm/.So I think you could have something like
podman --runtime bootc run <bootc-image>design wise rather easily and the the details get abstracted in the external runtime. That would avoid the need for podman changes I guess.cc @mheon @baude
baude commentedon Aug 26, 2025
First, I think getting time at a Podman community meeting or cabal would be an appropriate forum. You would have most of the Podman maintainers available. I like this idea and topic and I am encouraged by it. I also see some possible benefits to Podman's workflow. Here are some of my additional thoughts:
podman machinesubcommand context, though exactly where and how would be good design conversations.cgwalters commentedon Aug 26, 2025
Yes, I commented the same in #95 (comment)
Right, and one of those details is that krun currently uses its own kernel, not the kernel from the image. That's possible to change of course with a different variant. I'll investigate krun a bit more again.
(From a quick glance at the source, is the status quo with podman-machine that it only does krun on MacOS, not Linux?)
I keep wavering a bit on whether we actually want this thing to be via
podman runwith all that implies - basically in showing up as a pod. Sometimes I might want that, other times not; at least the core low level primitive should work without being represented necessarily as a pod/container. (This topic of course gets to the interesting one that on Linux one could imagine that the podman-machine VM actually showed up as a visible pod when using the default connection...would that be useful? Maybe? There's similar implications for the use cases of this outside of podman machine)baude commentedon Aug 26, 2025
Correct, we use
libkrunonly on Apple Silicon Macs.alicefr commentedon Aug 27, 2025
hi everyone, this discussion move in a different direction then what we have discussed #95. What the original PR covers is deploying an ephemeral rootless VM where we can build bootc images using podman from inside the VM to use all the privileged option and to be able to operate at disk level.
It relies on libvirt, so not calling directly QEMU, or libkrun. But for the rest it looks very close to what podman machine does.
In the original PR, the virt stack is deployed entirely in a container created by rootless podman, and then the bootc container is spawn inside the VM. The other options we were discussing in instead of having libvirt inside the container, to rely on libvirt from the host. My main question here is which one of the alternatives are the more desirable.
As Colin already mentioned, the goal is to boot from the artifacts from the bootc image.
IMO, a new runtime isn't necessary, since we aren't trying to launch containers, but only to create an ad-hoc environment for the bootc builds.
run-ephemeral: POC implementation
cgwalters commentedon Aug 30, 2025
OK I really wanted to have this so I decided to spend a bit of time on it myself just to understand things better. There's a ~working PoC level result here: bootc-dev/bcvk@ad5aaeb
A key way this works is basically via a
podman runthat mounts the host/usrin (so we have access to the virt stack from there), and just runs in the context of the target container image. Though note we also mount the target image again at/run/source-imageso what we see is the pristine source image that we export via virtiofsd.In this case it's important to understand that qemu and virtiofsd binaries come from the host, but everything is lifecycle bound to the container image (so yes, closer to crunvm...arguably we could put this there).
This is a really tiny amount of code in the end; yeah it's in Rust because well it's me writing it but eh, we can easily carry a Go implementation of this too.
run-ephemeral: POC implementation
cgwalters commentedon Aug 30, 2025
(Very tangential note but it took me a LOT of head scratching to figure out that in order to do nested containers that mount their own
/procI needed--security-opt=unmask=/proc/*)cgwalters commentedon Sep 5, 2025
Ah https://lore.kernel.org/linux-fsdevel/[email protected]/ touches on this...it's possible to work around apparently, but man the workaround is ugly.
slp commentedon Sep 10, 2025
libkrun added supports for external kernels some months ago. https://github.com/containers/libkrun/blob/2012b7fd9798fd7056efd7a030daff2984af348b/include/libkrun.h#L706
It's also going to have support for arbitrary FW/BIOS images later this month.
crun is already capable of making use of this API to set a kernel/initramfs that's present in the OCI image as payload. We also plan to expand the configuration file with more options to set up devices (by the end of the month we'll support booting Android, which requires a very specific machine definition).
cgwalters commentedon Sep 10, 2025
Cool. Is anything using that?
You mean crun-vm, not crun right? And in theory it could be changed to do so, or it has code to do it now?
What it's doing with bootc right now is super inefficient: https://github.com/containers/crun-vm/blob/986f695aab15743dd0fdfdba3007ad659bde7c3a/embed/bootc/prepare.sh#L91
But obviously we can fix that using the same logic as is done here.
I have some reservations about crun-vm in that I don't always want to bind vms to pods, and it feels a bit conceptually awkward to try to have every verb there try to map container runtime concepts; it's not the same as kata.
slp commentedon Sep 10, 2025
Nope, actual crun: https://github.com/containers/crun/blob/6f0a3c5013e62c25f6eaa6e049aabc8b504d4e66/src/libcrun/handlers/krun.c#L99
cgwalters commentedon Sep 10, 2025
I think I knew at one point that crun linked to krun, but forgot about it. Obviously it's done so for years...but is anything using it? https://github.com/containers/crun/blob/main/crun.1.md#runocihandlerhandler classifies it as experimental.
Anyways so yes obviously krun is doing the "virtiofs root of container" thing. Are you thinking we'd a flag to krun to auto-discover the kernel/initramfs from the target image? Otherwise we still need external tooling to at least orchestrate that.
And I guess to me what's still super important here is to also streamline the
bootc install to-diskflow (like crun-vm is trying and podman-bootc does too) which seems to be outside the obvious scope of "OCI runtime".germag commentedon Sep 10, 2025
I don't know if I mentioned in one our of our meetings, but I was experimenting with this. Didn't finish it, but my idea was to use the oci runtime spec config VM:
cgwalters commentedon Sep 19, 2025
OK https://github.com/cgwalters/bcvk now exists. I am planning for this to fully replace podman-bootc on Linux at least in the near term.
It could still totally make sense to add the core "ephemeral" functionality more directly into podman, but at the same time there's IMO a big need for deeper integrations like libvirt and more, and that feels more outside of podman's scope.
So...for now I think it's good to just keep as a separate tool.