How to Install Arch Linux (also on VirtualBox)

Gevorg A. Galstyan
5 min readAug 25, 2018

--

Related articles

How to fix Flickering in some versions of Linux on VirtualBox

Minimal Requirements

  • 64bit machine
  • 512MB of RAM (4GB recommended)
  • 2GB of free disk space (64GB recommended)
  • Internet Connection
  • USB flash drive (for the physical machine installation)
  • VirtualBox Installed (for the virtual machine)

Download Arch Linux

Download the latest version of Arch Linux from the official website https://www.archlinux.org/download

Create a Live USB (for the physical machine installation)

This step is only needed if you install on a machine.

Replace /path/to/archlinux.iso with the path to the downloaded ISO file and /dev/sdx with your USB drive name.

dd bs=4M if=/path/to/archlinux.iso of=/dev/sdx status=progress oflag=sync

Create a VirtualBox Machine

Open VirtualBox

Click New and make sure the new screen looks like this

Click Continue and make sure the new screen looks like this

Click Continue

Click Create

Click Continue

Click Continue and make sure the new screen looks like this

Click Create

Select the newly created Virtual Machine and click Settings, and go to Storage tab.

From the Storage Devices tree select the row that says Empty under Controller: IDE.

Click on the CD icon at the right of Attributes > Optical Drive. And click on Choose Virtual Optical Disk File...

Select the Arch Linux ISO and click Open

The Settings screen should look like this

Start the machine

If you are installing on a Virtual Machine just start it. If you are installing on a physical device, put in the USB drive, turn on the device, go to BIOS and make sure it loads from USB and continue the startup process.

Installation Step By Step

Boot Arch Linux (x86_64)

Start process

After some time you will get a root prompt

Check Internet Connection

ifconfig
ping google.com -c 2

If your system does not get a reply, then configure a static IP address on your system so that your system can connect to the internet to download packages.

ip addr flush dev enp0s3
ifconfig enp0s3 192.168.1.100 netmask 255.255.255.0
route add default gw 192.168.1.1
echo "nameserver 192.168.1.1" >> /etc/resolv.conf
echo "nameserver 8.8.8.8" >> /etc/resolv.conf

Replace the network card and IP address according to your environment.

Partition Disk

clear
fdisk -l
clear
fdisk /dev/sda

Type p

Type n

Type p

Hit Enter

Hit Enter

Type +500M and hit Enter

Type n

Type p

Hit Enter

Hit Enter

Type +8G and hit Enter

Type t

Type 2

Type 82

Type n

Type p

Hit Enter

Hit Enter

Hit Enter

Type w

Create a File System

mkfs.ext2 /dev/sda1
mkfs.ext4 /dev/sda3
mkswap /dev/sda2

Mount Partitions

mount /dev/sda3 /mnt
swapon /dev/sda2

Install Arch Linux Base System

pacstrap /mnt/ base base-devel

Create fstab

genfstab /mnt >> /mnt/etc/fstab

Arch Linux System Configuration

arch-chroot /mnt

Set System Language

vi /etc/locale.gen

Uncomment en_US.UTF-8 UTF-8 and save the file

locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf

Set Timezone

ln -sf /usr/share/zoneinfo/US/Central /etc/localtime
hwclock --systohc --utc

Set Hostname

echo "archlinux.host.local" > /etc/hostname

Set Root Password

passwd

Install GRUB Boot Loader

pacman -S grub
grub-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg

Enable dhcpcd (internet connection)

systemctl enable dhcpcd

Create your user and add to the “wheel” group

useradd -m -G wheel username
passwd username

Enable sudo for the “wheel” group

EDITOR=nano visudo

Find this line # %wheel ALL=(ALL) ALL and uncomment it (remove the leading #). Save the file with Ctrl+O and exit with Ctrl+X.

Reboot

Eject USB or VirtualBox CD and then reboot to your system.

exit
reboot

Congratulations!

After reboot, you can sign in with your user and enjoy your fresh Arch Linux install.

--

--