Installing Nebula on a Sipeed NanoKVM

Although the Sipeed NanoKVM very conveniently comes with Tailscale pre-installed, I prefer to use Nebula. Thankfully, the NanoKVM is still just a Linux system under the hood that you can easily SSH into and play around with. Furthermore, there just so happens to be RISC-V builds of Nebula published on GitHub, so the installation process is quite similar to my previous post where I set up Nebula on OpenBSD. These steps assume you already know how to set up Nebula in general, so check out the official quick start guide if you need help with that first.

Step 1: Enable SSH in the NanoKVM GUI options (please change the default password) and SSH in.

Step 2: Download and extract the Nebula binaries and place them in /usr/sbin/

Step 3: Create /etc/nebula and put your Nebula config files there.

Step 4: An init script needs to be created that will automatically start Nebula on boot. Create a file at /etc/init.d/S90Nebula and paste this into it:

#!/bin/sh

DAEMON=/usr/sbin/nebula
CONFIG=/etc/nebula/config.yml

case "$1" in

  start)
    while [ "$(date +%Y)" = "1970" ]; do
      sleep 1
    done
    $DAEMON -config $CONFIG &
    ;;

  stop)
    killall nebula
    ;;

  restart|reload)
    killall nebula
    $DAEMON -config $CONFIG &
    ;;

  *)
    echo "Usage: $0 {start|stop|restart|reload}"
    exit 1
    ;;

esac

Note that when the NanoKVM boots up, its internal date starts at 1970 until it connects to a time server to fetch the real date. This confuses Nebula and causes it to error out, so the script waits until it's not 1970 anymore to actually start Nebula. Admittedly a pretty jank workaround, but it's good enough for me.

Assuming everything is set up properly, Nebula should now automatically launch at the next reboot and be reachable at its Nebula address!

Home