Skip to main content

2 posts tagged with "bootc"

View All Tags

Podman Desktop BootC extension 1.6 Release

ยท 3 min read
Charlie Drage
Software Engineer

BootC extension 1.6 Release! ๐ŸŽ‰

banner

BootC (Bootable Container) is an extension for Podman Desktop that builds bootable container disk images. Go from a standard container image to a full bootable-on-a-usb-stick OS!

You can update or install the extension via the Podman Desktop extension catalog.

This release introduces exciting new features and improvements:

  • Detailed example pages: Each example now has a dedicated page with detailed instructions on how to use it.
  • Interactive build configuration creator: Easily create your build configuration through a fillable form directly in the GUI.
  • Experimental Linux VM support: Added support for running Linux VMs on generated images.

Release Detailsโ€‹

Examples now have detail pagesโ€‹

Each example now includes a dedicated detail page! Click on More Details in the Examples section to view step-by-step instructions for each example.

example details

Interactive build config creatorโ€‹

No need to manually create a custom build config. Use our interactive build configuration creator to easily generate your own build config through a user-friendly form.

build config interactive

Experimental Linux VM supportโ€‹

Linux support is now available for running virtual machines on generated images! Look for the new Virtual Machine (Experimental) tab or the dedicated VM launch button on the Disk Images page.

linux support


Detailed release changelogโ€‹

Features ๐Ÿ’กโ€‹

  • feat: add example details page by @cdrage in #1017
  • feat: add build config configurator by @cdrage in #1026
  • feat: add Linux VM experimental support by @cdrage in #1102

Chores ๐Ÿ› ๏ธโ€‹

  • chore: remove yarn references by @deboer-tim in #969
  • chore: update to latest UI library by @deboer-tim in #971
  • chore: add release process by @deboer-tim in #970
  • chore: delete packages/backend/yarn.lock by @benoitf in #1001
  • chore: rename team in CODEOWNERS by @benoitf in #999
  • chore: refresh dependencies to update to latest versions by @benoitf in #1003
  • chore: add telemetry for examples by @cdrage in #1098
  • chore: update bootc-image-builder image by @cdrage in #1078
  • chore: remove HVF acceleration from AMD64 VM command by @cdrage in #1089
  • chore: add READMEs to each example by @cdrage in #1014
  • chore: rename section by @cdrage in #1015
  • chore: revert back to Vite 5 and update Vitest by @cdrage in #1116

Fixes ๐Ÿ”จโ€‹

  • fix: E2E tests workflow failure to install PNPM by @dgolovin in #1085
  • fix: E2E main workflow node setup step by @dgolovin in #1103
  • fix: navigation to webview by @cbr7 in #1052
  • fix: bootc E2E tests by @cbr7 in #998

Documentation ๐Ÿ“šโ€‹

  • docs: update release doc by @cdrage in #1115

Creating a MicroShift bootable image with Podman Desktop

ยท 7 min read
Charlie Drage
Software Engineer

banner

If you're unfamiliar with BootC, it offers an impressive method for deploying applications directly to bare metal from either a single Containerfile or a pre-existing bootc-supported image.

A "bootable" image, known as a BootC container image, allows you to use a simple container image to create a full bootable operating system, whether it's a raw virtual machine image or an iso for USB installation!

This capability is ideal for a variety of uses, from a simple HTTP server to an OS powering a full-stack application.

In this tutorial, we'll deploy an OpenShift derivative called MicroShift, an edge-optimized version of OpenShift designed for single-node setups on resource-constrained configurations. Think of it as a compact version of OpenShift!

This entire process is carried out using a single Containerfile (or Dockerfile).

Requirementsโ€‹

Before starting the tutorial, ensure you have:

Building the BootC container imageโ€‹

First, we'll build the initial BootC container image from which we'll later create a bootable OS.

Logging into Red Hat registryโ€‹

Before proceeding, download the Red Hat Authentication extension from the catalog to enable access to Red Hat registries:

red hat login

Then log into your account:

red hat login sign in

Download your OpenShift Hybrid Cloud pull secretโ€‹

Download your pull secret.

This is downloaded as pull-secret.txt. Put it in a secure location.

Creating the Containerfile (or Dockerfile)โ€‹

The Containerfile is crucial for creating the bootable image.

It's important to note that we will be providing one argument during the build and that is the PASSWORD in order to access the Virtual Machine that will be logged in via the redhat username.

We will be using the Containerfile from the MicroShift image mode GitHub documentation.

Copy the Containerfile from the above link to a new file which we will be building with Podman Desktop:

$ curl https://raw.githubusercontent.com/openshift/microshift/main/docs/config/Containerfile.bootc-rhel9 -o Containerfile

Build with Podman Desktopโ€‹

Select the Containerfile and build it within Podman Desktop.

You will need to provide:

  • A password for the redhat user that will be created in the Containerfile.

Pass the argument as USER_PASSWD in the build page arguments.

build

Build the bootable image with BootC Podman Desktop extensionโ€‹

Installโ€‹

Install the BootC Podman Desktop extension from the extensions catalog:

install

Build the imageโ€‹

Now, create the bootable image from our container image!

Click the new BootC icon on the navigation bar and go to build:

build_button

Once the build is complete, you'll see a confirmation on the dashboard.

Next, select the image we built and choose an appropriate output format for testing the bootable image. RAW is a common choice for local testing with QEMU and other VM software like libvirt.

Testing the imageโ€‹

Explore various ways to test your image, using local software or cloud platforms. Here are some common steps for using the RAW output bootable image.

Running the Virtual Machineโ€‹

This guide doesn't cover all methods for running a virtual machine, but here are the most common:

When using Hyper-V, create a .vhd image with BootC:

  1. When building, select the .vhd option.
  2. Install Hyper-V
  3. Import the virtual machine

Configuring and verifying MicroShiftโ€‹

After you boot your virtual machine, you can now configure MicroShift as well as verify the connection.

Copying over the OpenShift pull secretโ€‹

Before proceeding with verifying OpenShift, the OpenShift pull secret must be copied over so that MicroShift can download Red Hat registry-authenticated container images.

Below we will copy the OpenShift secret you had previously downloaded to the virtual machine.

  1. Download your OpenShift pull secret which is downloaded as pull-secret.txt

  2. Use scp to copy over to the virtual machine:

$ scp -P 2222 pull-secret.txt redhat@localhost:~/
  1. SSH into the VM:
$ ssh redhat@localhost -p 2222
  1. Move the secret to /etc/crio/openshift-pull-secret:
$ sudo mv pull-secret.txt /etc/crio/openshift-pull-secret
  1. Restart the microshift service:
$ sudo systemctl restart microshift

Listing podsโ€‹

Below we will SSH into the virtual machine and confirm that MicroShift is deploying Pods correctly:

  1. SSH into the VM:
$ ssh redhat@localhost -p 2222
  1. Copy the generated kubeconfig file to ~/.kube/config:
$ mkdir -p ~/.kube
$ sudo cp /var/lib/microshift/resources/kubeadmin/kubeconfig ~/.kube/config
$ sudo chown redhat ~/.kube/config
  1. Verify Pods are running by using oc or kubectl:
$ kubectl get pods -A
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system csi-snapshot-controller-856bb8b9bc-9n7lj 1/1 Running 1 3d23h
kube-system csi-snapshot-webhook-7c64d4d4d7-98v6l 1/1 Running 1 3d23h
openshift-dns dns-default-n2td4 2/2 Running 2 3d23h
openshift-dns node-resolver-7cslg 1/1 Running 1 3d23h
openshift-ingress router-default-7cbc67954b-nqqc6 1/1 Running 1 3d23h
openshift-ovn-kubernetes ovnkube-master-zcqw5 4/4 Running 5 3d23h
openshift-ovn-kubernetes ovnkube-node-crnn9 1/1 Running 2 3d23h
openshift-service-ca service-ca-6799f567-k7lsc 1/1 Running 1 3d23h

Using Podman Desktop to verify MicroShiftโ€‹

Alternatively, you can copy the MicroShift configuration file to your local machine and test it remotely on Podman Desktop.

  1. On your local machine, create the .kube directory if it does not exist already:
$ mkdir ~/.kube
  1. Copy the remote kubeconfig file to a local configuration file:

Within MicroShift, a kubeconfig file is automatically created at /var/lib/microshift/resources/kubeadmin/kubeconfig.

Copy the file over to your local system:

scp -P 2222 redhat@localhost:/var/lib/microshift/resources/kubeadmin/kubeconfig ~/config

If you already have a ~/.kube/config, copy the contents of config to the ~/.kube/config file.

  1. Use Podman Desktop to verify the MicroShift cluster:

Podman Desktop will automatically detect your .kube/config file.

Note: You may need to modify your .kube/config file to reflect the correct domain or IP address of your cluster.

cluster

Storage configurationโ€‹

By default, storage configuration requires an LVM partition and LVMS storage manager will not be deployed. This is due to a limitation when building a RAW image. An alternative non-local storage solution is required to use OpenShift artifacts with storage capabilities. The feature to add LVM support is tracked in this pull request.

Conclusionโ€‹

This tutorial provided a step-by-step guide on deploying a bootable MicroShift image using Podman Desktop and the BootC extension. By leveraging tools such as BootC and Podman, we've streamlined the process of creating a lightweight, yet fully functional, OpenShift environment suitable for single-node edge computing scenarios.

Thank you for following along, and happy deploying!