Run the following commands to install Arch Linux
# list disk drives, note the identifier for VBOX HARDDISK
fdisk -l
# partition the drive, change the identifier if needed
fdisk /dev/sda
# create a new partition
n
# set the partition type to primary
p
# default sector
Press Enter to accept default
# press enter to accept the default start sector
2048
# set the partition size, adjust to leave ~2GB for swap
+14GB
# create a swap partition
n
# set the partition type to primary
p
# default sector
Press Enter to accept default
# set the partition size
Press Enter to accept default
# write the partitions
w
# print out the partitions
fdisk -l
# create ext4 root partition
mkfs.ext4 /dev/sda1
# confirm proceeding with the change if prompted
y
# create swap partition
mkswap /dev/sda2
# confirm proceeding with the change if prompted
y
# mount the root partition
mount /dev/sda1 /mnt
# enable swap
swapon /dev/sda2
# run pacstrap installation
pacstrap /mnt base linux linux-firmware
# generate fstab file
genfstab -U /mnt >> /mnt/etc/fstab
# change root to the /mnt directory
arch-chroot /mnt
# set the hostname
echo archlinux-vm > /etc/hostname
# install grub bootloader
pacman -S grub
grub-install /dev/sda
# create grub config
grub-mkconfig -o /boot/grub/grub.cfg
# install gnome desktop environment
pacman -S gnome networkmanager qemu-guest-agent
# enable required services
systemctl enable gdm.service
systemctl enable NetworkManager.service
# set root passwd
passwd
# shutdown
exit
shutdown now