Local boot on old Scaleway instances via kexec

Old instances (e.g. VC1S) don’t have the possibility to run kernel from upstream Linux distribution (you can’t reinstall using EFI), instead they use a kernel provided by Scaleway team, which is not regularly updated.

Fortunately, Scaleway has hidden features in their boot process that allow to run kexec which makes it possible to run the kernel of your choice.

These features are provided by setting tags on the instance in the Scaleway console.

This guide leads you to enable kexec on your instance.

Install a kernel on the server

For Debian:

apt install linux-image-amd64

For Ubuntu:

apt install linux-kvm # or: linux-image-generic

linux-update-symlinks is ran by APT to create symbolic links on /vmlinuz and /initrd.img.

ls -l /vmlinuz /initrd.img

This should point to the kernel that has just been installed in /boot.

Install a network daemon

apt install ifupdown

Configure it

Edit /etc/network/interfaces and comment out lines for eth0 interfaces, then add:

auto ens2
iface ens2 inet dhcp

Edit fstab for mounting disks on boot

Run blkid to get disk UUIDs.

Edit /etc/fstab so it will mount all your disks to the proper mount points on startup:

UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx	/         	ext4      	rw,relatime	0 1

This step is important or it will only mount /dev/vda as read-only.

If you miss this step, you can still remount it as read-write:

mount -o remount,rw /

Check that setup is working

I advise you to disable the services you don’t want to start at boot in your tests, as these could be killed later if you restart your instance on Scaleway console.

systemctl status # check what units you want to disable
systemctl disable ...

Then install kexec locally:

apt install kexec-tools

When it asks whether or not to manage boot process, choose no.

It might be useful to open now the console of your instance (a virtual TTY) on the Scaleway console, to check the output of the boot process, in case of an error. Note that it often stays blank and doesn’t work, but it is very useful when it does.

Be aware that the network interface will be renamed from eth0 to ens2. You might want to update your firewall rules accordingly.

When you are ready, run these two commands and you’ll be logged out of SSH, as kernel runs kexec:

kexec -l /vmlinuz --initrd=/initrd.img --reuse-cmdline
systemctl kexec

If server seems not responsive or failed to boot, you can restart the server on Scaleway console. Note that as networking service has been enabled, it will probably fail to start and blocks the boot process for 5 minutes. Check the console for when it happens.

Edit Scaleway tags

When you have confirmed that your setup is working, add these two tags to make Scaleway boot process to run kexec by itself:


Add the first tag, press space, then add the second tag, press space again.

Reboot your server (using reboot via SSH) and profit!

Note: if you previously disabled some services, you can restart these now:

systemctl enable --now ...


Latest edition:

Copyright © 2021, Elouan Martinet (Exagone313) — This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.