Skip to content

Instantly share code, notes, and snippets.

@jlebon
Last active June 4, 2025 15:20
Show Gist options
  • Save jlebon/7190e57cef4d705582ecdfa745bf1a66 to your computer and use it in GitHub Desktop.
Save jlebon/7190e57cef4d705582ecdfa745bf1a66 to your computer and use it in GitHub Desktop.
Boot RHCOS 4.1 and rebase to RHCOS 9.6
  1. Download RHCOS 4.1 from the RHCOS release browser (qemu qcow2) or the mirror (metal BIOS or UEFI image).
  2. Write a spec v2 Ignition config that sets the password for core to e.g. changeme:
{
  "ignition": {
    "config": {},
    "security": {
      "tls": {}
    },
    "timeouts": {},
    "version": "2.2.0"
  },
  "passwd": {
    "users": [
      {
        "name": "core",
        "groups": [
          "sudo",
          "wheel"
        ],
        "passwordHash": "$6$QoJFNpDLghwtyeZV$dINZU8AH.2Q/wfFF9HbVKg9zZ7AFUagaCZO.n/Ma19y8mhbmXZydKXRJy7L9WsVRBKySnBJp3dq7UmcgIlx2u."
      }
    ]
  }
}
  1. Boot it using kola qemuexec --qemu-image image.qcow2 --ignition-direct -i config.ign -U. Log in using core/changeme.
    • For the metal images, you can just pass the .raw file directly to the --qemu-image field. You'll also want to add --kargs ignition.platform.id=qemu.
    • For the UEFI metal image, additionally pass --qemu-firmware uefi.
  2. Rebase the guest using the same deploy-from-self trick that the MCO uses:
setenforce 0
IMG=localhost/rhel-9.6
podman run --privileged --pid=host --net=host --rm -v /:/run/host $IMG rpm-ostree ex deploy-from-self /run/host

(The IMG there is normally e.g. the latest RHCOS 9.6 pullspec. But if you're using a locally built rhel-9.6 anyway, it might be easier to just e.g. curl down the OCI archive from the host and then skopeo copy it into container storage in the guest.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment