Void Linux chroot install & exploring the Void

gdm85
Applied engineering reports
4 min readJun 21, 2016

In today’s feature story we are going to explore installation of Void Linux, with little bits of pre-chewed commands here and there.

Void Linux: http://www.voidlinux.eu/ (in case you asked: no, it does not have a decent HTTPS website)

Official Void Linux documentation: https://wiki.voidlinux.eu/Main_Page (it’s advised to read the installation instructions and play with the spinning logo for at least 5 minutes).

The general outline of this installation tutorial is to prepare the system via a chroot, then boot it via GRUB2. This is usually needed if you cannot/do not want run a live ISO for installation or if you just prefer to play around with the system in a chroot before booting it; the installation documentation is lacking for this use-case, so I decided to document how I completed this setup.

1. Debootstrapping

As first step, prepare a partition (I chose ~24G, ext4) and mount it at /mnt/voidlinux; secondly, we start from the sources of xbps and perform the equivalent of a debootstrap for Void Linux:

$ git clone https://github.com/voidlinux/xbps -b 0.51
$ cd xbps
$ ./configure
$ make -j
$ cd bin/xbps-install
$ LD_LIBRARY_PATH=../../lib/ ./xbps-install -S -R http://repo3.voidlinux.eu/current -r /mnt/voidlinux/ --verbose base-system

In case of troubles I suggest to enable the debug command-line flag to display more information.

During the installation you will be asked to trust a key with fingerprint 60:ae:0c:d6:f0:95:17:80:bc:93:46:7a:89:af:a3:2d; I could find a reference here and decided to trust it.

At the end of a successful run of the command you will see:

[...]
base-system-0.112_1: configuring ...
base-system-0.112_1: installed successfully.
107 downloaded, 107 installed, 0 updated, 107 configured, 0 removed.

2. Chroots are fun

Now it’s chroot time!

$ mount -t proc proc /mnt/voidlinux/proc
$ mount -t sysfs sys /mnt/voidlinux/sys/
$ cp /etc/resolv.conf /mnt/voidlinux/etc/
$ mount --bind /dev /mnt/voidlinux/dev
$ chroot /mnt/voidlinux/

Congratulations, you are running a Void Linux shell terminal now — albeit confined in a chroot. The command that you will use for updating packages (through the excellent xbps) is:

$ xbps-install -Suv

Although not necessary in our fresh installation, you might want to get familiar with it. It’s advised to install at least linux-firmware (if not also linux-firmware-network):

$ xbps-install linux-firmware

3. Last steps before reboot

At this point we will just add a non-root user and install some packages for the desktop environment; customizing the runit services is better be carried out from within Void Linux itself.

$ useradd -m -s /bin/bash -U -G wheel,users,audio,video,cdrom,input gdm85
$ passwd gdm85
$ xbps-install nano htop tmux # some survival tools
$ EDITOR=nano visudo # uncomment '%wheel ALL=(ALL) ALL'

At this point the non-root user is viable, let’s configure network by enabling dhcpd:

$ ln -s /etc/sv/dhcpcd /etc/runit/runsvdir/default/

If you need wireless network configuration or a static IP one, then the official documentation will provide you as needed.

Finally, let’s install the venerable XFCE4 desktop environment:

$ xbps-install -S xorg-minimal xorg-fonts xf86-input-synaptics xf86-video-intel
$ xbps-install xfce4
$ su - gdm85
# echo 'exec xfce4' > .xinitrc # an earlier draft of this tutorial wanted to propose using Cinnamon, but it failed miserably on my premises and thus was ditched

4. Reboot into the Void

As you are already running Linux with GRUB2, let’s modify /etc/grub.d/40_custom by appending a stanza like this:

menuentry 'Void Linux' — class gnu-linux — class gnu — class os {
recordfail
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod fat
set root='hd2,msdos9'
search — no-floppy — fs-uuid — set=root aaaaaaaaa-bbbb–cccc–dddd-eeeeeeeeeee
linux /boot/vmlinuz-4.6.2_3 root=/dev/disk/by-uuid/414458ac-8060–4e99–8947-ab43ff388dc5 ro
initrd /boot/initramfs-4.6.2_3.img
}

Then running update-grub will suffice for this new menu entry to be available at boot.

5. Final comments

The boot process — probably thanks to runit — it’s blazing fast; you get a viable Linux with a desktop environment by following the easy steps described above; some work will be needed if you have slightly more exotic hardware to configure (sound, 3D etc).

First thing I tried to do was removing tumblerd, dependency of xfce4, and was disappointed, but I understand there might be other ways to perform this operation.

Please leave your post-modern init systems at the door.

Void Linux holds great promise to be a good operative system for developers, I will definitely give it a try from time to time. And it does not run systemd.

--

--

gdm85
Applied engineering reports

Thinker, software developer, cryptography passionate and an avid reader of science and technology.