Sideloading SUSE Virtualization onto an existing Linux system
After the v1.7.0 community release of Harvester, we learned that there was a problem with network interface naming for certain types of Intel NIC, when upgrading from v1.6.x. When I was working on fixing this for SUSE Virtualization v1.7.1, I needed to test the fix on hardware with Intel X710 NICs, but we didn’t have any of these in our usual lab. I did find a system with the necessary NICs in a different lab, but despite having access to the iLO, I was unable to boot the Harvester installer ISO image, because the web server hosting our images is on a different network, and the iLO virtual media feature only works if you point it at a web server on the same network.
Happily, the system in question already had SUSE Linux Enterprise Server installed, and I was able to ssh in and use sudo to become root. It turns out that was enough, because if you have a root login on an existing Linux system, plus some sort of console access to the host (whether graphical or serial), you can take the kernel and initrd images we publish for automated PXE installs of SUSE Virtualization, and use those with kexec to boot into the interactive installer.
If you’re not familiar with kexec, it’s a tool to boot directly to another kernel from the currently running one. This is often used to facilitate fast reboots with the same or an updated kernel on an existing host, without having to go through the whole UEFI/BIOS POST sequence, which can take a very long time on server hardware. But there’s no reason we can’t use kexec to load a completely different kernel than what’s currently running. So, here’s how to install SUSE Virtualization from inside an existing Linux system:
-
Download the Harvester kernel and initrd images (this example uses v1.7.1).
# curl --output-dir /tmp -O \ https://releases.rancher.com/harvester/v1.7.1/harvester-v1.7.1-vmlinuz-amd64 # curl --output-dir /tmp -O \ https://releases.rancher.com/harvester/v1.7.1/harvester-v1.7.1-initrd-amd64 -
As the root user, invoke
kexec, passing it the above two files, and a carefully crafted command line (more on this below).# kexec /tmp/harvester-v1.7.1-vmlinuz-amd64 \ --initrd=/tmp/harvester-v1.7.1-initrd-amd64 \ --command-line="ip=eno1np0:dhcp net.ifnames=1 rd.cos.disable rd.live.debug=1 root=live:https://releases.rancher.com/harvester/v1.7.1/harvester-v1.7.1-rootfs-amd64.squashfs console=tty1 console=ttyS0,57600 harvester.install.iso_url=https://releases.rancher.com/harvester/v1.7.1/harvester-v1.7.1-amd64.iso"
The system will then reboot into the interactive installer, and you can work through that from the console exactly as you would had you originally booted from the ISO image.
Getting --command-line right
The --command-line option passed to kexec in the above example is derived from the iPXE scripts in the documentation on PXE Boot Installation. There, it’s written as:
ip=dhcp net.ifnames=1 rd.cos.disable console=tty1 root=live:http://10.100.0.10/harvester/rootfs.squashfs harvester.install.automatic=true harvester.install.config_url=http://10.100.0.10/harvester/config-create.yaml
Note that it specifies root=live:http://10.100.0.10/harvester/rootfs.squashfs which is the Harvester rootfs from an example PXE server, plus harvester.install.automatic=true and harvester.install.config_url=http://10.100.0.10/harvester/config-create.yaml. The first parameter I replaced with a direct link to the Harvester rootfs on releases.rancher.com. The latter two parameters will initiate an automated install based on the specified config file. There’s no reason you couldn’t similarly initiate an automated install via kexec, it’s just that in my case I wanted to work through an interactive install, so I removed these parameters and instead just provided the ISO image location with harvester.install.iso_url. I also dropped rd.noverifyssl which should only be used on a trusted network.
The other things I tweaked were ip=eno1np0:dhcp to explicitly specify the network interface I wanted to use, and I added console=tty1 console=ttyS0,57600 which gave me access to the graphical installer via the console on the iLO, and also let me access the serial console. The correct settings for these options will vary from system to system, so you may have to experiment a bit and reboot a few times to get them right.
If you only have a serial console
The interactive installer really really wants to be run on a good sized graphical console, because there are several screens that just don’t fit in an 80×24 terminal window. If you find yourself trying to install SUSE Virtualization on a system that you can only access via serial console, the following trick should let you proceed:
- Make your terminal window as big as possible.
- When you see the login prompt, login as user “rancher” with password “rancher”.
- Become root (run
sudo -i). - Run
setterm --resizeto reset the terminal size to the new size of the window. - Run
start-installer.shto start the installer.
Related Articles
Feb 20th, 2025