This will guide you though a moderately subjective installation of Arch Linux on VMware Fusion (but likely translates well for Workstation, too) that fits my use-case well. This guide presumes you have already downloaded Arch Linux
Step 1 - Create the VM
First, create a new Virtual Machine in VMware, and then:
- Select 'Install from disc or image'
- Point VMware towards your
archlinux-YYYY.MM.DD-x86_64.iso
- In 'Choose Operating System', select
Other Linux 5.x and later kernel 64-bit
- In 'Choose Firmware type', select
UEFI
- At the 'Finish' step, select 'Customize Settings'
- Enter a suitable name for your VM, I chose
vm-arch-01
.
Step 2 - Configure the VM
There are a few tweaks to make to the Virtual Machine, before you start the installation. These are as follows:
- In 'Processors & Memory' increase the amount of RAM, I chose
8192MB
- In 'Display', ensure that 'Accelerate 3D Graphics' and 'Use full resolution for Retina display' are both ticked and then change the shared graphics memory to
8192MB (Recommended)
- Select 'Hard Disc (SCSI)' then select 'Remove Hard Disk'
- Select 'Add Device...' and then select 'New Hard Disk'
- Increase the disk size, I chose
80GB
- Expand 'Advanced options' and change the bus type to
NVME
, then select 'Apply'
You're now ready to start the installation, so go ahead and power on the VM.
Step 0
To make life easier, you might want to SSH into your VM to complete the installation. If so you'll need to change the password for root with passwd
.
Step 1 - Partition the disk
After the installation media has booted, the first step is to create two partitions on the disk (boot
and lvm
). This can be done this with gdisk
as follows:
gdisk /dev/nvme0n1
# Now enter the following sequence:
n
1
ENTER
+1G
EF00
n
2
ENTER
ENTER
8e00
p
c
1
boot
c
2
lvm
p
w
y
Step 2 - Create the logical volumes
Create a physical volume on nvme0n1p2
and then the volume group (which has been named vg0
):
pvcreate /dev/nvme0n1p2
vgcreate vg0 /dev/nvme0n1p2
pvcreate
as it gets done automatically when you run vgcreate
but it has been included for completeness.Now create logical volumes for root
, swap
and home
:
lvcreate -n root -L 30G vg0
lvcreate -n swap -L 8G vg0
lvcreate -n home -L 40G vg0
home
, which you can do by substituting-in -l 100%FREE
.The creation of these logical volumes can be verified with lvs
.
Step 3 - Format the volumes
Now that the physical volume and our three logical volumes have been created, the next step is to format these. This is done as follows:
mkfs.fat -F32 -n BOOT /dev/nvme0n1p1
mkfs.ext4 -L root /dev/vg0/root
mkfs.ext4 -L home /dev/vg0/home
It is also necessary to configure the swap partition:
mkswap -L swap /dev/vg0/swap
swapon /dev/vg0/swap
Step 4 - Create the mount points
With the volumes all formatted, the next step is to mount these to the appropriate locations, prior to beginning the OS installation. This is done as follows:
mount /dev/vg0/root /mnt
mkdir /mnt/{boot,home}
mount /dev/nvme0n1p1 /mnt/boot
mount /dev/vg0/home /mnt/home
Step 5 - Provision the bare necessities
Now use pacstrap
to install the OS, which will be chroot
-ed into, shortly:
pacstrap /mnt base base-devel linux linux-headers linux-firmware linux-hardened linux-hardened-headers linux-lts linux-lts-headers linux-zen linux-zen-headers lvm2 efibootmgr nano --noconfirm
hardened
, lts
and zen
kernels. You may wish to omit these.Following installation of the OS, an fstab file now needs to be generated:
mv /mnt/etc/fstab /mnt/etc/fstab.bak
genfstab -U -p /mnt > /mnt/etc/fstab
Step 5b - chroot
time!
The rest of the installation is done within the OS itself, so chroot
into the OS with:
arch-chroot /mnt /bin/bash
Step 6 - Ramdisk
First, backup the default mkinitcpio.conf
file and create a new one:
mv /etc/mkinitcpio.conf /etc/mkinitcpio.conf.bak
nano /etc/mkinitcpio.conf
In terms of how this differs from default, in addition to the necessary inclusion of lvm2
before filesystems
, I have also chosen to replace base
and udev
with systemd
. This second step isn't necessary, but I wanted to do so:
MODULES=()
BINARIES=()
FILES=()
HOOKS=(systemd autodetect modconf block lvm2 filesystems keyboard fsck)
Now that mkinitcpio.conf
is complete, it is necessary to manually generate the presets, which reside in /etc/mkinitpcio.d
. Note that the -P
option is being specified because multiple kernels have been installed:
mkinitcpio -P
Step 7 - Boot manager
On a physical machine, you may choose to use GRUB, because of dual-booting etc. but in this guide systemd-boot
is being used, instead.
Run the following command, to install systemd-boot into the EFI system partition:
bootctl install
Adding the loader(s)
The boot manager entries now need to be created, to enable the OS to boot. I've chosen to reference the volume using the UUID rather than the label, which makes it a bit more complicated to set up, but means that things won't break if volume labels change. Thankfully the command below will do the hard work, and copy the UUID into the entry configuration for the stable kernel:
echo "options root=UUID=$(blkid -s UUID -o value /dev/mapper/vg0-root) rw" >> /boot/loader/entries/00-arch-stable.conf
Now open this file in nano
, so that we can pop the rest of the necessary configuration in there, too:
nano /boot/loader/entries/00-arch-stable.conf
In this file, enter the following configuration, above the options
line:
title Arch Linux - Stable
linux /vmlinuz-linux
initrd /initramfs-linux.img
Now, if you chose to install the hardened
, lts
and zen
kernels, repeat the above configuration process for 01-arch-hardened.conf
, 02-arch-lts.conf
and 03-arch-zen.conf
.
Note that the loader order is alphabetical hence why they are prefixed with 00-
, 01-
, 02-
and 03-
.
Loader configuration
Whilst this guide places 00-arch-stable.conf
at the top of the list, if multiple kernels are installed then it may be preferred that a different loader is selected as the default (in this example it is 03-arch-zen.conf
).
In addition to defining a default kernel, this configuration also increases the timeout to 5 seconds, disables the kernel parameters editor and disables the auto-population of firmware entries.
Firstly, back up the default configuration to loader.conf.bak
and then open an editor with a new loader.conf
mv /boot/loader/loader.conf /boot/loader/loader.conf.bak
nano /boot/loader/loader.conf
Now enter the following configuration into the new loader.conf
:
default 03-arch-zen.conf
timeout 5
editor no
auto-firmware 0
console-mode max
Step 8 - User creation
Next, create a user that is a member of the wheel
group (it is to this group that we will grant sudo
rights):
userName="<your name here>"
useradd -m -G wheel $userName
passwd $userName
Now that $userName
has been created and added it to wheel
, it is necessary to grant that group sudo
rights. This is done using visudo:
cp /etc/sudoers /etc/sudoers.bak
export EDITOR=nano
visudo
EDITOR
variable as nano
- this is by no means essential.Now do as follows (uncomment %wheel ALL=(ALL) ALL
):
## Uncomment to allow members of group wheel to execute any command
%wheel ALL=(ALL) ALL
Step 9 - Configure the host
Hostname
desiredHostname="<your desired hostname here>"
echo "$desiredHostname" > /etc/hostname
Locale
Rather than uncommenting a couple of lines from a very long configuration file, the following commands will move the existing locale.gen
to locale.gen.bak
and will open a new copy, ready for editing:
mv /etc/locale.gen /etc/locale.gen.bak
nano /etc/locale.gen
I chose to enable en_GB.UTF-8
and en_US.UTF-8
. I found that both were necessary as when I just did en_GB, I ended up with locale errors(?):
en_GB.UTF-8 UTF-8
en_US.UTF-8 UTF-8
Following this, it is then necessary to set a default and then generate the locales which can be achieved as follows:
echo "LANG=en_GB.UTF-8" > /etc/locale.conf
locale-gen
The final localisation step is to set the timezone appropriately:
ln -s /usr/share/zoneinfo/Europe/London /etc/localtime
Step 10 - Install the basics
Miscellaneous bits
I'm not sure what to describe these bits as, other than them being somewhat miscellaneous. Either way, all of them are needed or desired for one reason or another:
pacman -S openssh git vim wget xdg-utils cups --noconfirm
Network
Managing the network configuration with systemd-networkd would go hand-in-hand with using systemd-boot as the boot manager (especially considering it's a VM),. However, I prefer the flexibility that NetworkManager offers:
pacman -S networkmanager --noconfirm
Audio
For audio, I opted to install PipeWire as opposed to PulseAudio. I found it necessary to do so before installing GNOME, as otherwise PulseAudio gets installed, which then conflicts:
pacman -S pipewire pipewire-alsa pipewire-jack pipewire-media-session pipewire-pulse gst-plugin-pipewire libpulse --noconfirm
GNOME
I have chosen to install GNOME as my desktop environment (DE). This is because, after spending far too long refining the install itself, I didn't want to spend even more time making things look pretty. For that reason I decided to simply install GNOME (and Material Shell):
pacman -S gnome gnome-tweaks gdm --noconfirm
Fonts
I decided to install Roboto (because I like it) as well as Noto (because it's comprehensive):
pacman -S ttf-roboto ttf-roboto-mono noto-fonts noto-fonts-extra noto-fonts-cjk noto-fonts-emoji --noconfirm
VM bits
Now, install the necessary packages to enable the VM to work well:
pacman -S open-vm-tools xf86-video-vmware xf86-input-vmmouse mesa gtkmm gtk2 --noconfirm
Step 11 - Enable services
Now that everything has been installed, you will need to enable a number of services using systemctl
:
systemctl enable gdm.service
systemctl enable NetworkManager.service
systemctl enable sshd.service
systemctl enable vmtoolsd.service
systemctl enable vmware-vmblock-fuse.service
systemctl enable bluetooth.service
systemctl enable cups.socket
Step 11b - Reboot to the OS
The installation is now done(!) and it's time to exit chroot
, unmount /mnt
and reboot into your Arch Linux installation:
exit
umount -R /mnt
reboot
Step 12 - Sync time with Host
Depending on what time of year you do the install (i.e. whether you are in GMT or BST) you may notice a one-hour clock skew. To correct this, you will likely want to ensure that your VM is syncing its time with the host, by entering:
sudo vmware-toolbox-cmd timesync enable
sudo hwclock --hctosys --localtime
And with that, you've completed the Arch Linux install process for a Virtual Machine.