Install alongside Arch Linux

This is a guide for installing Void Linux next to/alongside of Arch Linux. This guide assumes you already have and are familar/have access to the Arch Installation Guide/wiki.

Pre-installation

First off you need to have a functioning arch installation, if you haven't already go and finish that. You should also probably grab a AUR helper for your Arch installation to make your life easier.

Verify boot mode

Its worth checking if you are currently booted in UEFI or BIOS mode, as you can't install a UEFI version of an OS with a system running BIOS (due to missing efi variables)

# ls /sys/firmware/efi/efivars

If this directory doesn't exist you are running with BIOS, likewise if it does exist you are currently booted using UEFI

Setting up the disks

Void only needs one partition, though it is recommeneded to have some swap lying around. Feel free to partition your disks however you like, the specifics don't matter much and as such won't be covered here, there are much better resources for the how such as the Arch Wiki for this information. The same goes for partitioning, which a simple ext4 partition will do.

Mounting

Mounting is relativly simple to take care of, simply mount your drives to the relative locations for each mount point.

# mkdir -p /mnt/voidlinux
# mount /dev/sda4 /mnt/voidlinux
# swapon /dev/sda2 /mnt/voidlinux

We'll later take advantage of genfstab to generate the fstab

Install arch packages

Now that we are almost ready to install the base we will install the tools needed for the install. You'll need to install xbps (Void's package manager) and arch-install-scripts (Scripts such as genfstab and arch-chroot are a part of this package).

# pacman -S arch-install-scripts
# <AUR-TOOL> xbps

Mirrors

Its recommended to use the fastest mirror for you, rather than using the default mirrors. Here's a list of current, offical mirrors XBPS#Official_Repositories. Anytime you see the default mirror used in this guide, simply replace it with the best mirror for you.

Installation

Now that we got everything setup and ready to go, its time to install Void. Currently there are two different "flavours" of void which each use a different C library.

glibc

This is the 30 year old C library provided by GNU, it has the most packages and best program compatibility as most programs are made/compiled against glibc.

# xbps-install -S -R https://alpha.de.repo.voidlinux.org/current/ -r /mnt/voidlinux base-system
Note: Note that on archlinux xbps-install locates the pkgdb in /var/lib/xbps to be in line with arch conventions. So after installing you have to manually move all the files in the install directory to /var/db/xbps. Otherwise all the xbps tools will report no packages installed.

musl libc

This is the new kid on the block. musl is a new standard library to power a new generation of Linux-based devices. musl is lightweight, fast, simple, free, and strives to be correct in the sense of standards-conformance and safety. This does come with the downside of not all programs being able to run and/or compile on musl, so use at your own risk.

Note: Whenever you perform an installation of an architecture different to the one you are running on right now, export XBPS_ARCH accordingy, so that xbps-install fetches the files for the desired arch, see the manpage for details. Example export XBPS_ARCH=x86_64-musl
# export XBPS_ARCH=x86_64-musl
# xbps-install -S -R https://alpha.de.repo.voidlinux.org/current/musl -r /mnt/voidlinux base-system
Note: Notice the /musl at the end of the mirror, this is important if you want musl, as otherwise musl can NOT be installed. (You can append /musl to then end of most mirrors without issue)

Setup

Now that we have the base system installed, we can chroot into our install and configure everything. We can also use the tools we installed earlier to make this process easier.

fstab

Since we can't exactly access arch tools in the chroot jail, we'll setup the fstab now.

# genfstab -U /mnt/voidlinux >> /mnt/voidlinux/etc/fstab
Note: Check /mnt/voidlinux/etc/fstab in a text editor to ensure that everything is correct
/mnt/voidlinux/etc/fstab
#
# See fstab(5).
#
# <file system> <dir>   <type>  <options>               <dump>  <pass>
UUID=dcdd0c5a-020b-4167-a10d-cb81d71e2ae6 /      ext4       rw,relatime,data=ordered  0 1
UUID=cfb8be30-1866-44a6-bdf5-60ced2a454f4 swap   swap       rw,noatime,discard        0 0
tmpfs                                     /tmp   tmpfs      defaults,nosuid,nodev     0 0

chroot

# touch /mnt/voidlinux/etc/resolv.conf
# arch-chroot /mnt/voidlinux

Verify installation is correct

Now we can check the directory structure to verify everything was installed correctly.

# ls -la

The directory structure should look something akin to this output.

total 12
drwxr-xr-x 16 root root 4096 Jan 17 15:27 .
drwxr-xr-x  3 root root 4096 Jan 17 15:16 ..
lrwxrwxrwx  1 root root    7 Jan 17 15:26 bin -> usr/bin
drwxr-xr-x  4 root root  127 Jan 17 15:37 boot
drwxr-xr-x  2 root root   17 Jan 17 15:26 dev
drwxr-xr-x 26 root root 4096 Jan 17 15:27 etc
drwxr-xr-x  2 root root    6 Jan 17 15:26 home
lrwxrwxrwx  1 root root    7 Jan 17 15:26 lib -> usr/lib
lrwxrwxrwx  1 root root    9 Jan 17 15:26 lib32 -> usr/lib32
lrwxrwxrwx  1 root root    7 Jan 17 15:26 lib64 -> usr/lib
drwxr-xr-x  2 root root    6 Jan 17 15:26 media
drwxr-xr-x  2 root root    6 Jan 17 15:26 mnt
drwxr-xr-x  2 root root    6 Jan 17 15:26 opt
drwxr-xr-x  2 root root    6 Jan 17 15:26 proc
drwxr-x---  2 root root   26 Jan 17 15:39 root
drwxr-xr-x  3 root root   17 Jan 17 15:26 run
lrwxrwxrwx  1 root root    8 Jan 17 15:26 sbin -> usr/sbin
drwxr-xr-x  2 root root    6 Jan 17 15:26 sys
drwxrwxrwt  2 root root    6 Jan 17 15:15 tmp
drwxr-xr-x 11 root root  123 Jan 17 15:26 usr
drwxr-xr-x 11 root root  150 Jan 17 15:26 var

Setting and checking root

Our next step is to change roots password.

# passwd root

And ensure root permissions are correct. (This should only be necessary if the above structure wasn't correct, otherwise you can skip this)

# chown root:root /
# chmod 755 /

Setting up rc.conf and hostname

Create a hostname for this system.

# echo <HOSTNAME> > /etc/hostname

Now edit rc.conf to set some system wide settings.

/etc/rc.conf
# /etc/rc.conf - system configuration for void

# Set the host name.
#
# NOTE: it's preferred to declare the hostname in /etc/hostname instead:
#       - echo myhost > /etc/hostname
#
HOSTNAME="<HOSTNAME>"

# Set RTC to UTC or localtime.
HARDWARECLOCK="UTC"

# Set timezone, availables timezones at /usr/share/zoneinfo.
TIMEZONE="America/Los_Angeles"

# Keymap to load, see loadkeys(8).
KEYMAP="us"

# Console font to load, see setfont(8).
#FONT="lat9w-16"

# Console map to load, see setfont(8).
#FONT_MAP=

# Font unimap to load, see setfont(8).
#FONT_UNIMAP=

# Kernel modules to load, delimited by blanks.
#MODULES=""

Set Locales

This next step only applies if you use glibc, otherwise you can move onto the next step. Select your locale by editing /etc/default/libc-locales

/etc/default/libc-locales
...
#en_NZ ISO-8859-1
#en_PH.UTF-8 UTF-8
#en_PH ISO-8859-1
#en_SG.UTF-8 UTF-8
#en_SG ISO-8859-1

en_US.UTF-8 UTF-8

#en_US ISO-8859-1
#en_ZA.UTF-8 UTF-8
#en_ZA ISO-8859-1
#en_ZM UTF-8
#en_ZW.UTF-8 UTF-8
#en_ZW ISO-8859-1
#es_AR.UTF-8 UTF-8
#es_AR ISO-8859-1
#es_BO.UTF-8 UTF-8
#es_BO ISO-8859-1
#es_CL.UTF-8 UTF-8
#es_CL ISO-8859-1
#es_CO.UTF-8 UTF-8
#es_CO ISO-8859-1
#es_CR.UTF-8 UTF-8
#es_CR ISO-8859-1
#es_CU UTF-8
...

Now that we've established our locale, we need to reconfigure the glibc-locales package for our locale

# xbps-reconfigure -f glibc-locales

Initramfs

We now want to setup dracut and we'll start by creating some dracut configs.

# touch /etc/dracut.conf.d/default.conf
/etc/dracut.conf.d/default.conf
# Sample dracut config file

# build initrd only to boot current hardware
hostonly="yes"

# set the directory for temporary files
# default: /var/tmp
tmpdir=/tmp

This sets up a fairly default config for dracut, if you are wanting to change/read through other options checkout the dracut wiki page.

Now we want to check /lib/modules to get the kernel version.

# cd /lib/modules
# ls -la

This will return something akin to:

drwxr-xr-x  3 root root   21 Jan 13 17:47 .
drwxr-xr-x 23 root root 8192 Jan 13 17:47 ..
drwxr-xr-x  3 root root 4096 Jan 13 17:47 4.14.13_1

Seeing that our current kernel version is 4.14.13_1 (as of writing) we can remake the initramfs since we changed the dracut config.

# dracut --force --kver 4.14.13_1

Finishing up

Now that Void is installed you can exit the chroot, tell your boot manager where to find Void, unmount partitions, and reboot.

# exit
# grub-mkconfig -o /boot/grub/grub.cfg # or however your boot manager reloads its config for a new OS
# umount -R /mnt/voidlinux

Post Installation

Void is different than Arch (duh) and therefore not everything is the same. Familiarise yourself with xbps and xbps-src, Runit is simpler and operates differently from systemd. Also check out the Post Installation article from where to head from here.

Troubleshooting

If GRUB cannot be found (a note about UEFI)

Void's Grub install, by default, installs the *.efi file as /boot/efi/EFI/GRUB/grubx64.efi. However, some UEFI implementations look for the file by a different name, and in a different subdirectory.

Copy grubx64.efi to another location, expected by some implementations:

mkdir /boot/efi/EFI/BOOT
cp -p /boot/efi/EFI/GRUB/grubx64.efi /boot/efi/EFI/BOOT/BOOTX64.efi

Alternatively, some implementations are case-sensitive, and seek the same file, with a lower-case name:

mkdir /boot/efi/EFI/BOOT
cp -p /boot/efi/EFI/GRUB/grubx64.efi /boot/efi/EFI/BOOT/bootx64.efi
This article is issued from Voidlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.