Install Arch Linux natively on DigitalOcean VPS

I’ve been one to complain that DO dropped support for Arch Linux, others have done hacky workarounds that wind up still using the locked down kernels that DO provides. Recently they added FreeBSD to their list of supported Operating Systems with a mention that they would allow fully custom kernels to be used. In this I saw a door to freedom of choice again.

If you want to give it a go here’s what I did.

Create a FreeBSD Droplet.

Connect via the Console Access in DigtalOcean admin and elevate yourself to root.

Add some tools we’re going to need:
replace $editor with your favorite editor assuming it doesn’t come prepackaged on FreeBSD 10.1

# pkg install grub2 wget e2fsprogs $editor


Partition adding a bios-boot partition, replace swap for /boot and install grub2

# swapoff -a
# gpart delete -i 1 /dev/vtbd0
# gpart delete -i 2 /dev/vtbd0
# gpart add -t \!21686148-6449-6E6F-744E-656564454649 -i 1 -s 2M /dev/vtbd0
# gpart add -t linux-data -i 2 /dev/vtbd0
# gpart show /dev/vtbd0

You should now have a layout that looks like this:

# mkfs.ext3 /dev/vtbd0p2
# mount -t ext2fs /dev/vtbd0p2 /boot
# grub-install /dev/vtbd0

Grub should return a polite completed message:

Download the arch install media from your favorite mirror with wget and place it in /boot
Note: Since you’ve passed the point of no return it is imperative to verify the md5sum or sha1sum as you won’t be able to download another copy once you’ve committed to a reboot.

Configure grub to boot the Arch Linux install media:
my /boot/grub/grub.cfg looks like this:

Reboot and you should be greeted with grubs boot menu:

From here you can install Arch Linux and live happily ever after.

Note: To install you’ll need to configure your networking statically, the pertinent information for your network can be found at the bottom of the Console Access page in the Digital Ocean Admin.

Some Notes on installation:

If you wish to continue to use the second partition as /boot in your installation as I did you’ll need to remount /run/archiso/img_dev RW and bindmount it to your /boot inside /mnt before you chroot.

# mount /dev/vda3 /mnt/
# mkdir /mnt/boot
# mount -o remount,rw /run/archiso/img_dev
# mount -o bind /run/archiso/img_dev /mnt/boot

Continue your install as normal.

A special thanks WonderWoofy for all the support and ideas that got this going.

Thanks to kaictl for proofreading this.

Thanks to Rick for his article that covered how to set the bios-boot flag with gpart under FreeBSD.

4 thoughts on “Install Arch Linux natively on DigitalOcean VPS”

Leave a Reply

Your email address will not be published. Required fields are marked *