Deploying Arch Linux VM's in XCP-ng

Arch Linux has a reputation for being obtuse and scary to many novices and expert Linux users alike. Furthermore, Arch is rarely natively 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 Xen guest. As with many things Arch, it turned out to much easier than it seems on the surface. Thanks to the amazing work of the Arch Community, deploying Arch guests is extreamely easy and peroformant. In this guide I will show how to quickly deploy Arch guests and enabling PVHVM.

Installing Arch

While many Arch users are very adamaiment 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 VMvm with the Iso attached. Below are my recommend 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. It’s really that simple. The process should take about 4-5 minutes and you will be up and operational with the VM running in HVM mode.

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

Enabling PVHVM and Guest Tools

Rather than explain here the differences between HVM, PV, and PVHVM here, please 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 yourself. Again thanks to the amazing 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 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-tools-git && cd .. && sudo rm yay && sudo reboot

Bugs in XCP-ng Center

Unfortunately XCP-ng Center has several UI bugs that won’t detect that the guest tools have been installed. XCP-ng Center will not change but 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.