iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🐧

Installing Void Linux

に公開
2023/12/21

Installing Void Linux

a

Introduction

The original article is as follows.

https://omemoji.com/articles/void_linux

I decided to install Void Linux on my main PC (ThinkPad E14 Gen 3) for daily use. Note that this article is intended for people with some experience using Linux and is not highly recommended for those touching Linux for the first time.

What is Void Linux?

Since there is very little information available in Japanese (some might even be learning about it for the first time through this article), let's take a look at the official English website.

https://voidlinux.org

Void Linux is a Linux distribution (hereafter referred to as "distro"). It has the following characteristics:

  • It is independent, not a derivative of any existing distro
  • Rolling release
  • Uses runit as the init system (the program that starts all other processes) instead of systemd
  • Supports two types of C libraries: glibc and musl
  • Uses a custom-developed package manager called XBPS
  • There is a system called xbps-src, similar to AUR in Arch Linux (see the link for details. Google Chrome is installed using this)

While its recognition is low in Japan (it doesn't even have a Wikipedia article), its rating on DistroWatch is quite high at 9.3/10, suggesting it has a loyal following.

Motivation for Installation

Up until now, I have been using Debian and Ubuntu Server for daily use. While these are excellent distros that combine high flexibility and stability, they have the following drawbacks:

  • Versions of applications and the kernel become outdated because of the emphasis on stability
  • There is a need to periodically upgrade the version of the OS itself

Therefore, I decided to look for a distro that meets these two conditions:

  • Relatively new versions of applications are available
  • Large-scale upgrades are unnecessary by continuously and frequently updating applications and the system (generally known as a rolling release)

Furthermore, since I like Debian, I also prioritized these conditions:

  • Installation and configuration methods are not overly complex
  • Update frequency is not too high, and it has a reasonable level of stability
  • High flexibility (installation without a desktop environment is possible)
  • Active community (it would be a problem if development suddenly ended)

A convenient distro existed that met all these criteria. That is Void Linux.

Installation

https://voidlinux.org/download

There is a live image that can be installed with the Xfce environment, but I chose the "base" version because I wanted to build the desktop environment from scratch.

The installation process should be fine if you follow the guide below. By the way, if you are booting via BIOS instead of UEFI, you don't need an EFI System Partition (the one you mount to /boot/efi).

http://note.kurodigi.com/voidlinux-uefi-install

Setup and Configuration After Installation

From here, I will list the features of each function in Void Linux and some settings that might seem a bit tedious.
The official documentation is very thorough, so please refer to the links provided.

Also, troubleshooting for Linux-related issues in general, not just Void Linux, can often be resolved by searching on Reddit. It is useful to create an account there.

Scripts

http://github.com/omemoji/dotfiles

I have prepared dotfiles that include an installation script.

git clone http://github.com/omemoji/dotfiles.git
cd dotfiles
make void-ja

You can set everything up using these (run at your own risk). I think it's a good idea to fork it and customize it to your liking.
For example, the list of applications to be installed is managed in /pkg/xbps.txt, so you can freely customize what to install by editing it.

By the way, these dotfiles also support Debian and macOS.

runit

https://docs.voidlinux.org/config/services/index.html

Most other distros use systemd for system and session management, but Void Linux uses runit.

To explain the basic usage, for example, if you want to keep D-Bus running all the time, you would do it like this:

sudo ln -snfv /etc/sv/dbus /var/service/

It seems that services are enabled by creating symbolic links under /var/service. Additionally, for enabled services, you can perform operations such as:

# sv up <services> // Start
# sv down <services> // Stop
# sv restart <services> // Restart
# sv status <services> // Check status

The fact that only services manually linked under /var/service are monitored and executed by runit is tedious but easy to understand and simple. Regarding pros and cons compared to systemd, I don't really know yet because I don't have a deep understanding of init systems. In the first place, I don't remember messing with systemd that much in daily use (it seems applications set it up automatically upon installation; I would only rarely check the status with systemctl status hoge).

D-Bus & elogind (Important)

https://docs.voidlinux.org/config/session-management.html

If you forget to set this up, you will encounter various issues. Install both immediately and have runit start them with:

sudo ln -snfv /etc/sv/dbus /var/service/
sudo ln -snfv /etc/sv/elogind /var/service/

Xorg (Desktop Environment)

https://docs.voidlinux.org/config/graphical-session/xorg.html

Reading this will usually solve most things. Since I wanted to use i3, I installed the following for now:

xorg i3 dmenu i3-lock xsslock xautolock polybar picom

Note that xorg-minimal will not function properly unless you manually select drivers and other components correctly.

I don't use a display manager and start with startx. In that case, for i3, write the following in ~/.xinitrc:

exec dbus-run-session i3

If I didn't include dbus-run-session, Thunar (file manager) or fcitx5 did not work properly.

To provide a session bus, you can start a given program (usually a window manager or interactive shell) with dbus-run-session(1). Most desktop environments, if launched through an adequate display manager, will launch a D-Bus session themselves. (Quoted from https://docs.voidlinux.org/config/session-management.html#d-bus)

It seems this means starting the D-Bus session at the same time as the desktop environment.

If using a Display Manager

LightDM is recommended.

lighdm lightdm-gtk-greeter

After installing it, start it with runit:

sudo ln -snfv /etc/sv/lightdm /var/service/

Japanese Input

Use fcitx5.

sudo xbps-install \
xprop \
fcitx5 \
fcitx5-mozc \
fcitx5-gtk \
fcitx5-gtk+2 \
fcitx5-gtk+3 \
fcitx5-qt \
fcitx5-configtool

Sound

Read and configure carefully according to https://docs.voidlinux.org/config/media/pipewire.html. After the setup mentioned above, I added the following to ~/.xinitrc:

pipewire &
pipewire-pulse &

I set it up so that it starts simultaneously with i3 via startx. It might also be fine to write this in .Xprofile.

Additionally, if you want to use Bluetooth headphones, install the following:

libspa-bluetooth bluez

Then, start it with runit:

sudo ln -snfv /etc/sv/bluetoothd /var/service/

Impressions

The configuration was more challenging than I expected, but thanks to the excellent official documentation, I've been able to use it without any issues so far. Since it's a rolling release, I feel like I can rely on this for the long term. Also, compared to Arch Linux, which is also known for its high flexibility, the updates are not as frequent and it feels more stable, which suits my lazy personality.

I struggled quite a bit with the runit settings. There are still many things I don't fully understand, but it seems convenient once you get used to it. I want to deepen my understanding of init systems while reading the documentation further.

If I encounter any insurmountable problems, I'll go back to Debian testing.

References

GitHubで編集を提案

Discussion