Notes on installing openSUSE remotely

Posted on Nov 19, 2024

Or said in another way: How to run openSUSE on Hetzner dedicated servers.

TL;DR:

  1. Install any other linux distribution from their installer.
  2. Follow the SDB article about remote installation
  3. Install openSUSE via SSH.

Why not build an image for their installimage tool? I have that too. But last time I used that, the install tool logged more things to their logging server than I liked. And it did so via plain HTTP.

The slightly longer version

  1. We start by downloading the initrd and kernel for the desired distribution.
$ curl -O initrd-15.6  https://download.opensuse.org/distribution/leap/15.6/repo/oss/boot/x86_64/loader/initrd
$ curl -O vmlinuz-15.6 https://download.opensuse.org/distribution/leap/15.6/repo/oss/boot/x86_64/loader/linux
  1. Configure Grub

I usually pick the first block in the /boot/grub{,2}/grub.cfg file and modify the kernel and initrd line. The SDB article wants us to use something like this:

   kernel /boot/vmlinuz-15.6 usessh=1 sshpassword="12345678" install=ftp://<path to openSUSE> hostip=192.168.10.10 netmask=255.255.255.0 gateway=192.168.10.1 nameserver=192.168.10.1
   initrd /boot/initrd-15.6

But we can do better! LinuxRC learned a lot new things since the SDB article was written so we should make use of them. We drop sshpassword="..." for ssh.key=https://host/path/to/publickey. Now you might argue. “Hey I am setting up my first server, I can not host it anywhere.” Weeeeeeelll actually? You can use ssh.key=https://github.com/youruser.keys same works for gitlab.

Next we kill FTP: install=ftp://... becomes install=https://download.opensuse.org/distribution/leap/15.6/repo/oss/. There is also rescue=. You can either use it with the same syntax as install= or combine rescue=1 install=<url>

Last but not least the network setup. The new ifcfg parameter gives us a lot of flexibility to configure our network. You could even configure it manually with netsetup. But for now we keep it simple with ifcfg=*=dhcp

   kernel /boot/vmlinuz-15.6 ssh=1 ssh.key=https://github.com/youruser.keys install=https://download.opensuse.org/distribution/leap/15.6/repo/oss/ ifcfg=*=dhcp
   initrd /boot/initrd-15.6

Reboot the host and ping. After a while you should be able to log into your installation system and proceed with a normal installation.