OVH does not provide any OS versions which natively use bootable container images, however it is possible to replace an existing OS.
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.
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.
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
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/
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,--priviledgedand--pid=hostare necessary to operate asrootand make changes to the root filesystem.--rmwill delete any existing container which might conflict- both
-voptions instructpodmanto 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 usedghcr.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-imagetells it to install for the Grub bootloader, since OVH does not support EFI boots.--acknowledeg-destructivewill skip the 20 second delay to warn you that your existing installation will be broken.--root-ssh-authorized-keys=/var/lib/containers/authorized_keyswill apply theauthorized_keysfiles that we copied to therootuser of the new system so that we can log in.--replace=alongside /targetdirects it to install the new system to the/targetdirectory and to set this as the new bootable target on an already mounted disk.
When this completes, you will just need to reboot.
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.