12 Apr

Boot Arch Linux from PXE whilst directly connected via ethernet cable

I was following the PXE tutorial from ArchWiki (PXE) however I was directly connecting (via ethernet cable) to my target. This added a few complications that I’ve tackled below. I’ve repeated the instructions and made a note where (and WHY!) I have differed from the ArchWiki article.

First off we need to download the latest ISO image from the downloads page.

Mount the image in your current directory:

sudo mkdir -pv /mnt/archiso
sudo mount -o loop,ro archlinux-2017.02.01-dual.iso /mnt/archiso

Go ahead and connect your ethernet cable between you and the target. Remember you will need to use a crossover ethernet cable otherwise the host computer will be unable to communicate with the target.

Note: I didn’t have a cross over cable to hand so I used a Raspberry Pi as the host. The Raspberry Pi’s ethernet port is auto-sensing (auto MDI-X) so a normal cable or cross over cable can be used.

The ArchWiki article recommends you set a static IP address manually like so:

sudo ip link set eth0 up
sudo ip addr add dev eth0

However I experienced the target dropping and resetting the ethernet connection when transitioning from the boot menu to the PXE boot option. When the ethernet connection came back up, the interface had lost it’s manually set static IP address.

For this reason I created a systemd-networkd configuration file to set a static IP address on the network interface. (Make sure you disable dhcp and/or set up a static IP address for what ever network manager you are using).

My systemd-networkd configuration file I created was stored in /etc/systemd/network/25-wired.network:



Next as per the ArchWiki article we need to setup a DHCP server and a TFTP server.

We install and configure dnsmasq as per the ArchWiki article’s instructions.

Install dnsmasq:

sudo pacman -S dnsmasq

Configure dnsmasq:

# /etc/dnsmasq.conf

Start dnsmasq:

sudo systemctl start dnsmasq.service

Next install darkhttpd as this will be used to serve the root filesystem as in the ArchWiki article:

sudo pacman -S darkttpd

Start darkttpd:

sudo darkhttpd /mnt/archiso

You are now ready to boot the target. Either modify the BIOS options or enter the boot menu so that you can choose a network boot. This is target specific so you will have to find the instructions for your particular target.

If all goes to plan, you will be presented with an Arch Linux branded syslinux menu, asking how you wish to boot. Select the HTTP option. Once the root filesystem has been copied you should end up at a terminal which has been auto logged in as root.

You have now successfully booted into Arch Linux from a PXE image.