Supercharge your Cloud 1 - Installing Void Linux on Hetzner VPSs
Published 13 November 2020
Tags: #void, #linux, #sysadmin, #hetzner, #cloud
Systemd sucks , , , ,  but Hetzner Cloud rocks, and is one of my favourite VPS providers. Hetzner has been providing Debian, Arch Linux, Ubuntu and CentOS images for cloud VPS instances, but wait! They all use systemd! I have been using Void Linux for years now on mostly all of my devices. I have even built a PDA that runs Void Linux .
Those days, I was building a personal cloud instance with a few servers (more details in the following write-up posts), and I ran into some very annoying issues that were directly caused by the unnecessary complexity of systemd. Docker was definitely resource overkill for this task.
Let's jump straight to the guide on how to install Void Linux on a Hetzner Cloud VPS instance.
The first step is to create a server on your Hetzner Cloud account. Choose Ubuntu as the initial OS image choice. Do not add any volume or SSH key in the initial configuration wizard, as those will have to be manually managed after installing Void. Do not upload anything on the server. The root partition will be formatted and wiped out!
After installing, turn off the server and boot in rescue mode.
You will be provided with an username (
root) and a password for the rescue system. Copy this password somewhere!
Now is time to login into the rescue system by SSH-ing into the server, as you would normally do with the IPv4 address that Hetzner shows at the top of the server page:
Login with the password Hetzner has just provided you, and run the
installimage script. The following menu will be shown, choose custom_image.
installimage will then open an editor with a configuration file. Scroll down to the line containing
HOSTNAME and change the value to the machine hostname you are going to set later.
Time to choose what image to install on the server! We will need a ROOTFS tarball of the system. I have not tested the
musl version and therefore I cannot recommend to use it. The standard
glibc version works very fine for me.
Go on the Void Linux downloads repository , scroll down at the very end and copy the link of the x86_64 ROOTFS tarball. The file name will be something like this¸ but the build date will obviously become different in the future.
Be sure that the URL you have been copied looks like this:
Now, go back to your rescue system SSH session, where we left it at the
installimage config editor, scroll down at the end of the config file, at the line starting with
IMAGE, and paste the Void Linux ROOTFS tarball URL after the word
IMAGE, on the same line, like this:
You could change other settings in the config file, such as the disks partitioning, but for simplicity I have been sticking with the default, single root ext4 partition.
Press F2 to save and then press F10 to exit. Hetzner's
installimage script will format the
/dev/sda and unpack the Void tarball automatically. It will probably fail at the end, but don't worry!
Now, the installer will probably exit with an error. We should be fine if it has unpacked the tarball correctly in the
/dev/sda1 partition. Now check if there is an ext4 partition in there, run:
Now, mount it to
mount /dev/sda1 /mnt
/mnt/ contains the Void ROOTFS tarball contents.
ls -lah /mnt
The rest of the guide is pretty much the guide for installing Void from chroot , but is not identical! Some steps are different (or not needed). Though, I will still report the rest of the steps you need for setting up your Void VPS on Hetzner.
Mount the pseudo-filesystems needed for a chroot:
for i in sys dev proc; do mount --rbind /$i /mnt/$i && mount --make-rslave /mnt/$i; done
Copy the DNS configuration into the new root so that XBPS can still download new packages inside the chroot:
cp /etc/resolv.conf /mnt/etc/
Chroot into the new installation:
PS1='(chroot) # ' chroot /mnt/ /bin/bash
Congrats! You're in the chroot.
Check the internet connection:
ROOTFS images generally contain out of date software, due to being a snapshot of the time when they were built, and do not come with a complete
base-system. Update the package manager and install
xbps-install -Su xbps
Specify the hostname in
/etc/hostname. Use the same one you used in the previous step when editing Hetzner
echo 'yourhostname' > /etc/hostname
For glibc builds, generate locale files with:
xbps-reconfigure -f glibc-locales
Install your favourite text editor. I'm ok with nano.
xbps-install -S nano
/etc/fstab. This is very simple
fstab is OK. See the references  for more.
proc /proc proc defaults 0 0
/dev/sda1 / ext4 defaults,discard 0 0
Install GRUB. Hetzner uses DOS disk partitioning.
Use xbps-reconfigure(1) to ensure all installed packages are configured properly:
Congrats! You have now installed Void on Hetzner Cloud. You will need a couple of config tweaks before rebooting into a working install. Don't exit from the
chroot shell yet!
While still in the chroot, enable the
ln -s /etc/sv/dhcpcd /var/service/
sshd service for remote login through SSH. I suggest you also install
ssh-audit, and check out the awesome SSH HARDENING GUIDES  to ensure that your Void VPS is safe and sound from unwanted remote logins.
ln -s /etc/sv/sshd /var/service/
Copy your SSH public key to your local PC clipboard and save it in the VPS root account
authorized_keys file, to later authorize your remote SSH login sessions.
Change the root password
Add an additional user
useradd --shell /bin/bash voiduser
Change its password
That's all! Have fun with your Void Linux VPS!
reboot and login with SSH, as usual, into your fresh new Void Linux VPS!
Uncomplicated Firewall. Don't enable before allowing the SSH port (change it from 22 to the port you are using if you changed it in your
xbps-install -S ufw
ln -s /etc/sv/ufw /var/service/ufw
ufw allow 22
dtach and dvtm 
xbps-install -S dtach
dtach -A ~/dvtm-session -r winch dvtm
||#systemdsucks on freenode!