Managing a traditional operating system (OS) across multiple hosts often leads to configuration drift, slow updates,and painful rollbacks. Bootable containers solve this by letting you package and manage the OS just like an application image, allowing teams to test base images locally, and then deploy identical builds across virtual or physical infrastructure.
Red Hat Enterprise Linux 10 (RHEL) introduced the image mode deployment method, which lets you manage operating systems as OCI container images. Also known as bootc images, these artifacts package the entire operating system, including the kernel, initrd, bootloader, and applications, into a single container. Testing a full OS build traditionally meant managing external VM installations or complex PXE environments. With the bootc container virtualization kit (bcvk), the end-to-end testing can be performed directly on a laptop using familiar Podman and libvirt packages.
Deployment modes in bcvk
The bcvk tool streamlines the transition from local development to production through 3 specific execution modes:
Ephemeral (run)
- Primary use: Rapid testing or iteration
- Persistence: None (wiped on exit)
- Speed: Independent of image size
- Default Memory: 4GB RAM (4096MB)
Persistent (libvirt)
- Primary use: Long-term development
- Persistence: Full (survives reboots, supports bootc upgrade)
- Speed: Slower; requires disk image creation only for the first run
- Default Memory: 4GB RAM (4096MB)
Disk image (to-disk)
- Primary use: Create bootable disk images
- Persistence: N/A (Output artifact)
- Speed: Slower; creates full disk image
- Default Memory: N/A
Prerequisites and installation
Before deploying and testing bootable container images with bcvk, you need:
- A physical host running RHEL 10, registered with an active Red Hat subscription.
- Active connectivity reaching an OCI image repository, such as
registry.redhat.ioorquay.io - A valid account in
registry.redhat.ioorquay.io - The Podman container runtime configured to handle image builds and local artifact management
Use dnf to install bcvk and its dependencies:
sudo dnf install epel-release
sudo dnf install bcvkIf you plan to use persistent VM management, enable and start the libvirt daemon:
sudo systemctl enable --now libvirtdBuild a custom bootc image
The foundation of any bootable container deployment is a custom system image in a Containerfile. Adding the containers.bootc=1 label guarantees your target artifact maintains full compatibility with bcvk tooling. Any existing bootc image is valid to use with bcvk.
In the following steps, we create a custom container image and deploy it using the 3 bcvk modes: ephemeral, libvirt, and disk image.
First, create a Containerfile to define the image. For this example, the Containerfile uses the RHEL 10 bootc runtime, applies the containers.bootc=1 metadata label, customizes the motd file, and adds a user as an admin account:
FROM registry.redhat.io/rhel10/rhel-bootc:latest
LABEL containers.bootc=1
RUN echo "Welcome to RHEL 10, built with image mode!!" > /etc/motd
RUN useradd -m -G wheel adminAuthenticate to registry.redhat.io using the podman command:
podman login registry.redhat.ioBuild the container image locally with podman:
podman build -t rhel10-lab-bcvk .Deploy across environments
After building your image, the primary benefit of bcvk becomes clear: You can execute identical artifacts consistently across diverse environments.
List the locally available images with the podman images command:
podman imagesTo verify that the image is ready:
bcvk images listThis scans local image metadata and returns a list of images containing the containers.bootc=1 label.
If the image appears in the output of bcvk images list, you can proceed with creating a complete OS using any of the 3 available modes.
Ephemeral evaluation
To swiftly validate a fresh build within a temporary instance, deploy the image using the ephemeral mode, while automatically passing your host's SSH credentials:
bcvk ephemeral run-ssh localhost/rhel10-lab-bcvkAdditional options include running a VM in detached mode (-d), assigning custom names (--name), and automatically cleaning up resources on exit (--rm).
Persistent virtualization
To test state changes over time, run the same image as a persistent libvirt VM. For this, you must verify that:
- You have installed
bcvkon the host system - You have installed, enabled, and started
libvirtd - You have permissions to manage libvirt domains (the typical membership in the
libvirtgroup) - You have access to the
registry.redhat.iocontainer registry
To create a basic VM with default settings:
bcvk libvirt run localhost/rhel10-lab-bcvkYou can further customize this VM by defining resource constraints, such as allocating 4 CPUs, 4096 MB of memory, and a 50 GB Btrfs filesystem. Manage these environments using bcvk libvirt list, start, stop, or ssh commands.
Generate a disk image
Use the bcvk utility with the to-disk command to convert a bootc container image into a physical or virtual disk format for bare metal or cloud deployments.
Prerequisites:
- You have installed
bcvkon the host system. - You have a local or remote bootc container image available
- You have sufficient disk space on the host to store the generated image
Create a virtual disk image:
bcvk to-disk --format=qcow2 --disk-size 20G \
localhost/rhel10-lab-bcvk output-disk.qcow2Using the same bootc image across testing, virtual machines, and bare-metal targets ensures consistent behavior and drastically reduces environmental drift.
Get started
Ready to streamline your OS deployments? It's just 3 easy steps:
- Set up EPEL
- Install bootc container virtualization kit
- Build your first Containerfile as demonstrated in this article
Try it today and find out how easy it is to manage RHEL 10 as a container image!