This is a simplified guide to installing a minimal version of Arch on VirtualBox with i3 using an EFI bootloader.
Do your best to simply follow the installation guide on the Arch Wiki (and other Arch Wiki pages). Everyone in the community is just going to point you back there anyways - a splendid group I tell ya. Learn, embrace, and submit to the Arch install.
Download latest Arch ISO from one of the mirrors here.
Setup your virtual machine.
Make sure you have the latest version of VirtualBox on your host. Arch will have the latest and if there is a version mismatch, then it can cause issues. Also, download the extension pack if you want USB 2.0 support.
Set name, memory, storage, and other settings as you see fit. I typically dedicate half of my system memory and processors, use a dynamically allocated drive with a generous amount of space (~50 GB), max out the video memory, enable 3D acceleration, set the Shared Clipboard and Drag'n'Drop to Bidirectional, and enable USB 2.0 (again, this requires the extension pack).
Check the Enable EFI (special OSes only) box in the System tab.
For non-US users, set the keyboard layout.
# ls /usr/share/kbd/keymaps/**/*.map.gz
# loadkeys de-latin1
Verify the boot mode (this should spit out a list).
# ls /sys/firmware/efi/efivars
Verify internet connection.
# ip link
# ping -c1 archlinux.org
Update the system clock.
# timedatectl set-ntp true
Partition Drive
# ls /dev
# gdisk /dev/sda
Partition Drive | Description |
---|---|
BIOS | Bootloader, +10MB, EF02 |
EFI | Bootloader, +500MB, EF00 |
swap | +2GB, 8200 |
root | System Files, +15GB (Minimum), 8300 |
home | Personal Files, Remaining Space, 8300 |
// EFI BOOT PARTITION
# p
::RETURN::
# n
::RETURN::
::RETURN::
::RETURN::
# +500M
::RETURN::
# EF00
::RETURN::
// SWAP PARTITION
# n
::RETURN::
::RETURN::
::RETURN::
# +2G
::RETURN::
# 8200
::RETURN::
// ROOT PARTITION
# n
::RETURN::
::RETURN::
::RETURN::
# +15G
::RETURN::
::RETURN::
// HOME PARTITION
# n
::RETURN::
::RETURN::
::RETURN::
::RETURN::
::RETURN::
// CREATE PARTITIONS
# p
::RETURN::
// NOTE WHAT PARTITION NUMBERS CORRESPOND TO WHAT PARTITIONS FOR FORMATTING
w
::RETURN::
y
::RETURN::
Format Partitions (remember to update drive letter and partition number as necessary).
// EFI BOOTLOADER PARTITION
# mkfs.fat -F32 /dev/sda1
// SWAP PARTITION
# mkswap /dev/sda2
// ROOT PARTITION
# mkfs.ext4 /dev/sda3
// HOME PARTITION
# mkfs.ext4 /dev/sda4
Mount Partitions (remember to update drive letter and partition number as necessary).
// TURN SWAP ON
# swapon /dev/sda2
// MOUNT ROOT
# mount /dev/sda3 /mnt
// CD INTO /MNT
# cd /mnt
// CREATE BOOT AND HOME DIRECTORIES
# mkdir boot home
// MOUNT BOOT
# mount /dev/sda1 boot
// MOUNT HOME
# mount /dev/sda4 home
Install Arch (If you forget something, then you can chroot back in)
# pacstrap /mnt base base-devel linux linux-firmware vim rxvt-unicode firefox thunar xorg-server xorg-xinit i3 dmenu grub efibootmgr netctl wpa_supplicant dhcpcd dialog ttf-dejavu virtualbox-guest-modules-arch virtualbox-guest-utils xf86-video-vmware mousepad
Generate fstab file
# genfstab -U /mnt >> /mnt/etc/fstab
chroot into system
# arch-chroot /mnt
Set Timezone
# ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
# hwclock --systohc
Localization
# vim /etc/locale.gen
# locale-gen
# vim /etc/locale.conf
Set root password
# passwd
Add another user and adjust privileges
# useradd --home-dir /home/benny --create-home benny
# passwd benny
// ADD "benny ALL=(ALL) ALL" UNDER "root ALL=(ALL) ALL"
# vim /etc/sudoers
Setup internet and virtual box services
# systemctl enable dhcpcd@enp0s3.service
# vim /etc/modules-load.d/virtualbox.conf
// ADD LINES
vboxguest
vboxsf
vboxvideo
# systemctl enable vboxservice.service
Install & Configure GRUB
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB --removable
# grub-mkconfig -o /boot/grub/grub.cfg
Shutdown virtual machine, remove ISO file from the Storage tab in Settings, and restart.
Login an non-root user
# echo "exec i3" > ~/.xinitrc
# startx
References:
Arch Wiki - Installation Guide: https://wiki.archlinux.org/index.php/installation_guide
GRUB Reference: https://wiki.archlinux.org/index.php/GRUB
Virtualbox Reference: https://wiki.archlinux.org/index.php/VirtualBox
Decent Arch Install Guide: https://dev.to/siatwe/install-a-minimal-arch-linux-in-half-an-hour--1l6p
Another Decent Arch Install Guide: https://wideaperture.net/blog/?p=4503
Random Tips:
The command below installs and overwrites all files (be careful). This has helped me out when I've messed up an install before.
# pacman -S package --overwrite='*'
If you land in grub after install, then use the ls command to check filenames. I've had to point to the config file before.
grub> configfile (hd1,gpt1)/boot/grub/grub.cfg.new