Build an OEM Expandable Disk Image

An OEM disk represents the system disk with the capability to auto expand the disk and its filesystem to a custom disk geometry. This allows deploying the same OEM image on target systems of a different hardware setup.

The following example shows how to build and deploy an OEM disk image based on openSUSE Leap using a QEMU virtual machine as OEM target system:

  1. Make sure you have checked out the example image descriptions, see Example Appliance Descriptions.

  2. Build the image with KIWI NG:

    $ sudo kiwi-ng --type oem system build \
        --description kiwi-descriptions/suse/x86_64/suse-leap-15.1-JeOS \
        --target-dir /tmp/myimage

    Find the following result images below /tmp/myimage.

    • The OEM disk image with the suffix .raw is an expandable virtual disk. It can expand itself to a custom disk geometry.

    • The OEM installation image with the suffix install.iso is a hybrid installation system which contains the OEM disk image and is capable to install this image on any target disk.

Deployment Methods

The basic idea behind an OEM image is to provide the virtual disk data for OEM vendors to support easy deployment of the system to physical storage media.

There are the following basic deployment strategies:

  1. Manual Deployment

    Manually deploy the OEM disk image onto the target disk

  2. CD/DVD Deployment

    Boot the OEM installation image and let KIWI NG’s OEM installer deploy the OEM disk image from CD/DVD or USB stick onto the target disk

  3. Network Deployment

    PXE boot the target system and let KIWI NG’s OEM installer deploy the OEM disk image from the network onto the target disk

Manual Deployment

The manual deployment method can be tested using virtualization software such as QEMU, and an additional virtual target disk of a larger size. The following steps shows how to do it:

  1. Create a target disk

    $ qemu-img create target_disk 20g


    Retaining the Disk Geometry

    If the target disk geometry is less or equal to the geometry of the OEM disk image itself, the disk expansion performed for a physical disk install during the OEM boot workflow will be skipped and the original disk geometry stays untouched.

  2. Dump OEM image on target disk

    $ dd if=LimeJeOS-Leap-15.1.x86_64-1.15.1.raw of=target_disk conv=notrunc
  3. Boot the target disk

    $ qemu -hda target_disk -m 4096

    At first boot of the target_disk the system is expanded to the configured storage layout. By default the system root partition and filesystem is resized to the maximum free space available.

CD/DVD Deployment

The deployment from CD/DVD via the installation image can also be tested using virtualization software such as QEMU. The following steps shows how to do it:

  1. Create a target disk

    Follow the steps above to create a virtual target disk

  2. Boot the OEM installation image as CD/DVD with the target disk attached

    $ qemu -cdromLimeJeOS-Leap-15.1.x86_64-1.15.1.install.iso -hda target_disk -boot d -m 4096


    USB Stick Deployment

    Like any other iso image built with KIWI NG, also the OEM installation image is a hybrid image. Thus it can also be used on USB stick and serve as installation stick image like it is explained in Build an ISO Hybrid Live Image

Network Deployment

The deployment from the network downloads the OEM disk image from a PXE boot server. This requires a PXE network boot server to be setup as explained in Setting Up a Network Boot Server

If the PXE server is running the following steps shows how to test the deployment process over the network using a QEMU virtual machine as target system:

  1. Make sure to create an installation PXE TAR archive along with your OEM image by replacing the following setup in kiwi-descriptions/suse/x86_64/suse-leap-15.1-JeOS/config.xml

    Instead of

    <type image="oem" installiso="true"/>


    <type image="oem" installpxe="true"/>
  2. Rebuild the image, unpack the resulting LimeJeOS-Leap-15.1.x86_64-1.15.1.install.tar.xz file to a temporary directory and copy the initrd and kernel images to the PXE server:

    1. Unpack installation tarball

      mkdir /tmp/pxe && cd /tmp/pxe
      tar -xf LimeJeOS-Leap-15.1.x86_64-1.15.1.install.tar.xz
    2. Copy kernel and initrd used for pxe boot

      scp pxeboot.LimeJeOS-Leap-15.1.x86_64-1.15.1.initrd.xz PXE_SERVER_IP:/srv/tftpboot/boot/initrd
      scp pxeboot.LimeJeOS-Leap-15.1.x86_64-1.15.1.kernel PXE_SERVER_IP:/srv/tftpboot/boot/linux
  3. Copy the OEM disk image, MD5 file, system kernel, initrd and bootoptions to the PXE boot server:

    Activation of the deployed system is done via kexec of the kernel and initrd provided here.

    1. Copy system image and MD5 checksum

      scp LimeJeOS-Leap-15.1.x86_64-1.15.1.xz PXE_SERVER_IP:/srv/tftpboot/image/
      scp LimeJeOS-Leap-15.1.x86_64-1.15.1.md5 PXE_SERVER_IP:/srv/tftpboot/image/
    2. Copy kernel, initrd and bootoptions used for booting the system via kexec

      scp LimeJeOS-Leap-15.1.x86_64-1.15.1.initrd PXE_SERVER_IP:/srv/tftpboot/image/
      scp LimeJeOS-Leap-15.1.x86_64-1.15.1.kernel PXE_SERVER_IP:/srv/tftpboot/image/
      scp LimeJeOS-Leap-15.1.x86_64-1.15.1.config.bootoptions PXE_SERVER_IP:/srv/tftpboot/image/


      The config.bootoptions file is used together with kexec to boot the previously dumped image. The information in that file references the root of the dumped image and can also include any other type of boot options. The file provided with the KIWI NG built image is by default connected to the image present in the PXE TAR archive. If other images got deployed the contents of this file must be adapted to match the correct root reference.

  4. Add/Update the kernel command line parameters

    Edit your PXE configuration (for example pxelinux.cfg/default) on the PXE server and add these parameters to the append line, typically looking like this:

    append initrd=boot/initrd

    The location of the image is specified as a source URI which can point to any location supported by the curl command. KIWI NG calls curl to fetch the data from this URI. This also means your image, MD5 file, system kernel and initrd could be fetched from any server and doesn’t have to be stored on the PXE_SERVER.

    By default KIWI NG does not use specific curl options or flags. However it is possible to add custom ones by adding the flag into the kernel command line. curl options are passed as comma separated values. Consider the following example:,3,--retry-delay,3,--speed-limit,2048

    The above tells KIWI NG to call curl with:

    curl --retry 3 --retry-delay 3 --speed-limit 2048 -f <url>

    This is specially handy when the deployment infraestructure requires some fine tuned download behavior. For example, setting retries to be more robust over flaky network connections.


    KIWI NG just replaces commas with spaces and appends it to the curl call. This is relevant since command line options including commas will always fail.


    The initrd and Linux Kernel for pxe boot are always loaded via tftp from the PXE_SERVER.

  1. Create a target disk

    Follow the steps above to create a virtual target disk

  2. Connect the client to the network and boot QEMU with the target disk attached to the virtual machine.

    $ qemu -boot n -hda target_disk -m 4096


    QEMU bridged networking

    In order to let qemu connect to the network we recommend to setup a network bridge on the host system and let qemu connect to it via a custom /etc/qemu-ifup. For details see