Installing Arch Linux Over a Network with PXE

Overview

This is a project I had been wanting to attempt for some time, and finally got around to completing last weekend. The install target was a Dell Vostro laptop circa 2006, which is still running strong with an extra few gigs of ram and a 64GB SSD. I checked the one-time boot order menu (F12 on this particular laptop) and saw a network option, and decided to dive in.

My distribution of choice is Arch Linux (partly because of the great documentation), so I began with the article on PXE. The basic flow of the install is as follows (taken from the Arch wiki), "You'll need to setup a DHCP, TFTP, and HTTP server to configure networking, load pxelinux/kernel/initramfs, and finally load the root filesystem (respectively)."

The Arch wiki outlines serving DHCP, TFTP, and HTTP from a single (linux) server on the network, whereas in my case I used a Synology NAS as the TFTP and HTTP server, and a router (which runs dd-wrt) to serve DHCP with dnsmasq. With this info in mind I downloaded the current Arch Linux install media and began the installation.

TFTP Setup

On the Synology DS212j NAS (DSM version > 4.2 is required for TFTP functionality) I first created a shared folder named 'tftp' which will serve as the TFTP root. I then navigated to the Control Panel -> FTP -> TFPT/PXE tab, checked the box to 'Enable TFTP service', and pointed the 'TFTP root folder' to the 'tftp' folder created in the previous step. Finally I created a directory named 'archiso' in the aforementioned 'tftp directory', and mounted the Arch install .iso on this folder.

HTTP Setup

From the DSM control panel, I navigated to the Web Services -> Web Applications tab and checked the 'Enable Web Station' checkbox. I then mounted the Arch install media on the default 'web' folder that DSM uses for the web root for the web server. I realize now that I could refine the install routine by using the 'web' folder as the TFTP root and only have to mount the install media in one place instead of separately on both the web and tftp roots.

DHCP Setup

At this point I logged into the Asus WL-520GU router (which runs dd-wrt firmware) and navigated to the Services -> Services tab, selected the 'DNSMasq' enable radio button, and input the following three lines into the 'Additional DNSMasq Options' textarea:

dhcp-boot=/archiso/arch/boot/syslinux/pxelinux.0,"192.168.1.2",192.168.1.2
dhcp-option-force=209,boot/syslinux/archiso.cfg
dhcp-option-force=210,/archiso/arch/

With all of this in place, I booted up my Vostro laptop (install target) and changed the one time boot order to attempt a network boot. Everything went off without a hitch and I found myself at a root zsh prompt ready to setup Arch.

Helpful Resources

  1. https://wiki.archlinux.org/index.php/PXE
  2. http://www.debian-administration.org/articles/478
  3. https://wiki.debian.org/PXEBootInstall
  4. http://www.syslinux.org/wiki/index.php/PXELINUX

Tags

 Linux  PXE  NAS  DD-WRT  Arch Linux