In this post I go over my goals and complete the initial setup for an Arch Linux desktop.

The Purpose

The post is not intended to be a comprehensive installation guide for Arch linux or linux in general. This is merely a step-by-step walkthrough of my experiences and lessons learned during the process of setting up my own specific hardware in the way that suits me. That is not to say that there is no useful information here, only that I am not an expert and don't claim to be and as always YRMV.

The System

Disclaimers out of the way, we'll start with the current system specs:

  • Intel Core i7-3770
  • ASRock Z77 Extreme4
  • 16GB RAM
  • EVGA GeForce GTX 950 4GB
  • 16GB USB Drive
  • 2 monitors

Other hardware is mostly irrelevant. I'll be installing on a smaller secondary hard drive to leave my current Windows 7 installation intact as a backup.

The Goal

The goal is to install a working copy of Arch Linux with a functional desktop environment, desktop manager and essential applications to act as a daily machine. I'll be setting up 2 virtual machines through qemu with GPU passthrough that can be run on-demand for their specific applications:

  • Windows 10 for games and other graphically intense or Windows-only applications.
  • macOS High Sierra for xcode and other Apple-only applications.

The main linux host will run off the integrated Intel graphics leaving the GeForce card free for the virtual machine passthrough. The main monitor will be connected to this with the second monitor dedicated to whichever virtual machine is using the GPU. I chose Arch because I have some linux experience, I like a minimal base system with no extra bloat and it follows a rolling-release model which ensures the latest stable versions. This also means it may require more work than other distributions to install and get working.

Initial Preperation

The first step is to download the latest Arch Linux (2017.11.01 at the time of this writing.) Once this is downloaded it needs to be made into a bootable USB drive. In this case I'll be using Rufus, it's simple and fast. I chose the portable version because I won't be using it again after this and there's really no need to install.

Select your USB bootable drive at the top. Click the disk icon next to "Create a bootable disk using" and choose the arch iso. Change the dropdown to the "DD Image" option the click "Start", this will create an exact copy of the Arch boot disk.

[reserved for image]

Once the boot disk is created, reboot and press Del(or F2) to enter the UEFI setup. Now it's time to change some settings. These menus can vary depending on motherboard manufacturer so I'll just go over the settings I changed generally.

Firstly, I ensured that Intel Virtualization Technology and VT-d are enabled and I changed the Primary Graphics Adapter from PCI Express to Onboard. In the boot menu I changed the primary boot device to the USB boot drive I just created, Choose the UEFI partition, UEFI: SanDisk in my case. It may also be necessary to disable secure boot but in my case it was already disabled.

Save the settings and reboot, make sure to switch the plug for the primary monitor to the motherboard instead of the video card. Before you start the Arch install you may want to unplug all hard drives except the one you are installing on to prevent choosing the wrong one accidentally and overwriting your data.

Arch Linux Setup

Once the USB drive boots choose "Arch Linux archiso x86_64 UEFI CD" and after some time you should get a console prompt.

The following section is heavily based on the Arch Linux Setup Guide there is more information there if you are looking.

Pre-install Prep

Make sure you are in UEFI mode.

root@archiso ~ # ls /sys/firmware/efi/efivar

You should see a listing of a bunch of variable names. If it doesn't exist then reboot and make sure you choose the UEFI boot disk.=

Make sure you can access the internet.

root@archiso ~ # ping

You should get a ping reply. In my case I have a wired network and there is no additional setup required.

Update the system time via ntp.

root@archiso ~ # timedatectl set-ntp true

Disk Partitioning

In this case I will be going with a simple single partition scheme + EFI. This may not be ideal for system seperation, you can certainly go with a more complex and better scheme but I'm looking mostly for quick and easy in this case. I won't be adding swap space right now but I may add a swapfile in the future. I'll be using fdisk for partitioning.

List your disk devices.

root@archiso ~ # lsblk
loop0 7:0 0 408.5M 1 loop /run/archiso/airootfs
sda 8:0 0 119.2G 0 disk
|-sda1 8:1 0 119.2G 0 part
sdb 8:16 1 14.5G 0 disk
|-sdb1 8:17 1 523M 0 part
|-sdb2 8:18 1 64M 0 part

Here I have my hard drive sda and my removable boot USB disk sdb. I've unplugged all my other drives temporarily as a precaution so there are no others listed.

Start fdisk for the correct drive.

root@archiso ~ # fdisk /dev/sd

Create a GPT partition table.

Command (m for help): g
Created a new GPT disklabel ...

Create a UEFI boot partition of 512MB(type EFI System). More info about UEFI boot partitions.

Command (m for help): n
Partition number (1-128, default 1): (Press enter to accept default)
First sector (2048-250069646, default 2048): (Press enter to accept default)
Last sector, +sectors or +size{K,M,G,T,P} (2048-250069646, default 250069646): +512M
Created a new partition 1 of type 'Linux filesystem' and of size 512 MiB.
Command (m for help): t
Selected partition 1
Partition type (type L to list all types): 1
Changed type of partition 'Linux filesystem' to 'EFI System'.

Create the main root partition of remaining space (type Linux filesystem)

Command (m for help): n
Partition number (1-128, default 2): (Press enter to accept default)
First sector (2048-250069646, default 1050624): (Press enter to accept default)
Last sector, +sectors or +size{K,M,G,T,P} (2048-250069646, default 250069646): (Press enter to accept default)
Created a new partition 2 of type 'Linux filesystem' and of size 118.8 GiB.

Write changes to disk (no turning back!)

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

Check partition names, make note of the UEFI partition (sda1 in my case) and the root partition (sda2 in my case)

root@archiso ~ # lsblk
loop0 7:0 0 408.5M 1 loop /run/archiso/airootfs
sda 8:0 0 119.2G 0 disk
|-sda1 8:1 0 512M 0 part
|-sdb2 8:2 0 118.8G 0 part
sdb 8:16 1 14.5G 0 disk
|-sdb1 8:17 1 523M 0 part
|-sdb2 8:18 1 64M 0 part

Format the root partition

root@archiso ~ # mkfs.ext4 /dev/sda2
Creating filesystem with 31127377 4k blocks and 7782400 inodes
Writing superblocks and filesystem accounting information: done

Mount the new root filesystem

root@archiso ~ # mount /dev/sda2 /mnt

Create the boot directory and mount the UEFI partition

root@archiso ~ # mkdir /mnt/boot
root@archiso ~ # mount /dev/sda1 /mnt/boot

Base System Installation

Here you can choose better package mirrors (see install guide) but the defaults seem to work fine in most cases. Now install the base Arch Linux system to the new root partition.

root@archiso ~ # pacstrap /mnt base

Generate the fstab for your disks, I'm using the disk UUID to identify them.

root@archiso ~ # genfstab -U /mnt >> /mnt/etc/fstab

Chroot into the newly created base system.

root@archiso ~ # arch-chroot /mnt

System Setup

List the available timezones to help you choose, I'm listing American zones here, you can replace America with Canada, Europe, etc.

[root@archiso /]# ls /usr/share/zoneinfo/America

Now you can set the timezone, I'll be using Chicago for Central time.

[root@archiso /]# ln -sf /usr/share/zoneinfo/America/Chicago /etc/localtime

Set the hardware clock from the system clock, we're going to store the current time in UTC in the hardware. if you dual boot windows you may need to make consierations for this since windows expects local time for the hardware clock.

[root@archiso /]# hwclock --systohc

Uncomment your chosen locale(s) in /etc/locale.gen in my case en_US.UTF-8 and run locale-gen.

[root@archiso /]# nano /etc/locale.gen
en_US.UTF-8 [enter]
[ctrl+w] [enter]

#en_US.UTF-8 UTF-8
en_US.UTF-8 UTF-8

[crtl+o] [enter]
[root@archiso /]# locale-gen

Set the lang variable in locale.conf to your preferred locale.

[root@archiso /]# nano /etc/locale.conf
[ctrl+o] [enter]

Set your hostname, I'll be calling my machine linux-pc.

[root@archiso /]# nano /etc/hostname
[ctrl+o] [enter]

Set the same hostname in the hosts file.

[root@archiso /]# nano /etc/hosts

# /etc/hosts: static lookup table for host names

#<ip-address> <> <hostname> localhost.localdomain localhost
::1 localhost.localdomain localhost linux-pc.localdomain linux-pc

# End of file

[ctrl+o] [enter]

Here you could set up any special network considerations. Since my network is a simple wired connection I don't need to do anything but enable the installed dhcp server for all interfaces.

[root@archiso /]# systemctl enable dhcpcd.service

Set the root password.

[root@archiso /]# passwd
New password:
Retype new password:
passwd: password updated successfully

Bootloader Setup

Now to set up the bootloader, I'll be using GRUB but there are several alternatives.

Install grub and efibootmgr.

[root@archiso /]# pacman -S grub efibootmgr
:: Proceed with installation> [Y/n] y

Install grub to the UEFI boot partition.

[root@archiso /]# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub
Installing for x86_64-efi platform.
Installation finished. No error reported.

Generate the main grub config file. If you are dual-booting see GRUB Config and Dual Booting.

[root@archiso /]# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinux-linux
Found initrd image(s) in /boot: initramfs-linux.img
Found fallback initrd image(s) in /boot: initramfs-linux-fallback.img

Since I have an intel CPU I need to install microcode updates and enable them.

[root@archiso /]# pacman -S intel-ucode

Re-create the grub boot config to detect the installed intel ucode.

[root@archiso /]# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinux-linux
Found initrd image(s) in /boot: intel-ucode.img initramfs-linux.img
Found fallback initrd image(s) in /boot: intel-ucode.img initramfs-linux-fallback.img

Finishing Up

Unmount the filesystem and reboot the system.

[root@archiso /]# exit
root@archiso ~ # umount -R /mnt
root@archiso ~ # reboot

At this point press Del (or F2) again to enter the UEFI setup and make sure grub is first on your boot devices. You can now shut down and remove the boot USB disk and reconnect your drives if you had them disconnected. Check UEFI setup again after you attach all drives to make sure grub is the first to boot and boot into the new system.

Post Install

At this point you should have booted into a working Arch Linux system. All that's left is to install the packages required for the GUI interface. I'll be using xfce4 for my desktop environment. It's not very resource heavy and has everything I need. You can always add others later.


First I'll install sudo and create a non-root user, it's more secure to be logged in as a non-root user.

linux-pc login: root
Password: [password set earlier]

Update package lists.

[root@linux-pc ~]# pacman -Syy

Install sudo.

[root@linux-pc ~]# pacman -S sudo

Create user and set password, there is more in-depth info here.

[root@linux-pc ~]# useradd -m -G wheel -s /bin/bash josh
[root@linux-pc ~]# passwd josh

Add the new user to sudoers so they can use sudo.

[root@linux-pc ~]# nano /etc/sudoers
[ctrl+w] root ALL=

root ALL=(ALL) ALL
josh ALL=(ALL) ALL


Log out as root and back in as the created user.

[root@linux-pc ~]# exit
linux-pc login: josh

Desktop Environment

Now we'll install the X server as the first step to installing xfce4.

[josh@linux-pc ~]$ sudo pacman -S xorg-server
:: There are 3 providers available for libgl:
:: Repository extra
1) libglvnd 2) nvidia-304xx-utils 3) nvidia-340x-utils

Enter a number (default=1): (enter for default)
:: Proceed wth installation? [Y/n] y

Then install xfce4 and xfce4-goodies.

[josh@linux-pc ~]$ sudo pacman -S xfce4 xfce4-goodies
Enter a selection (default=all): (enter for default)
Enter a selection (default=all): (enter for default)
:: Proceed wth installation? [Y/n] y

Finally install a display manager, I chose LightDM because it supports the XDMCP protocol.

[josh@linux-pc ~]$ sudo pacman -S lightdm

You can also install a greeter for lightdm.

[josh@linux-pc ~]$ sudo pacman -S lightdm-gtk-greeter

Now I'll set lightdm to start on boot automatically.

[josh@linux-pc ~]$ sudo systemctl enable lightdm.service

Then reboot the system and if all goes well you should be greeted with a graphical login screen.

[josh@linux-pc ~]$ reboot