Deploying Arch Linux VM's in XCP-ng

Arch Linux has a reputation for being obtuse to novice and expert Linux users alike. Furthermore, Arch is rarely supported by VM applications and cloud server providers. After deploying my first XCP-ng hosts, I struggled to find a guide on the viability of installing Arch Linux as a Xen guest. As with many things Arch, it turned out to be much easier than it seemed on the surface. Thanks to the amazing work of the Arch Community, deploying Arch guests was extremely easy and performant. In this guide we will walk-through how to quickly deploy Arch guests and enable PVHVM.

Installing Arch


While many Arch users are adamant about deploying each OS manually, I don’t share that sentiment. Thanks to the work of the Anarchy Linux project, installing Arch is about as fast as a Ubuntu Server installation.

VM Launch Setup

  1. Navigate to the Anarchy Linux Gitlab Release page and download the latest iso. (At the time of writing its v1.2.1)
  2. Add the Anarchy Iso to your XCP-NG Iso Library.
  3. Launch a new VM with the Iso attached. Below are my recommended VM launch settings for both XCP-NG Center and Xen Orchestra. (4 cores - 4GB Ram - 30 GB Drive) XCP-ng Center VM Arch Linux Launch Settings Xen Orchestra VM Arch Linux Launch Settings

Bootstrapping with Anarchy

Once you have launched a new VM with the Anarchy iso attached, follow the installation guide, being sure to install Base Arch Linux with no desktop. The process should take about 4-5 minutes and you will be up and operational with a VM running in HVM mode.

https://i.imgur.com/ALzh6Xu.gif

Enabling PVHVM and Guest Tools


Rather than explain the differences between HVM, PV, and PVHVM here, check out Xen Orchestra’s Article on the advantages and disadvantages of each mode. XCP-NG already natively includes a way to install these drivers on the most popular Linux Distros (Debian Based and RHL Based) but on any other distro you will need to enable them manually. Again, thanks to the work of the Arch Community, the AUR already contains a package that can install and maintain Guest Tools with an AUR manager.

Once you have loaded into your new VM, install your favorite AUR Manager and then install xe-guest-utilities-git and xenstore-git. If you use yay as your AUR Manager use the following command to install yay, xe-guest-utilities-git, and xenstore-git in one command.

sudo pacman -S base-devel git && git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si && yay -S yay xenstore-git xe-guest-utilities-git && cd .. && sudo rm yay && sudo systemctl enable xe-guest-utilities.service && sudo reboot

Bugs in XCP-ng Center


Unfortunately XCP-ng Center has several UI bugs that won’t show that guest tools have been installed. Thankfully, Xen Orchestra will show the newly installed guest tools.
https://i.imgur.com/3efUpDR.png

Avatar
Justin Timperio
Researcher and Freelance Dev

Justin is a freelance developer and private researcher.