Installing Void Linux on hetzner

by Gabriel M. Dutra

Hi, Void Users!!

Recently, I installed Void Linux on my ThinkPad E14 and, to my surprise many packages were out of date. To help the distro I’m learn how to contribute to Void Linux and to do that I created a machine on Hetzner to build and test the packages.

Enable Rascue

We need to create a machine with any Linux distro and after the machine is created, we need to enable rascue and reboot the machine.

Now, with rascue enable, connect to machine using SSH.

Installing the Void Linux

Now, we will install the Void Linux. The first step is format the disk and create the partitions.

wipefs -a /dev/sda
cfdisk /dev/sda

I will create three partition:

/dev/sda1: Boot /dev/sda2: Swap /dev/sda3: /

Formating partitions

There’re many filesystem options, in my case I will installing using XFS, but, the proccess is equal to any filesystem.

mkfs.fat -F 32 /dev/sda1
mkswap /dev/sda2
mkfs.xfs /dev/sda3

My fdisk:

Disk /dev/sda: 305.18 GiB, 327684194304 bytes, 640008192 sectors
Disk model: QEMU HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x230284c3

Device     Boot    Start       End   Sectors   Size Id Type
/dev/sda1  *        2048   1955839   1953792   954M 83 Linux
/dev/sda2        1955840  17580031  15624192   7.5G 82 Linux swap / Solaris
/dev/sda3       17580032 640008191 622428160 296.8G 83 Linux

Mounting

You need to mount the root partition, to do this, create a mount point:

Mounting the root partition:

mount /dev/sda3 /mnt
cd /mnt

Installation

Now we need to download the bootstrap rootfs with the Void Linux.

wget wget https://repo-default.voidlinux.org/live/current/void-x86_64-ROOTFS-20250202.tar.xz

Extract the rootfs.

tar xvf void-x86_64-ROOTFS-20250202.tar.xz -C /mnt --numeric-owner

Bind necessary filesystem

mount -t proc none /mnt/proc
mount -t sysfs none /mnt/sys
mount --rbind /dev /mnt/dev
mount --rbind /run /mnt/run

Copy the resolv.conf

cp /etc/resolv.conf /mnt/etc/resolv.conf

Enter in the chroot.

chroot /mnt /bin/bash
export PS1="(root) Void-choot # "

Updating the OS

xbps-install -Syu

Installing base system

xbps-install base-system

Installing linux, linux headers, grub and tools

xbps-install grub linux linux-base linux-headers linux-tools xtools

Grub

grub-install /dev/sda
update-grub

Configuring fstab

xgenfstab -U / >> /etc/fstab

User setup

After installation, we need to create a user to use the machine.

useradd -m <username>
passwd <username>
usermod -aG wheel,kvm <username>

Enable SSH and DHCPCD

ln -s /etc/sv/sshd /var/service/sshd
ln -s /etc/sv/dhcpcd /var/service/

Disable rascue and Reboot

Here we go!! Disable Rascue, reboot the machine and enjoy your Void server :))