Skip to content

Instantly share code, notes, and snippets.

@JohnMertz
Created July 4, 2025 19:23
Show Gist options
  • Select an option

  • Save JohnMertz/f84d1cb8a8deb76b17d3ac304c910da0 to your computer and use it in GitHub Desktop.

Select an option

Save JohnMertz/f84d1cb8a8deb76b17d3ac304c910da0 to your computer and use it in GitHub Desktop.
Install a BootC image on OVH

Installing a BootC image on OVH

OVH does not provide any OS versions which natively use bootable container images, however it is possible to replace an existing OS.

WARNING

This will overwrite the system which it is installed on. It is recommended to do this on a brand new VPS or one that you have absolutely no use for.

Install a fresh VPS

If you already have one, you can use that but these instructions will delete all your data, unless you put in your own work to salvage it where noted.

I used Rocky Linux 9 since it is the most similar to my desired end product, however any system which has a relatively recent version of podman available will work.

Install podman

For rpm-based distributions you should just need to do:

sudo dnf install podman

For deb-based distributions you should need to do:

sudo apt-get update
sudo apt-get install podman -y

Set up SSH keyn

OVH offers to install an SSH public key during installation, so if you have done this already, you don't need to do anything special here.

If you already have an SSH public key that you would like to use, simply ensure that it exists on your new VPS. For the purposes of this documentation, we will assume that this key exists inside the /home/<user>/.ssh/authorized_keys file which is where OVH will have put it.

Once this is done, you will need to place the public key(s) somewhere that podman will be able to find them (ie. in a volume that will be mounted). Since we will be mounting the container directory anyways and any clutter in that directory will be disposed of in the end, we will just place it there:

sudo cp /home/<user>/.ssh/authorized_keys /var/lib/containers/

Install alongside existing OS

The following command will then download your desired container image, install it to /target then configure the bootloader to boot from /target:

sudo podman run --rm --privileged --pid=host \
    -v /:/target -v /var/lib/containers:/var/lib/containers \
    --security-opt label=type:unconfined_t \
    <bootc_image>  \
    bootc install to-filesystem --generic-image \
    --acknowledge-destructive \
    --root-ssh-authorized-keys=/var/lib/containers/authorized_keys \
    --replace=alongside /target
  • sudo, --priviledged and --pid=host are necessary to operate as root and make changes to the root filesystem.
  • --rm will delete any existing container which might conflict
  • both -v options instruct podman to mount those two directories so that the container can access existing files from the existing OS
  • <bootc_image> is your desired image to install and should be replaced. For example, I used ghcr.io/ublue-os/cayo:10.
  • the remaining 4 lines is a command to be executed within that container. Here, we are instructing it to run bootc install to-filesystem.
  • --generic-image tells it to install for the Grub bootloader, since OVH does not support EFI boots.
  • --acknowledeg-destructive will skip the 20 second delay to warn you that your existing installation will be broken.
  • --root-ssh-authorized-keys=/var/lib/containers/authorized_keys will apply the authorized_keys files that we copied to the root user of the new system so that we can log in.
  • --replace=alongside /target directs it to install the new system to the /target directory and to set this as the new bootable target on an already mounted disk.

When this completes, you will just need to reboot.

Accessing your new system

You can then log in as root after the reboot. Note that if you have already been using SSH to access the VPS, it will warn you that the fingerprint has changed. This is normal. Just delete the line number specified after the ':' in the error message (and any other lines which mention the same IP/hostname) then try to log in again.

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