I was trying to install Wireguard on my server (the same server that I didn't reboot for 400 days and said that I needed to reboot more frequently). I hadn't rebooted since I said that I needed to reboot more frequently.

To install the Wireguard kernel module, I needed to reboot since I couldn't find it with modprobe. I checked my backups and rebooted.

root@tundra:~# reboot
Connection to wingysam.xyz closed by remote host.
Connection to wingysam.xyz closed.

Then I used while true; do ssh root@vps; done to automatically log back in on startup. I also checked my Scaleway dashboard. The dashboard said that tundra was still running. I got logged back in.

I checked wingysam.xyz and it was still up. I checked Abide Within and it was still up. Church Alive was up too.

Wireguard, however, was not.

dmesg had nothing but ufw state changes.

I checked /var/log/apt/term.log and…

dpkg: warning: version '*-*' has bad syntax: version number does not start with digit                                                                                                       It is likely that 4.4.122-mainline-rev1 belongs to a chroot's host                                                                                                                          Module build for the currently running kernel was skipped since the                                                                                                                         kernel source for this kernel does not seem to be installed.

It seems that KVM/Qemu is in docker.

And since I can't get headers for my kernel, there's nothing I can do :(

Basically I know all of this because my friend Snekk helped me through all of it :)

Part 2

I didn't publish this post at the time of writing this second part but I realized that Scaleway has special instructions for this!

Installing and Configuring WireGuard® on Linux as a VPN server and Local boot option on Development and General Purpose Virtual Cloud Instances show how to get kernel modules working on Scaleway servers! I enabled it and rebooted.

After an hour of trying to get it to work, I noticed:

To switch to local boot on an older instance, you need to re-create it with one of our new local boot compatible images. All newly created Development or General Purpose virtual cloud Instances will use a local kernel by default. Previously created instance do not support local boot and can’t use this feature!

And I can't just nuke the server without setting up borgbackup and restoring, which would take a long time. So I can't set up Wireguard.

Also the new server type has:

  • 4 shared EPYC cores instead of 6 pinned EPYC cores
  • 80G storage instead of 200G storage
  • 400mbps network instead of 300mbps

Then I found this script on Scaleway's GitHub repository:

# Determine versions
arch="$(uname -m)"
release="$(uname -r)"

# Get kernel sources
mkdir -p /usr/src
wget -O "/usr/src/linux-${upstream}.tar.xz" "https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-${upstream}.tar.xz"
tar xf "/usr/src/linux-${upstream}.tar.xz" -C /usr/src/
ln -fns "/usr/src/linux-${upstream}" /usr/src/linux
ln -fns "/usr/src/linux-${upstream}" "/lib/modules/${release}/build"

# Prepare kernel
zcat /proc/config.gz > /usr/src/linux/.config
printf 'CONFIG_LOCALVERSION="%s"\nCONFIG_CROSS_COMPILE=""\n' "${local:+-$local}" >> /usr/src/linux/.config
wget -O /usr/src/linux/Module.symvers "http://mirror.scaleway.com/kernel/${arch}/${release}/Module.symvers"
apt-get install -y libssl-dev # adapt to your package manager
make -C /usr/src/linux prepare modules_prepare

I ran that, Levi told me to dpkg-reconfigure wireguard-dkms and then Wireguard worked!