Chapter 14. Creating stateless images with RHEL image builder


Use RHEL image builder to create stateless images. After building the image in the pxe-tar-xz format, you can use the resulting stateless PXE image output in PXE or UEFI HTTP network boot environments. For more information, see the README contained within the generated tarball file.

Use the RHEL image builder CLI and a customized blueprint to create a RHEL image for PXE deployments. The tarball includes kernel, initrd, and root file system components. Stateless PXE images are available for the 64-bit ARM and AMD and Intel 64-bit architectures and support some customizations.

Prerequisites

  • An existing customized blueprint.

Procedure

  1. Build the customized RHEL image:

    $ image-builder build pxe-tar-xz --blueprint <blueprint-name>

    RHEL image builder creates the image in the current directory path:

    <os>-pxe-tar-xz-<architecture>.tar.xz
  2. Extract the image components to your boot server. Locate the tarball file. If the tool created a directory, enter that directory to find the .tar.xz file. Then, extract it to your TFTP root:

    $ sudo tar -xJf <image-name>.tar.xz -C /var/lib/tftpboot/rhel-pxe/

Serve the rootfs.img image by using HTTP for faster and more reliable transfers than TFTP alone.

Prerequisites

  • An <os>-pxe-tar-xz-<architecture>.tar.xz image exists.
  • The target system has enough memory to hold the kernel, initrd, and rootfs simultaneously.
  • 2GiB of capacity for small images, but it varies depending on the workload.

    Warning

    Insufficient RAM can result in a kernel panic during the boot process.

Procedure

  1. Prepare the TFTP server by placing the vmlinuz, initrd.img, and rootfs.img files in the root directory of your TFTP server.
  2. Modify the grub.cfg configuration, replacing the HTTP-SERVER placeholder with the actual URL of your HTTP server.
  3. Serve the rootfs.img by using HTTP inside the directory containing the rootfs.img file:

    $ python3 -m http.server 8000

Eliminate the need for a separate HTTP server by merging the root filesystem into the initial ramdisk.

Prerequisites

  • A PXE stateless image exists.
  • The target system has enough memory to hold the kernel, initrd, and rootfs simultaneously.
  • 2GiB of capacity for small images, but it varies depending on the workload.

    Warning

    Insufficient RAM can result in a kernel panic during the boot process.

Procedure

  1. Create the rootfs CPIO archive:

    $ echo rootfs.img | cpio -c --quiet -L -o > rootfs.cpio
  2. Concatenate the initrd.img and rootfs.cpio images:

    $ cat initrd.img rootfs.cpio > combined.img
  3. Boot the system by using the resulting combined.img file as your initrd in your PXE configuration.

    Note

    Using a combined image significantly increases the initial network payload. Because the entire root filesystem is transferred during the PXE phase, ensure your network bandwidth can handle the increased traffic, especially when booting multiple systems simultaneously.

Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat Documentation

Legal Notice

Theme

© 2026 Red Hat
Back to top