Install an OS without KVM on Hetzner » 21 March 2024
I wanted to install RHEL on a Hetzner bare metal server, but there was a large demand for KVMs and I didn’t want to wait. I’ve found a tutorial on how to install Proxmox from the Hetzner rescue system - here’s how to do it for (almost) any OS.
Step 0: Boot into the rescue system
This is business as usual - go to the Hetzner robot, select your server, and boot into the rescue system. You’ll get an email with the root password or you can use your public keys.
Step 1: Preparations
First, we need to grab an image of the OS we want to install. I’ll use RHEL 9 as an example, but you can use any OS you want.
Then acquire the network configuration from the rescue system, you might need it later. For RHEL, it’s not necessary, you can just set your network configuration in the installer to automatic, then DHCP will handle the rest. It was necessary for Proxmox, though.
The INTERFACE_NAME
might need some tweaking, ID_NET_NAME_ONBOARD may not exist.
Step 2: Install the OS via QEMU
Kick off the installation with QEMU. You can use the following command as a template, just replace the image and the disk with your own.
Alternatively, if you have more than 2 disks, you can use -hda /dev/sda -hdb /dev/sdb -hdc /dev/sdc -drive file=proxmox-ve.iso,index=3,media=cdrom
or similar, because -cdrom conflicts with -hdc.
Now you can connect to the VNC server with your favorite VNC client over port 5900.
If your server uses UEFI boot, you need to add -bios /usr/share/qemu/OVMF.fd
to the QEMU command, or wherever your OVMF.fd is. (Hint: updatedb+locate)
After your OS is installed, you can shut down the QEMU session:
Step 3: Boot into the installed OS - still in QEMU
After the installation is finished, reboot the guest OS, then restart the QEMU session:
Connect to the guest via VNC again, and copy the network settings from step 1, also make sure you can log in remotely from the server.
This is the time to grab your public keys and add them to the guest OS.
Pro tip: curl https://github.com/username.keys >> ~/.ssh/authorized_keys
Step 4: Wrapping up
Shut down the guest OS gracefully:
Then reboot
the rescue system.