Memes aside, configuring Arch linux on my proxmox server was a fun way to spend a saturday afternoon. This was my first time using Arch. It was quite the experience.
Step 1. Downloading the ISO. Installing the ISO is pretty straightforward. Select your choice of torrenting software and get the ISO from: here
There are of course other avenues such as Docker images, Netboot, Vagrant images and HTTP.
Step 2. Once you have your ISO downloaded and saved somewhere, Connect to your Proxmox instance and "Create VM". The only options I changed from the default were the BIOS settings under the "system" tab. I changed my settings from the Default(SeaBIOS) to OVMF (UEFI) and selected my EFI Storage.
Step 3. Once you start your VM, You will want to press "esc" quickly to load into the Device Manager. And make sure "Attempt Secure Boot" is unchecked and shutdown the VM.
Step 4. ITS ALIVE! Well not quite but we are getting there. If you were lucky you'll be presented with this screen in your console.
step 5. This will be the first test to see if we've done things right. Run this script:
sh cat /sys/firmware/efi/fw_platform_sizeAfter its been run you should see either 64 or 34 if you have booted into UEFI correctly. If not you will need to disable secure boot and possibly reinstall?
step 6. Now check to make sure you're connected to the internet. If you're connected to the internet and can Ping an external I.P. You're ready to move on to the next step.
ip linkstep 7. Update your System Clock by running the following command.
timedatectlStep 8. Now its partition and format fun time! To check if your drives are actually appearing you can run:
fdisk -lThis will display a list of all drives.
- Since this is a UEFI install, we will want three partitions in total.
- Boot partition will be the EFI system partition and be 1GiB.
- The Swap partition which is reccomended at 4GiB.
- Finally the Root partition which will be the remainder of the drive or a size you deem reasonable with atleast 23-32GiB.
open the target disk with 'fdisk' to create the partitions
fdisk /dev/sdaCreate a new GPT Partition table
Command (m for help): gCreate the EFI System Partition
- Type n to create a new partition.
- Select the default partition number (1).
- Accept the default first sector.
- Specify the last sector as +1G to create a 1GB partition.
- Change the partition type to EFI System Partition by typing t, then selecting 1 for the partition number and 1 for the EFI System Partition type.
Command (m for help): n
Partition number (1-128, default 1): (Press Enter)
First sector (2048-...): (Press Enter)
Last sector, +sectors or +size{K,M,G,T,P} (2048-...): +1G
Command (m for help): t
Selected partition 1
Partition type (type L to list all types): 1On to the swap partition:
- Type n to create a new partition.
- Select the default partition number (2).
- Accept the default first sector.
- Specify the last sector as +4G to create a 4GB partition.
- Change the partition type to Linux swap by typing t, then selecting 2 for the partition number and 19 for the Linux swap type.
Command (m for help): n
Partition number (2-128, default 2): (Press Enter)
First sector (2048-...): (Press Enter)
Last sector, +sectors or +size{K,M,G,T,P} (2048-...): +4G
Command (m for help): t
Partition number (1, 2, default 2): 2
Partition type (type L to list all types): 19Now onto the final partition! The ROOT!
- Type n to create a new partition.
- Select the default partition number (3).
- Accept the default first sector.
- Accept the default last sector to use the remaining space.
Command (m for help): n
Partition number (3-128, default 3): (Press Enter)
First sector (2048-...): (Press Enter)
Last sector, +sectors or +size{K,M,G,T,P} (2048-...): (Press Enter)Now time to actually write these changes:
Command (m for help): wFormat the Partitions
Format the EFI System Partition as FAT32:
mkfs.fat -F32 /dev/sda1Format the root partition as ext4:
mkfs.ext4 /dev/sda3Now initialize the swap partition:
mkswap /dev/sda2
swapon /dev/sda2Your output should look like this when done
Last but not least, now we mount the partitions:
Mount the root partition:
mount /dev/sda3 /mntCreate and mount the EFI directory:
mkdir -p /mnt/boot/efi
mount /dev/sda1 /mnt/boot/efi
You can verify your partitions are setup correctly by using:
fdisk -l
And your output should look like the above screenshot.
Package time!
step 9. First we will install the base package. This may take a minute or two.
pacstrap -K /mnt base linux linux-firmwareNow that thats installed, REMEMBER Arch is VERY barebones, basically as barebones as it comes. So in order to connect to the internet and use text editors we will have to install the packages to do so. Feel free to install any package you would like at this point. But for our purposes I will be installing dhcpcd and Nano.
Chroot into your system.
arch-chroot /mntthen install the DHCP client
pacman -S dhcpcdEnable and start the DHCPP Client Service. You will want to leave chroot to start the service.
exit
systemctl enable dhcpcd
systemctl start dhcpcd
systemctl status dhcpcdthen go back into chroot to install Nano (or your text editor of choice)
arch-chroot /mnt
pacman -S nanoTo verify nano is installed run:
nano --versionwe will also be installing these for later.
pacman -S inetutils systemdCreate the fstab file
Make sure you are not in Chroot by typing "exit" in the terminal. and use this command to create the fstab file:
genfstab -U /mnt >> /mnt/etc/fstabChroot with Time zone and localization
Now we go back into chroot
arch-chroot /mntSet the time zone:
ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
hwclock --systohcCreate the hostname file
Type anything you want for "yourhostname".
nano /etc/hostname
yourhostnameSet root password
Change your root password with this command:
passwdBootloader time
For this I've gone with GRUB, however there are a plethora of different boot loaders out there to choose from.
Make sure you are in Chroot
arch-chroot /mntDownload Grub and required packages:
pacman -S grub efibootmgrInstall GRUB bootloader for UEFI: (This step will be different if not using UEFI)
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB
Then generate the GRUB config file:
grub-mkconfig -o /boot/grub/grub.cfgWe're almost done!
Now we will exit Chroot, unmount our drives and reboot.
exit
umount -R /mnt
rebootNow with any luck you should be greeted with this screen where you will login as "Root" and whatever password you set earlier.
Now once logged in the wild world of Arch Linux is as your disposal. From here you can install a GUI, or anything else you might think of. The Arch Linux Wiki has some amazing reccomendations on first steps. I will leave the link below.
[https://wiki.archlinux.org/title/General_recommendations]