This guide details the process of manually installing Void via a chroot on an x86, x86_64 or aarch64 architecture. It is assumed that you have a familiarity with Linux, but not necessarily with installing a Linux system via a chroot. This guide can be used to create a "typical" setup, using a single partition on a single SATA/IDE/USB disk. Each step may be modified to create less typical setups, such as full disk encryption.
Void provides two options for bootstrapping the new installation. The XBPS method uses the XBPS Package Manager running on a host operating system to install the base system. The ROOTFS method installs the base system by unpacking a ROOTFS tarball.
The XBPS method requires that the host operating system have XBPS installed. This may be an existing installation of Void, an official live image, or any Linux installation running a statically linked XBPS.
The ROOTFS method requires only a host operating system that can enter a Linux chroot and that has both tar(1) and xz(1) installed. This method may be preferable if you wish to install Void using a different Linux distribution.
mkfs.vfat(8) is also available to create FAT32 partitions. However, due to restrictions associated with FAT filesystems, it should only be used when no other filesystem is suitable (such as for the EFI System Partition).
For a UEFI booting system, make sure to create an EFI System Partition (ESP).
The ESP should have the partition type "EFI System" (code
EF00) and be
formatted as FAT32 using mkfs.vfat(8).
If you're unsure what partitions to create, create a 1GB partition of type "EFI
EF00), then create a second partition of type "Linux Filesystem"
8300) using the remainder of the drive.
Format these partitions as FAT32 and ext4, respectively:
# mkfs.vfat /dev/sda1 # mkfs.ext4 /dev/sda2
This guide will assume the new root filesystem is mounted on
/mnt. You may
wish to mount it elsewhere.
If using UEFI, mount the EFI System Partition as
For example, if
/dev/sda2 is to be mounted as
dev/sda1 is the EFI
# mount /dev/sda2 /mnt/ # mkdir -p /mnt/boot/efi/ # mount /dev/sda1 /mnt/boot/efi/
Initialize swap space, if desired, using mkswap(8).
Follow only one of the two following subsections.
If on aarch64, it will be necessary to install a kernel package in addition to
base-system. For example,
linux is a kernel package that points to the
latest stable kernel packaged by Void.
XBPS also needs to know what architecture is being installed. Available options
i686 for PC architecture computers and
This architecture must be compatible with your current operating system, but does not need to be the same. If your host is running an x86_64 operating system, any of the three architectures can be installed (whether the host is musl or glibc), but an i686 host can only install i686 distributions.
Copy the RSA keys from the installation medium to the target root directory:
# mkdir -p /mnt/var/db/xbps/keys # cp /var/db/xbps/keys/* /mnt/var/db/xbps/keys/
Use xbps-install(1) to bootstrap the
installation by installing the
# XBPS_ARCH=$ARCH xbps-install -S -r /mnt -R "$REPO" base-system
Download a ROOTFS tarball matching your architecture.
Unpack the tarball into the newly configured filesystems:
# tar xvf void-<...>-ROOTFS.tar.xz -C /mnt
With the exception of the section "Install base-system (ROOTFS method only)", the remainder of this guide is common to both the XBPS and ROOTFS installation methods.
# xchroot /mnt /bin/bash
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
Update the package manager and install
[xchroot /mnt] # xbps-install -Su xbps [xchroot /mnt] # xbps-install -u [xchroot /mnt] # xbps-install base-system [xchroot /mnt] # xbps-remove base-voidstrap
nvi(1) is available in the chroot, but you may wish to install your preferred text editor at this time.
For glibc builds, generate locale files with:
[xchroot /mnt] # xbps-reconfigure -f glibc-locales
To set a root password, run:
[xchroot /mnt] # passwd
The fstab(5) file can be automatically
generated from currently mounted filesystems by copying the file
[xchroot /mnt] # cp /proc/mounts /etc/fstab
Remove lines in
/etc/fstab that refer to
Replace references to
/dev/nvmeXnYpZ, etc. with their respective
UUID, which can be found by running
blkid(8). Referring to filesystems by their
UUID guarantees they will be found even if they are assigned a different name at
a later time. In some situations, such as booting from USB, this is absolutely
essential. In other situations, disks will always have the same name unless
drives are physically added or removed. Therefore, this step may not be strictly
necessary, but is almost always recommended.
Change the last zero of the entry for
1, and the last zero of every
other line to
2. These values configure the behaviour of
For example, the partition scheme used throughout previous examples yields the
/dev/sda1 /boot/efi vfat rw,relatime,[...] 0 0 /dev/sda2 / ext4 rw,relatime 0 0
The information from
blkid results in the following
UUID=6914[...] /boot/efi vfat rw,relatime,[...] 0 2 UUID=dc1b[...] / ext4 rw,relatime 0 1
Note: The output of
/proc/mounts will have a single space between each field.
The columns are aligned here for readability.
Add an entry to mount
/tmp in RAM:
tmpfs /tmp tmpfs defaults,nosuid,nodev 0 0
If using swap space, add an entry for any swap partitions:
UUID=1cb4[...] swap swap rw,noatime,discard 0 0
Use grub-install to install GRUB onto your boot disk.
On a BIOS computer, install the package
grub, then run
grub-install /dev/sdX, where
/dev/sdX is the drive (not partition) that you wish to
install GRUB to. For example:
[xchroot /mnt] # xbps-install grub [xchroot /mnt] # grub-install /dev/sda
On a UEFI computer, install either
grub-arm64-efi, depending on your architecture, then run
optionally specifying a bootloader label (this label may be used by your
computer's firmware when manually selecting a boot device):
[xchroot /mnt] # xbps-install grub-x86_64-efi [xchroot /mnt] # grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id="Void"
If EFI variables are not available, add the option
--no-nvram to the
Unfortunately, not all systems have a fully standards compliant UEFI
implementation. In some cases, it is necessary to "trick" the firmware into
booting by using the default fallback location for the bootloader instead of a
custom one. In that case, or if installing onto a removable disk (such as USB),
add the option
--removable to the
Alternatively, use mkdir(1) to create the
/boot/efi/EFI/boot directory and copy the installed GRUB executable, usually
/boot/efi/EFI/Void/grubx64.efi (its location can be found using
efibootmgr(8)), into the new folder:
[xchroot /mnt] # mkdir -p /boot/efi/EFI/boot [xchroot /mnt] # cp /boot/efi/EFI/Void/grubx64.efi /boot/efi/EFI/boot/bootx64.efi
Use xbps-reconfigure(1) to ensure all installed packages are configured properly:
[xchroot /mnt] # xbps-reconfigure -fa
This will make dracut(8) generate an initramfs, and will make GRUB generate a working configuration.
At this point, the installation is complete. Exit the chroot and reboot your computer:
[xchroot /mnt] # exit # umount -R /mnt # shutdown -r now
After booting into your Void installation for the first time, perform a system update.