The Preboot eXecution Environment allows you to boot the installation media using a network interface (with an appropriate option-rom that supports PXE on the target), independent of any storage devices.

Due recent changes in [[Archiso|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 (and the lightest-weight).

+

Thanks to recent changes in [[Archiso|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 (and the lightest-weight).

First, install {{pkg|darkhttpd}}:

First, install {{pkg|darkhttpd}}:

−

{{hc|# pacman -S darkhttpd|2=

+

{{bc|# pacman -S darkhttpd}}

−

resolving dependencies...

−

looking for inter-conflicts...

−

−

Targets (1): darkhttpd-1.8-2

−

−

Total Download Size: 0.01 MiB

−

Total Installed Size: 0.04 MiB

−

Net Upgrade Size: 0.00 MiB

−

−

Proceed with installation? [Y/n]

−

:: Retrieving packages from community...

−

darkhttpd-1.8-2-x86_64 14.8 KiB 82.4M/s 00:00 [###############] 100%

−

(1/1) checking package integrity [###############] 100%

−

(1/1) loading package files [###############] 100%

−

(1/1) checking for file conflicts [###############] 100%

−

(1/1) checking available disk space [###############] 100%

−

(1/1) installing darkhttpd [###############] 100%}}

Then start {{pkg|darkhttpd}} using our /mnt/archiso as the document root:

Then start {{pkg|darkhttpd}} using our /mnt/archiso as the document root:

Line 118:

Line 82:

=== Boot ===

=== Boot ===

−

Looking at /var/log/messages.log on the PXE server will provide some additional insight to what exactly is going on during the early stages of the PXE boot process:

+

Looking at [[Systemd#Journal|journald]] on the PXE server will provide some additional insight to what exactly is going on during the early stages of the PXE boot process:

dnsmasq-tftp[2544]: sent /mnt/archiso/arch/boot/syslinux/splash.png to 192.168.0.110</nowiki>}}

−

After you load ''pxelinux.0'' and ''archiso.cfg'' via TFTP, you'll (hopefully) be presented with a [[Syslinux|syslinux]] boot menu with several options, two of which are of potential usefulness to us.

+

After you load {{ic|pxelinux.0}} and {{ic|archiso.cfg}} via TFTP, you'll (hopefully) be presented with a [[Syslinux|syslinux]] boot menu with several options, two of which are of potential usefulness to us.

Select either

Select either

−

Boot Arch Linux (x86_64) (HTTP)

+

{{bc|Boot Arch Linux (x86_64) (HTTP)}}

or

or

−

Boot Arch Linux (i686) (HTTP)

+

{{bc|Boot Arch Linux (i686) (HTTP)}}

depending on your CPU architecture.

depending on your CPU architecture.

Line 152:

Line 116:

Next the kernel and initramfs (appropriate for the architecture you selected) will be transferred, again via TFTP:

Next the kernel and initramfs (appropriate for the architecture you selected) will be transferred, again via TFTP:

After the root filesystem is downloaded via HTTP, you'll eventually end up at a root zsh prompt with that fancy [https://www.archlinux.org/packages/extra/any/grml-zsh-config/ grml config].

After the root filesystem is downloaded via HTTP, you'll eventually end up at a root zsh prompt with that fancy [https://www.archlinux.org/packages/extra/any/grml-zsh-config/ grml config].

Line 166:

Line 132:

=== Post-boot ===

=== Post-boot ===

−

Unless you want all traffic to be routed through your PXE server (which won't work anyway unless you [[Simple Stateful Firewall|set it up properly]]), you'll want to kill dnsmasq and get a new lease on the install target, as appropriate for your network layout.

+

Unless you want all traffic to be routed through your PXE server (which won't work anyway unless you [[Simple Stateful Firewall#Setting up a NAT gateway|set it up properly]]), you'll want to kill {{pkg|dnsmasq}} and get a new lease on the install target, as appropriate for your network layout.

+

+

{{bc|# systemctl stop dnsmasq.service}}

+

+

You can also kill {{pkg|darkhttpd}}; the target has already downloaded the root filesystem, so it's no longer needed. While you're at it, you can also unmount the installation image:

+

+

{{bc|# umount /mnt/archiso}}

+

+

At this point you can follow the [[Installation_Guide|official installation guide]].

+

+

== Alternate Methods ==

+

+

{{Accuracy|verify}}

+

{{Expansion}}

−

# systemctl stop dnsmasq.service

+

As implied in the syslinux menu, there are several other alternatives:

−

For sysvinit users:

+

=== NFS ===

−

# rc.d stop dnsmasq

+

You will need to setup a [[NFS|NFS server]] with the root export at the root of your mounted installation media--that would be {{ic|/mnt/archiso}} if you followed the [[PXE#Preparation|earlier sections]] of this guide.

−

You can also kill darkhttpd; the target has already downloaded the root filesystem, so it's no longer needed. While you're at it, you can also unmount the installation image:

+

=== NBD ===

−

# umount /mnt/archiso

+

Install {{pkg|nbd}} and configure it:

−

At this point you can follow the [[Installation_Guide|official installation guide]].

+

{{hc|# vim /etc/nbd-server/config|2=

+

[generic]

+

[archiso]

+

readonly = true

+

exportname = /srv/archlinux-2013.02.01-dual.iso}}

+

+

=== Low memory ===

−

== See Also ==

+

The {{ic|copytoram}} [[mkinitcpio|initramfs]] option can be used to control whether the root filesystem should be copied to ram in its entirety in early-boot.

−

* [[Wikipedia: Preboot Execution Environment]]

+

It highly recommended to leave this option alone, and should only be disabled if entirely necessary (systems with less than ~256MB physical memory). Append {{ic|<nowiki>copytoram=n</nowiki>}} to your kernel line if you wish to do so.

Server setup

Network

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

# ip link set eth0 up
# ip addr add 192.168.0.1/24 dev eth0

DHCP + TFTP

You'll need both a DHCP and TFTP server to configure networking on the install target and to facilitate the transfer of files between the PXE server and client; dnsmasq does both, and is extremely easy to set up.

HTTP

Thanks to 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 (and the lightest-weight).

Installation

For this portion you'll need to figure out how to tell the client to attempt a PXE boot; in the corner of the screen along with the normal post messages, usually there will be some hint on which key to press to try PXE booting first. On an IBM x3650 F12 brings up a boot menu, the first option of which is Network; on a Dell PE 1950/2950 pressing F12 initiates PXE booting directly.

Boot

Looking at journald on the PXE server will provide some additional insight to what exactly is going on during the early stages of the PXE boot process:

# journalctl -u dnsmasq -f

dnsmasq-dhcp[2544]: DHCPDISCOVER(eth1) 00:1a:64:6a:a2:4d
dnsmasq-dhcp[2544]: DHCPOFFER(eth1) 192.168.0.110 00:1a:64:6a:a2:4d
dnsmasq-dhcp[2544]: DHCPREQUEST(eth1) 192.168.0.110 00:1a:64:6a:a2:4d
dnsmasq-dhcp[2544]: DHCPACK(eth1) 192.168.0.110 00:1a:64:6a:a2:4d
dnsmasq-tftp[2544]: sent /mnt/archiso/arch/boot/syslinux/pxelinux.0 to 192.168.0.110
dnsmasq-tftp[2544]: sent /mnt/archiso/arch/boot/syslinux/archiso.cfg to 192.168.0.110
dnsmasq-tftp[2544]: sent /mnt/archiso/arch/boot/syslinux/whichsys.c32 to 192.168.0.110
dnsmasq-tftp[2544]: sent /mnt/archiso/arch/boot/syslinux/archiso_pxe_choose.cfg to 192.168.0.110
dnsmasq-tftp[2544]: sent /mnt/archiso/arch/boot/syslinux/ifcpu64.c32 to 192.168.0.110
dnsmasq-tftp[2544]: sent /mnt/archiso/arch/boot/syslinux/archiso_pxe_both_inc.cfg to 192.168.0.110
dnsmasq-tftp[2544]: sent /mnt/archiso/arch/boot/syslinux/archiso_head.cfg to 192.168.0.110
dnsmasq-tftp[2544]: sent /mnt/archiso/arch/boot/syslinux/archiso_pxe32.cfg to 192.168.0.110
dnsmasq-tftp[2544]: sent /mnt/archiso/arch/boot/syslinux/archiso_pxe64.cfg to 192.168.0.110
dnsmasq-tftp[2544]: sent /mnt/archiso/arch/boot/syslinux/archiso_tail.cfg to 192.168.0.110
dnsmasq-tftp[2544]: sent /mnt/archiso/arch/boot/syslinux/vesamenu.c32 to 192.168.0.110
dnsmasq-tftp[2544]: sent /mnt/archiso/arch/boot/syslinux/splash.png to 192.168.0.110

After you load pxelinux.0 and archiso.cfg via TFTP, you'll (hopefully) be presented with a syslinux boot menu with several options, two of which are of potential usefulness to us.

Select either

Boot Arch Linux (x86_64) (HTTP)

or

Boot Arch Linux (i686) (HTTP)

depending on your CPU architecture.

Next the kernel and initramfs (appropriate for the architecture you selected) will be transferred, again via TFTP:

dnsmasq-tftp[2544]: sent /mnt/archiso/arch/boot/x86_64/vmlinuz to 192.168.0.110
dnsmasq-tftp[2544]: sent /mnt/archiso/arch/boot/x86_64/archiso.img to 192.168.0.110

If all goes well, you should then see activity on darkhttpd coming from the PXE-target; at this point the kernel would be loaded on the PXE-target, and in init:

After the root filesystem is downloaded via HTTP, you'll eventually end up at a root zsh prompt with that fancy grml config.

Post-boot

Unless you want all traffic to be routed through your PXE server (which won't work anyway unless you set it up properly), you'll want to kill dnsmasq and get a new lease on the install target, as appropriate for your network layout.

# systemctl stop dnsmasq.service

You can also kill darkhttpd; the target has already downloaded the root filesystem, so it's no longer needed. While you're at it, you can also unmount the installation image:

NBD

Low memory

The copytoraminitramfs option can be used to control whether the root filesystem should be copied to ram in its entirety in early-boot.

It highly recommended to leave this option alone, and should only be disabled if entirely necessary (systems with less than ~256MB physical memory). Append copytoram=n to your kernel line if you wish to do so.