PXE

From ArchWiki
Revision as of 03:36, 22 September 2012 by Buhman (talk | contribs) (HTTP)
Jump to: navigation, search

Preparation

Unlike older methods, recent changes in Archiso make it fairly trivial to use the official install media directly to set up PXE booting.

Download the latest official install media from your favorite mirror.

$ wget http://hive.ist.unomaha.edu/archlinux/iso/latest/archlinux-2012.09.07-dual.iso
--2012-09-21 22:06:37--  http://hive.ist.unomaha.edu/archlinux/iso/latest/archlinux-2012.09.07-dual.iso
Resolving hive.ist.unomaha.edu... 2620:d5:0:22bb::dead:beef, 137.48.187.208
Connecting to hive.ist.unomaha.edu|2620:d5:0:22bb::dead:beef|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 411041792 (392M) [application/x-iso9660-image]
Saving to: ‘archlinux-2012.09.07-dual.iso’

100%[====================================================================================>] 411,041,792  109MB/s   in 3.6s   

2012-09-21 22:06:41 (109 MB/s) - ‘archlinux-2012.09.07-dual.iso’ saved [411041792/411041792]

Next mount the image:

# mkdir -p /mnt/archiso
# mount -o loop,ro archlinux-2012.09.07-dual.iso /mnt/archiso

Server setup

Network

Bring up your wired NIC, and assign it an address appropriately.

# ip l s dev eth0 up
# ip a a 192.168.0.1/24 dev eth0

DHCP + TFTP

Configure dnsmasq:

# vim /etc/dnsmasq.conf
dhcp-range=192.168.0.50,192.168.0.150,12h
dhcp-boot=/arch/boot/syslinux/pxelinux.0
enable-tftp
tftp-root=/mnt/archiso
dhcp-option-force=209,boot/syslinux/archiso.cfg
dhcp-option-force=210,/arch/

Start dnsmasq:

# systemctl start dnsmasq.service

For those still using sysvinit:

# rc.d start dnsmasq

HTTP

Due recent changes in archiso, it is now possible to boot from HTTP (archiso_pxe_http initcpio hook) or NFS (archiso_pxe_nfs initcpio hook); among all alternatives, darkhttpd is by far the most trivial to setup.

First, install darkhttpd:

Installation