As the title implies, this is "my" experience of Arch Linux Installation on a virtual machine. There are many (too many) ways to install Arch Linux. This Gist is only designed as a reminder if I need to do this again...
Target configuration: use English language, French keyboard, located in France.
- Arch Linux Installation Guide: https://wiki.archlinux.org/title/installation_guide
- Network manager: https://wiki.archlinux.org/title/NetworkManager
- GRUB: https://wiki.archlinux.org/title/GRUB
- General recommendations: https://wiki.archlinux.org/title/General_recommendations
- List of applications: https://wiki.archlinux.org/title/List_of_applications
- Download page: https://archlinux.org/download/
- French mirror: http://mirror.archlinux.ikoula.com/iso/
- Last installation: http://mirror.archlinux.ikoula.com/iso/2021.12.01/archlinux-2021.12.01-x86_64.iso
- CPU: 2
- Memory: 4 GB
- Disk: 40 GB
- USB: 3.1
- CD: installation image
- No nested virtualization
- No UEFI, use legacy BIOS
- Boot on install CD => prompt
root@archiso ~ #
- Define keyboard layout:
# loadkeys fr
- Network: list adapters, start DHCP client daemon, verify address:
# ip link
# systemctl start dhcpcd
# ip addr
- List disks (assuming
/dev/sda
):
# fdisk -l
- Partition disk: 4 GB swap, root file system for the rest of the disk (see
fdisk
commands at end of document)
# fdisk /dev/sda
o <-- create a new empty DOS partition table
p <-- print the partition table
F <-- list free unpartitioned space
n <-- add a new partition
p <-- primary
1 <-- partition number
<-- first sector, use default
+4G <-- last sector (4GB after first sector)
t <-- change a partition type
82 <-- type: Linux swap
n <-- add a new partition
p <-- primary
2 <-- partition number
<-- first sector, use default
<-- last sector, use default (end of disk)
a <-- toggle a bootable flag
2 <-- partition number
p <-- print the partition table
v <-- verify the partition table
w <-- write table to disk and exit
- Format swap and root, mount them:
# mkswap /dev/sda1
# mkfs.ext4 /dev/sda2
# swapon /dev/sda1
# mount /dev/sda2 /mnt
- Update the maintainers keyring, in case new keys are not on the boot DVD:
pacman -Sy archlinux-keyring
- Install some base packages:
# pacstrap /mnt base linux linux-firmware grub vi vim sudo dhcpcd networkmanager man-db man-pages texinfo
- Generate an
fstab
file:
# genfstab -U /mnt >>/mnt/etc/fstab
- Change root into the new system:
# arch-chroot /mnt
- Set the time zone, generate
/etc/adjtime
(hardware clock is set to UTC):
# ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime
# hwclock --systohc
- Generate locale, keyboard and host name:
# vi /etc/locale.gen # uncomment en_US.UTF-8 UTF-8
# locale-gen
# echo "LANG=en_US.UTF-8" >/etc/locale.conf
# echo "KEYMAP=fr" >/etc/vconsole.conf
# echo "vmarch" >/etc/hostname
- Set the root password:
# passwd
- Install GRUB bootloader:
# grub-install /dev/sda
# vi /etc/default/grub # only if non-default configuration is needed
# grub-mkconfig -o /boot/grub/grub.cfg
- Reboot:
# exit # from arch-chroot
# umount /mnt
# reboot
- Enable network:
# systemctl start NetworkManager
# systemctl enable NetworkManager
# ip addr # to check addresses
- Create user:
# groupadd _NAME_
# useradd _NAME_ -m -d /home/_NAME_ -g _NAME_
# passwd _NAME_
# echo "_NAME_ ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/_NAME_
- Install additional software:
# pacman -Syu --noconfirm base-devel bash-completion gnome gnome-terminal gnome-tweaks openssh linux-headers dkms git
# localectl --no-convert set-x11-keymap fr
# systemctl enable gdm
# systemctl enable sshd
- Main commands:
DOS (MBR)
a toggle a bootable flag
b edit nested BSD disklabel
c toggle the dos compatibility flag
Generic
d delete a partition
F list free unpartitioned space
l list known partition types
n add a new partition
p print the partition table
t change a partition type
v verify the partition table
i print information about a partition
Misc
m print this menu
u change display/entry units
x extra functionality (experts only)
Script
I load disk layout from sfdisk script file
O dump disk layout to sfdisk script file
Save & Exit
w write table to disk and exit
q quit without saving changes
Create a new label
g create a new empty GPT partition table
G create a new empty SGI (IRIX) partition table
o create a new empty DOS partition table
s create a new empty Sun partition table
- Extra commands (after
x
):
DOS (MBR)
b move beginning of data in a partition
i change the disk identifier
Geometry (for the current label)
c change number of cylinders
h change number of heads
s change number of sectors/track
Generic
p print the partition table
v verify the partition table
d print the raw data of the first sector from the device
D print the raw data of the disklabel from the device
f fix partitions order
m print this menu
Save & Exit
q quit without saving changes
r return to main menu