Arch Linux VPS

Virtual private server (VPS) is a term used by Internet hosting services to refer to a virtual machine. The term is used for emphasizing that the virtual machine, although running in software on the same physical computer as other customers' virtual machines, is in many respects functionally equivalent to a separate physical computer, is dedicated to the individual customer's needs, has the privacy of a separate physical computer, and can be configured to run server software.

This article discusses the use of Arch Linux on Virtual Private Servers, and includes some fixes and installation instructions specific to VPSes.

Warning:

Linux 2.6.32 is not supported by systemd since version 205 (and will not work with systemd-212 or higher). Since many container-based virtualization environments rely on older kernels, it may be impossible to keep an Arch Linux install up-to-date in such an environment. However, OpenVZ, as of kernel build 042stab094.7, has backported the CLOCK_BOOTTIME feature, making it work with later versions of systemd.

Systemd since version 220 doesn't work on OpenVZ containers. [1] This issue has been fixed in OpenVZ kernel 042stab111.1 [2]

To run a custom kernel, install linux-linodeAUR (linux will break on a 32-bit Linode). When shipped, the NIC enp4s0 is renamed to eth0 and reverts back to enp4s0 on reboot --- on reboot, this may cause sshd load to fail.

Arch is not offered as a choice when creating a server (even though the Arch logo is prominently featured on the site). As of 2018, the most recent version of Ubuntu offered is 14.04, and the limited-time promo code for new sign ups is over two years old. None of this generates much trust.

OpenVZ

Installing the latest Arch Linux on any OpenVZ provider

It is possible to directly copy an installation of Arch Linux over the top of a working OpenVZ VPS. This tutorial explains how to create a basic installation of Arch Linux with pacstrap (as used in a standard install) and then replace the contents of a target VPS with it using rsync.

This process (with minor modification) also works to migrate existing Arch installations between various environments and has been confirmed to work in migrating from OpenVZ to Xen and from Xen to OpenVZ. For an install to Xen, other hardware-virtualized platforms, or probably even to physical hardware (unconfirmed), extra steps (basically running mkinitcpio and installing a bootloader) are needed.

Prerequisites

A working Arch Linux installation

To keep things simple, it should match the architecture you want to install on your VPS (x86_64 or i686).

To build from other distributions, arch-bootstrap.sh can be used in place of pacstrap.

Building a clean Arch Linux installation

-C custom-pacman-config.conf - Use a custom pacman configuration file. By default, pacstrap builds according to your local pacman.conf. This determines the architecture (i686 or x86_64) of the build, the mirror list, etc.

-G - Prevent pacstrap from copying your system's pacman keyring to the new build. If you use this option, you will need to run pacman-key --init and pacman-key --populate archlinux in the Configuration step to set up the keyring.

--delete-delay - Recommended. Enables alternate deletion mode which waits to delete anything until the synchronization is otherwise complete, which may reduce the risk of a slow transfer causing the target VPS to lock-up

If you do not have access to the serial console feature, you will need to preconfigure your network settings before synchronizing Arch to the VPS.

On some VPS configuration you won't have a gateway to connect to, here is an example netctl configuration for this setup. It configures static IP addresses and default routes on venet0 and uses Google Public DNS.