Arch Linux on a VPS - ArchWiki

Jump to content

# Arch Linux on a VPS

This page is protected so that only users with the "autoconfirmed" permission can edit it.
From ArchWiki

Related articles

- Server

From Wikipedia:Virtual private server:

  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.

## Official Arch Linux cloud image

Arch Linux provides an official cloud image as part of the arch-boxes project. The image comes with Cloud-init preinstalled and should work with most cloud providers.

The image can be downloaded from the mirrors under the `images` directory. Instructions for tested providers is listed below.

### DigitalOcean

Website: Digital Ocean

Locations: Global

Steps to create an Arch Linux virtual machine:

1. Find the cloud image on a mirror, e.g.: https://fastly.mirror.pkgbuild.com/images/latest/Arch-Linux-x86_64-cloudimg.qcow2
2. Add the image as a custom image by importing it
3. Create a new virtual machine from the custom image
4. SSH to the virtual machine: `ssh root@ip`

### Hetzner Cloud

Website: Hetzner Cloud

Locations: Nuremberg (Germany), Falkenstein (Germany), Helsinki (Finland), Singapur, Hillsboro (US West), Ashburn (US East)

Steps to create an Arch Linux virtual machine:

1. Create a new virtual machine with this user data:

       #cloud-config
       vendor_data: {'enabled': false}

   The `vendor_data` from Hetzner overrides the `distro` and sets the default user to `root` without setting `disable_root: false`, meaning you cannot login.
2. Boot the virtual machine in rescue mode
3. SSH to the virtual machine and download the cloud image from a mirror, e.g.: `curl -O https://fastly.mirror.pkgbuild.com/images/latest/Arch-Linux-x86_64-cloudimg.qcow2`
4. Write the image to the disk: `qemu-img convert -f qcow2 -O raw Arch-Linux-x86_64-cloudimg.qcow2 /dev/sda`
5. Reboot the virtual machine
6. SSH to the virtual machine: `ssh arch@ip`

### Linode

Website: Linode

Locations: Multiple international locations

Steps to create an Arch Linux virtual machine:

1. Create a new virtual machine and select Arch as the distribution (to use the Linode-provided image, stop here; otherwise proceed with the rest of the steps)
2. Boot the virtual machine in rescue mode
3. Connect to the virtual machine via the Lish console and download the basic image from a mirror, e.g.: `curl -O https://fastly.mirror.pkgbuild.com/images/latest/Arch-Linux-x86_64-basic.qcow2`
4. Install the qemu-utils package: `apt update && apt install qemu-utils`
5. Write the image to the disk: `qemu-img convert -f qcow2 -O raw Arch-Linux-x86_64-basic.qcow2 /dev/sda`
6. In the Linode manager, go to the virtual machine's configurations menu and edit the configuration to change the kernel option to "Direct Disk"
7. Reboot the virtual machine
8. SSH to the virtual machine: `ssh arch@ip`

### OVH Eco

Website: Kimsufi OVH Eco

Locations: Canada, France

Steps to create an Arch Linux virtual machine, paraphrasing the official documentation:

1. Navigate to the Dedicated Servers section in your OVH management panel, then select the server you want to deploy Arch Linux to.
2. Click the ... button next to "Last operating system (OS) installed by OVHcloud" and choose "Install"
3. Select "Bring Your Own Image (64bits)"
4. Enter your "Server host name" and your public "SSH key"
5. For "Image URL" put `https://fastly.mirror.pkgbuild.com/images/latest/Arch-Linux-x86_64-cloudimg.qcow2`
6. For "Image type" select `qcow2`
7. For "Checksum type" select `sha256`
8. For "Image checksum" put the fingerprint value from https://fastly.mirror.pkgbuild.com/images/latest/Arch-Linux-x86_64-cloudimg.qcow2.SHA256
9. For "Path of the EFI bootloader" put `\\efi\\boot\\bootx64.efi`
10. Optional: You can also add Cloud-init Instructions under section "Config Drive UserData". This is also useful to change the user passwords or to disable password logins via SSH for security reasons and use SSH Keys instead.
11. Click "Install the system"
12. Wait (it takes a while) for an email from OVH titled "Installation of your image", it will say "Congratulations! Your dedicated server has just been installed! Connect to your server with ssh key provided during your installation."
13. Use `ssh arch@ip` to log in.

### Proxmox

Website: Proxmox

Locations: N/A

Steps to create an Arch Linux virtual machine:

1. Create a new virtual machine.
2. Select "Do not use any media" in OS section.
3. Remove the created hard disk from your virtual machine after the virtual machine creation completes.
4. Add the downloaded image to your virtual machine using `qm disk import`, e.g.:
   `qm disk import 100 Arch-Linux-x86_64-cloudimg.qcow2 local`.
5. Under Options, edit the boot order and add the newly-created disk.
6. Add a cloudinit drive and make your configurations in Cloud-Init section.
7. Start the virtual machine!

Categories:

- Installation process
- Virtualization

Arch Linux on a VPS
Add topic