This guide is for installing Arch Linux as a VirtualBox guest using UEFI, grub bootloader, and Plasma (KDE 5) desktop
These instructions are collated from the following sources:
- Arch Wiki Install Guide
- Muktware Arch Install Guide
- Muktware Plasma Install Guide
- Linux Scoop's YouTube video (mainly for the
reflector
stuff)
Other usefull guides:
- Lifehacker Article
- mattiaslundberg's Minimal Install Gist (includes encryption)
Unless othewise noted, text sections enclosed in tags (e.g. <hostname>
) should be replaced
- Configure VirtualBox to use UEFI:
- Go into motherboard settings and check
Enable EFI
- Go into motherboard settings and check
- Start VM
dhcpcd
ping -c 3 www.google.com
lsblk
cfdisk /dev/sda
- select
gpt
- create 512M
EFI System
type partion assda1
- Can this be smaller if needed, 200M maybe?
- create larger
Linux Filesystem
type partion assda2
- write and quit
This is an example based on a 16GB Virtual HDD
Partition | Used | Size | %age |
---|---|---|---|
sda1 | 42M | 512M | 9% |
sda2 | 3.2G | 16G | 22% |
mkfs.fat -F32 /dev/sda1
mkfs.ext4 /dev/sda2
mount /dev/sda2 /mnt
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot
pacman -Sy
pacman -S reflector
reflector --verbose --sort rate --save /etc/pacman.d/mirrorlist
This sorts the mirrorlist in order of download rate (fastest first)
pacstrap /mnt base base-devel
genfstab -U /mnt >> /mnt/etc/fstab
cat /mnt/etc/fstab
-U
means use UUIDs instead of partition labels
arch-chroot /mnt /bin/bash
Use the bash shell
Exit back to previous session using exit
command
nano /etc/locale.gem
# Uncomment 'en_US.UTF-8 UTF-8' line
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8
Use tzselect
to find correct timezone if necessary
ln -s /usr/share/zoneinfo/<region>/<zone> /etc/localtime
hwclock --systohc --utc
# Sets hardware clock to UTC
echo <hostname> > /etc/hostname
systemctl enable dhcpcd
- List interface devices
ip link
- Make note of ethernet interface e.g.
enp0s3
- Copy
netctl
profilecp /etc/netctl/examples/ethernet-dhcp /etc/netctl/enp0s3-dhcp
- Set internet interface above in profile
vim /etc/netctl/enp0s3-dhcp
passwd
packman -S grub efibootmgr os-prober
# os-prober is for multi-boot
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=arch_grub
grub-mkconfig -o /boot/grub/grub.cfg
Note that this only works if the ESP (EFI System Partition) is mounted at /boot
as per instructions above
mkdir /boot/EFI/boot
cp /boot/EFI/arch_grub/grubx64.efi /boot/EFI/boot/bootx64.efi
exit
umount -R /mnt
shutdown now
- Remove ISO from virtual CD drive
- Start VM
nano /etc/pacman.conf
# Uncomment the '[multilib]' line and the 'Include' line below it
pacman -Sy
pacman -S sudo bash-completion vim
useradd -m -g users -G wheel -s /bin/bash <username>
passwd <username>
EDITOR=nano visudo
# Uncomment the '%wheel ALL=(ALL) NOPASSWD: ALL' line
pacman -S virtualbox-guest-utils
When prompted choose: * virtualbox-guest-modules-arch * mesa-libgl * default option
pacman -S xorg-server xorg-server-utils
pacman -S plasma sddm sddm-kcm
- sddm = Simple Desktop Display Manager
sddm-kcm
enables management of SDDM through System Settings
nano /etc/sddm.conf
Ensure the Theme
section has the following settings
[Theme]
Current=breeze
CursorTheme=breeze_cursors
FacesDir=/usr/share/sddm/faces
ThemeDir=/usr/share/sddm/themes
systemctl enable sddm
pacman -S dolphin konsole ttf-{dejavu,liberation}
reboot