2.6. Switching from an existing rpm-ostree installation to image mode for RHEL 9.6


You can use image mode for RHEL on your existing RHEL for Edge system by using the bootc switch command.

When switching between different host builds, you can use the bootc switch command to migrate your existing deployed system to a bootc based system.

重要

Some user and group IDs differ between rhel-bootc images and RHEL for Edge. This affects several groups and users, such as ssh_keys. As a consequence, the private keys belong to a group with a misconfigured ID, and you will not be able to use public keys to access the edge system.

The Image Mode system uses altfiles to manage users at /user/lib/passwd and groups at /user/lib/group. To workaround this, you must extract the groups and users information of the existing RHEL for Edge system and fixating them as part of the Containerfile. Configure the Containerfile to copy a local lib/group file to the container image.

You can manually change the permissions of private keys, the /etc folder is mutable in edge systems. However, it does not solve the problem, because after running the bootc switch command, the Image Mode based system has the ssh_keys group configured with the ID 999. This value comes from the RHEL bootc base image, and this drift from ID 101 to ID 999 left the edge system unreachable through SSH. To fix this issue, follow the steps:

Prerequisites

Procedure

  1. Extract the information of users and groups from the RHEL for Edge system.

    $ mkdir -p ./usr/lib
    $ ssh admin@192.168.100.50 'cat /lib/passwd' > ./usr/lib/passwd
    $ ssh admin@192.168.100.50 'cat /lib/group' > ./usr/lib/group
  2. Include the missing RHEL for Edge packages in the bootc based system by specifying them in a Containerfile. Additionally, use the COPY command to include the group and passwd content that was extracted from the RHEL for Edge system. The following is an example:

    FROM registry.redhat.io/rhel9/rhel-bootc
    WORKDIR /tmp
    RUN dnf -y install ModemManager \
                       NetworkManager-wifi \
                       NetworkManager-wwan \
                       audit \
                       checkpolicy \
                       clevis \
                       clevis-dracut \
                       clevis-luks \
                       clevis-pin-tpm2 \
                       clevis-systemd \
                       containernetworking-plugins \
                       dnsmasq \
                       dracut-config-generic \
                       fdo-client \
                       fdo-owner-cli \
                       firewalld \
                       firewalld-filesystem \
                       greenboot \
                       greenboot-default-health-checks \
                       grubby \
                       ignition \
                       ignition-edge \
                       ipset \
                       iwl100-firmware \
                       iwl1000-firmware \
                       iwl105-firmware \
                       iwl135-firmware \
                       iwl2000-firmware \
                       iwl2030-firmware \
                       iwl3160-firmware \
                       iwl5000-firmware \
                       iwl5150-firmware \
                       iwl6050-firmware \
                       iwl7260-firmware \
                       libsecret \
                       pinentry \
                       policycoreutils-python-utils \
                       python3-distro \
                       python3-setools \
                       rsync \
                       setools-console \
                       tmux \
                       traceroute \
                       usbguard \
                       usbguard-selinux \
                       wireless-regdb \
                       wpa_supplicant
    
    COPY etc /etc
    # You can find the passwd and group content that were extracted from the RHEL for Edge system usr/lib/ in your current working directory. You can copy the content into the container image with the following step:
    COPY usr /usr
  3. Build the bootc image and push it to the registry:

    $ podman build -f Containerfile -t quay.io/<namespace>/<image>:<tag> .
    $ podman push quay.io/<namespace>/<image>:<tag>
  4. Run the bootc switch command to the newly created bootable container image.

    $ ssh admin@192.168.100.50
    $ sudo bootc switch quay.io/<namespace>/<image>:<tag>
    $ sudo reboot

Verification

After rebooting the edge system into the bootable container image, confirm that the contents of /lib/passwd and /lib/group match the content that was extracted from the OSTree system.

  1. Check the content of /lib/passwd.

    $ cat /lib/passwd
  2. Check the content of /lib/group.

    $ cat /lib/group

Use an existing 9.6 RHEL for Edge that you installed by using a raw image to switch to image mode for RHEL .

Prerequisites

  • An existing 9.6 RHEL for Edge installed with a raw image.

Procedure

  1. Update your image. See Updating RHEL for Edge images.
  2. Switch your existing image from RHEL image builder to image mode.

    1. Build an image from rhel-bootc. For example:

      $ cat Containerfile
      FROM registry.redhat.io/rhel9/rhel-bootc:latest
      RUN dnf install -y  \
          clevis  \
          clevis-dracut  \
          clevis-luks  \
          fdo-client  \
          fdo-owner-cli
  3. Build the <image> image by using Containerfile in the current directory:

    $ podman build -t quay.io/<namespace>/<image>:<tag> .
    1. Push the image to a registry

      $ podman push quay.io/<namespace>/<image>:_<tag>_
    2. Run bootc switch on the device.

      $ bootc switch quay.io/<namespace>/<image>:_<tag>_
    3. Run systemctl reboot.

      $ sudo systemctl reboot

Verification

  • Connect to your RHEL for Edge system and use bootc status:

    # bootc status

Use an existing 9.6 RHEL for Edge that you installed by using a simplified-installer image.

Prerequisites

  • An existing 9.6 RHEL for Edge installed with a simplified-installer image.

Procedure

  1. Check if bootc is installed:

    $ rpm -qa | bootc

    Update your image to the latest rpm-ostree installation. See Updating RHEL for Edge images.

    1. Build an image from rhel-bootc. For example:

      $ cat Containerfile
      FROM registry.redhat.io/rhel9/rhel-bootc:latest
      RUN dnf install -y  \
          clevis  \
          clevis-dracut  \
          clevis-luks  \
          fdo-client  \
          fdo-owner-cli
  2. Build the <image> image by using Containerfile in the current directory:

    $ podman build -t quay.io/<namespace>/<image>:<tag> .
    1. Push the image to a registry.

      $ podman push quay.io/<namespace>/<image>:_<tag>_
    2. Run bootc switch to switch the device to the image you pushed to the registry.

      $ bootc switch quay.io/<namespace>/<image>:_<tag>_
    3. Run systemctl reboot.

      $ sudo systemctl reboot
  3. Verification

    • Connect to your RHEL for Edge system and use bootc status:

      # bootc status
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部