!! ( watch video after install for configuration tips ) !!
XMonad install on Void Linux in 2025: A Step-by-Step Guide
XMonad, a lightweight and highly customizable tiling window manager written in Haskell, is a favorite among Linux enthusiasts who crave efficiency and control over their desktop environment. However, if you’re running Void Linux—a unique, independent distribution known for its minimalist philosophy and rolling-release updates—you might have noticed that XMonad is no longer available as a pre-built package in the official Void repositories as of February 2025. Don’t worry, though! You can still install and enjoy XMonad using Haskell’s package manager, Cabal. In this guide, I’ll walk you through the process of installing XMonad on Void Linux, step by step, ensuring you have a fully functional setup tailored to your needs.
Prerequisites
Before diving into the XMonad installation, you’ll need a working X server since XMonad relies on it to manage your windows. If you haven’t set up X yet, install the essentials with Void’s XBPS package manager:
sudo xbps-install -S xorg-minimal xterm
xorg-minimal: Provides the core X server components.
xterm: A simple terminal emulator to interact with XMonad initially.
With these in place, let’s get started.
Step 1: Install Dependencies
Since XMonad is no longer in the Void repositories, we’ll build it from source using Cabal. This requires some Haskell tools and X11 development libraries. Install them with:
Replace user with your actual username. Log out, and select “XMonad” from LightDM’s session menu.
Step 5: Test and Troubleshoot
Recompile your config to catch errors:
xmonad --recompile
If it fails, double-check your dependencies and xmonad.hs syntax.
Test by pressing Mod+Shift+Enter (default Mod is Alt) to open a terminal. If it doesn’t work, ensure xterm is installed and the xmonad binary is accessible.
Choosing a Status Bar
XMonad does not come with a built-in status bar, so you will need to install and configure one separately. There are several options to choose from, each with different features and levels of customization:
xmobar: A lightweight and simple status bar written in Haskell, designed to integrate well with XMonad.
polybar: A more feature-rich and customizable bar that supports modules, system info, and various widgets.
tint2: A flexible and lightweight panel that works well with multiple window managers.
lemonbar: A minimal and scriptable bar, suitable for advanced users who want full control over their setup.
dzen2: A scriptable status bar that allows for custom formatting and data display.
To install one of these bars, use xbps-install. For example, to install polybar:
sudo xbps-install -S polybar
Once installed, you will need to configure your chosen bar and integrate it with your xmonad.hs configuration.
Final Notes
Void Linux’s rolling-release model means package availability can shift, but installing XMonad via Cabal keeps you up-to-date as of February 23, 2025. If Cabal gives you trouble, consider using Stack (sudo xbps-install -S stack, then stack install xmonad xmonad-contrib) or check the XMonad documentation for the latest tips.
You’re now ready to enjoy XMonad’s tiling goodness on Void Linux. Happy hacking!
So you want to install Void Linux, well you’ve come to the right place, so without further ado, let’s get started.
Section 1 - Select and Prepare the Device
!! NOTE: !!-ALL COMMANDS IN THIS TUTORIAL ARE RUN AS THE ROOT USER, IF YOU ARE NOT ROOT, BE SURE TO EITHER USE SUDO OR CHANGE TO ROOT
This section will cover partitioning your drive and adding encryption.
There are many tools avalable to partition your drive, tools like cfdisk, parted, gparted, gdisk, etc, we will be using fdisk.
As for encryption, we will be using luks1 since as of the writing of this, grub does not fully support luks2.
Step 1 - Partition
From the command line launch fdisk and point it to the device of your choosing, for this example I will use /dev/sdX.
once fdisk is launched with the correct device, we need to create 2 parititons, the following are the selections needed:
fdisk /dev/sdX
Create GPT partition table
Command (m for help): g
Create EFI System Partition (ESP)Command (m for help): n
Partition number (1-128, default 1): (enter for default)First sector (2048-500118158, default 2048): (enter for default)Last sector, +/-sectors or +/-size{K,M,G,T,P}...): +200M (choose 128M to 1G)Do you want to remove the signature? [Y]es/[N]o: y
Command (m for help): t
Partition type or alias (type L to list all): 1Create the root partition
Command (m for help): n
Partition number (2-128, default 2): (enter for default)First sector (2099200-500118158, default 2099200): (enter for default)Last sector, +/-sectors or +/-size{K,M,G,T,P}...): (enter for default)Write changes to the disk
Command (m for help): w
Step 2 - Encrypt
Now that the device has been partitioned, we are ready to encrypt the root volume.
Again, since grub does not fully support luks2 we will be using luks1 using the following commands.
Encrypt the root volume with the following command:
cryptsetup luksFormat --type luks1 -y /dev/sdX2
It will warn you that this action will overwrite anything on the selected disk, type YES (all caps) to accept, then it will ask you to create and verify a password.
Now the the root volume is encrypted it is locked and cannot be edited, we need to open the root volume and give it a name with the
following command: ( I am calling it cryptvoid, you can name it what ever you would like )
cryptsetup open /dev/sdX2 cryptvoid
you will be prompted for the password you just created and once verified, the encrypted root volume will be open.
Step 3 - Format Partitions
Now we are ready to format the paritions, we will make partition 1 the efi partition and install a fat filesystem and parition 2 will be the root partition with BtrFS.
format the efi parititon:
mkfs.fat -F32 -n EFI /dev/sdX1
format the root partition:
mkfs.btrfs -L Void /dev/mapper/cryptvoid
Step 4 - Create BtrFS Subvolumes
Now that we have the disk partitioned and the file systems created, now we need to create the subvolumes on the BtrFS volume.
First we will create a variable to store all the options we want to use, this is not completely necessary but will save on a lot of redundant typing
noatime = no access time, prevents sys from updating access timestamp every time a file is accessed
compress = type of compression
zstd = using Zstandard compression algorithm
discard = improve efficiency of solid state drives by allowing them to reclaim unused space
async = operation will be performed asyncronously
Now we will mount the top level subvolume.
mount -o $BTRFS_OPTS /dev/mapper/cryptvoid /mnt
Now that we have the top level subvolume mounted, it is time to create the subvolumes for root, home, and snapshots
Root subvolume
btrfs su cr /mnt/@
Home subvolume
btrfs su cr /mnt/@home
Snapshots subvolume
btrfs su cr /mnt/@snapshots
Unmount cryptvoid
umount /mnt
The last step of prep before we start the base install is to mount all the subvolumes and the EFI partition
Mount the root subvolume
mount -o $BTRFS_OPTS,subvol=@ /dev/mapper/cryptvoid /mnt
We now have our encrypted volume mounted and we need to create mountpoints for home, root, and snapshots
mkdir /mnt/{efi,home,.snapshots}
Mount the home subvolume
mount -o $BTRFS_OPTS,subvol=@home /dev/mapper/cryptvoid /mnt/home
Mount snapshots subvolume
mount -o $BTRFS_OPTS,subvol=@snapshots /dev/mapper/cryptvoid /mnt/.snapshots
While a key function and benefit of BtrFS is snapshots, there are certain directories that don’t need to be included in the snapshots, we will create some nested subvolumes
for these specific directories
mkdir -p /mnt/var/cache
btrfs su cr /mnt/var/cache/xbps
btrfs su cr /mnt/var/tmp
btrfs su cr /mnt/srv
Mount the EFI system parition
mount -o rw,noatime /dev/sdX1 /mnt/efi
Check mountpoints and verify they are correct using one of the following 2 commands
df -h
or
lsblk
Section 2 - Installation
With the drive now partitioned, the file system created, and all volumes and subvolumes mounted, we can begin the base installation of Void Linux
Step 1 - Mirror, C library, Architecture, and Base-system metapackage
While this step is not required it is a good idea to choose a mirror close to your location, A list of mirrors can be found at https://xmirror.voidlinux.org/.
However; you can just go with the default mirror if you choose to.
The closest mirror to me is Chicago, so in this example, I will use the Chicago mirror, https://mirrors.servercentral.com/voidlinux/.
Aside from which mirror you want to use, there are a few other choices you will need to make, one of these is which C library to use, Void gives the option of
using glibc (Gnu C library) or musl (designed to be more lightweight).
glibc: /current
musl: /current/musl
There is also the question of architecture, you will need to select which architecture you plan to use from the following list:
x86_64
x86_64-musl
i686
aarch64
I will use x86_64 for this example
Once you decide which mirror and library you want to use (we will be using Chicago mirror and glibc library), we can create a couple more variables to make the next
steps a little easier, we need to create a variable for our repo, and a variable for our architecture.
Now we can install the base system along with a few other odds and ends. (this tutorial will install vim and the linux-mainline kernel, if you want stable, install
linux instead of linux-mainline)
Next we will begin to configure our new install, this will involve setting a hostname, timezone, our hosts, creating an fstab, and more.
First lets look at our rc.conf, you can find and go over the options in this file in the void docs at httsp://docs.voidlinux.org/config/rc-files.conf
we can make changes in here but it is not necessary
vim /etc/rc.conf
Set timezone, you can list out all available timezones by running the following command
ls /usr/share/zoneinfo
Once you locate the timezone you need, set the timezone in the /etc/localtime file, I will set the timezone to chicago in this example
Now we will move into user management
First we need to create the root password
passwd
Now we can create a new user and give that user a password, add them the necessary groups, and give them sudo privilege
Replace <USER> with the name of the user you are adding
useradd <USER>
passwd <USER>
usermod -aG wheel, (any other groups you want to add user to) <USER>
Now we can change the shell for the root user to bash and edit the sudoers file
chsh -s /bin/bash root
EDITOR=vim visudo
Uncomment the line that says # %wheel ALL=(ALL:ALL) ALL
Then you can also add the following line below the line you just uncommented, this is not required but it is an option
<USER> ALL=(ALL:ALL) ALL
Step 5 - REPOS
Sync repositories
xbps-install -S
This step is not required unless you want to be able to access software that does not have free licenses or if you are a gamer or need 32bit packages
If you want to use wifi you can use wpa-supplicant or you can install Network Manager
I prefer to use Network Manager so that is what I will use as an example