Arch Linux Installation Log in a VM

📢 This article was translated by gemini-2.5-flash

Intro

Installing in a VM, using Fedora’s Boxes software.

Pre-install Setup

Download Image

Grab it from the official download page . BT download is recommended (use a proper torrent client, like qBittorrent ).

Then drop it into your VM.

Verify Boot Mode

List the efivars directory:

1
ls /sys/firmware/efi/efivars

If the directory shows up correctly with no errors, your system is booting in UEFI mode. If it’s missing, you’re likely in BIOS mode (or CSM mode).

This VM uses BIOS mode.

Connect to the Internet

Network interface and DHCP service are enabled by default, no config needed.

Update System Time

Enable sync with Network Time Protocol (NTP) server:

1
timedatectl set-ntp true

You can check service status with timedatectl status.

Create Disk Partitions

Used the classic fdisk command for partitioning (MBR). Since it’s BIOS boot, I followed the official partitioning example, making only two partitions (swap and one for everything else).

Use fdisk -l to list all disks (you can ignore devices ending in rom, loop, or airoot).

Start partitioning with fdisk /dev/device_name.

CommandDescription
nCreate new partition
pCheck partitions
tChange partition type
wSave changes

Specify partition size using ++num+K/M/G/T/P. If no suffix (K/M/G/T/P), it allocates sectors.

Format Partitions

  • Create swap partition
1
mkswap /dev/swap_partition
  • Create filesystem

Commands vary based on filesystem. For example, ext4:

1
mkfs -t ext4 /dev/partition

Mount Partitions

Mount the root partition to /mnt. If you have multiple partitions, make sure to mount the root partition first.

1
mount /dev/partition /mnt

Enable swap:

1
swapon /dev/swap_partition

Installation

Select Mirrors

The /etc/pacman.d/mirrorlist file defines where packages are downloaded from. It updates automatically once connected to the internet, or you can change it manually. I’m leaving it as is.

Install Packages

Use the pacstrap script to install the base package, Linux kernel, and vim. If you need other packages, just add their names to the command below. You can always install more later with pacman.

1
pacstrap /mnt base linux vim

System Config

Fstab

The /etc/fstab file describes how partitions are automatically mounted at system startup. You can generate it automatically with the following command (use -U or -L for UUIDs or labels; using UUIDs helps prevent boot issues).

1
genfstab -U /mnt >> /mnt/etc/fstab

Check if auto-config is correct:

1
cat /mnt/etc/fstab

Chroot

Chroot into the newly installed system:

1
arch-chroot /mnt

Time Zone

Taking Shanghai time as an example:

1
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

Generate /etc/adjtime:

1
hwclock --systohc

Now you can use the date command to check if the time is correct.

Localization

Edit /etc/locale.gen and uncomment en_GB.UTF-8.

Then generate locale info:

1
locale-gen

Create /etc/locale.conf and edit the LANG variable, e.g., LANG=en_GB.UTF-8.

Network Configuration

Create /etc/hostname and enter your hostname.

Since the VM uses DHCP, I’m skipping network configuration .

Root Password

1
passwd

Install Bootloader

Typically, you’d install GRUB. My VM is BIOS+MBR, so I’m installing the grub package.

1
pacman -S grub

Install GRUB (for the command below, use /dev/device, not a partition):

1
grub-install --target=i386-pc /dev/device

Generate config file:

1
grub-mkconfig -o /boot/grub/grub.cfg

Reboot

Use exit or Ctrl+D to leave the chroot environment.

Use umount -R /mnt to unmount the mounted partitions.

Reboot with reboot.

References

Installation guide (Simplified Chinese) - ArchWiki

This post is licensed under CC BY-NC-SA 4.0 by the author.