Difference between revisions of "PXE"

From ArchWiki
Jump to: navigation, search
(Boot: added ic/bc templates where appropriate)
(update link(s) (avoid redirect))
(43 intermediate revisions by 14 users not shown)
Line 2: Line 2:
 
[[Category:Networking]]
 
[[Category:Networking]]
 
[[Category:Boot process]]
 
[[Category:Boot process]]
 +
[[es:PXE]]
 
[[fr:Install PXE]]
 
[[fr:Install PXE]]
[[ru:Install Arch from network via PXE (Русский)]]
+
{{Related articles start}}
{{Article summary start}}
+
{{Related|Diskless System}}
{{Article summary text|Detailed guide to booting official installation media via PXE.}}
+
{{Related articles end}}
{{Article summary heading|Related}}
+
From [[Wikipedia:Preboot Execution Environment]]:
{{Article summary wiki|Diskless network boot NFS root}}
+
:''The Preboot eXecution Environment (PXE, also known as Pre-Execution Environment; sometimes pronounced "pixie") is an environment to boot computers using a network interface independently of data storage devices (like hard disks) or installed operating systems.''
{{Article summary wiki|Diskless network boot NBD root}}
+
 
{{Article summary end}}
+
In this guide, PXE is used to boot the installation media with an appropriate option-rom that supports PXE on the target.
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.
+
  
 
== Preparation ==
 
== Preparation ==
  
[[Archiso]] makes it fairly trivial to use the official install media directly to set up PXE booting and, unlike earlier methods (archboot), does not require any modification and can be used as-is.
+
Download the latest official install media from [https://www.archlinux.org/download/ here].
 
+
Download the latest official install media from your [[Mirrors|favorite mirror]].
+
 
+
{{hc|$ wget http://hive.ist.unomaha.edu/archlinux/iso/latest/archlinux-2012.09.07-dual.iso|2=
+
<nowiki>--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]</nowiki>}}
+
  
 
Next mount the image:
 
Next mount the image:
  
# mkdir -p /mnt/archiso
+
{{bc|1=
# mount -o loop,ro archlinux-2012.09.07-dual.iso /mnt/archiso
+
# mkdir -p /mnt/archiso
 +
# mount -o loop,ro archlinux-2013.11.01-dual.iso /mnt/archiso}}
  
 
== Server setup ==
 
== Server setup ==
 +
 +
You will need to setup a DHCP, TFTP, and HTTP server to configure networking, load pxelinux/kernel/initramfs, and finally load the root filesystem (respectively).
 +
 
=== Network ===
 
=== Network ===
  
 
Bring up your wired NIC, and assign it an address appropriately.
 
Bring up your wired NIC, and assign it an address appropriately.
  
# ip l s eth0 up
+
{{bc|1=
# ip a a 192.168.0.1/24 dev eth0
+
# ip link set eth0 up
 +
# ip addr add 192.168.0.1/24 dev eth0}}
  
 
=== DHCP + TFTP ===
 
=== 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.
+
You will 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.
  
 
Install {{pkg|dnsmasq}}:
 
Install {{pkg|dnsmasq}}:
  
{{hc|# pacman -S dnsmasq|2=
+
{{bc|# pacman -S dnsmasq}}
<nowiki>resolving dependencies...
+
looking for inter-conflicts...
+
 
+
Targets (1): dnsmasq-2.63-1
+
 
+
Total Download Size:    0.14 MiB
+
Total Installed Size:  0.36 MiB
+
 
+
Proceed with installation? [Y/n]
+
:: Retrieving packages from extra...
+
dnsmasq-2.63-1-x86_64    141.6 KiB  108M/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 dnsmasq                          [###############] 100%</nowiki>}}
+
  
 
Configure {{pkg|dnsmasq}}:
 
Configure {{pkg|dnsmasq}}:
Line 74: Line 49:
 
bind-interfaces
 
bind-interfaces
 
dhcp-range=192.168.0.50,192.168.0.150,12h
 
dhcp-range=192.168.0.50,192.168.0.150,12h
dhcp-boot=/arch/boot/syslinux/pxelinux.0
+
dhcp-boot=/arch/boot/syslinux/lpxelinux.0
 
dhcp-option-force=209,boot/syslinux/archiso.cfg
 
dhcp-option-force=209,boot/syslinux/archiso.cfg
 
dhcp-option-force=210,/arch/
 
dhcp-option-force=210,/arch/
Line 82: Line 57:
 
Start {{pkg|dnsmasq}}:
 
Start {{pkg|dnsmasq}}:
  
# systemctl start dnsmasq.service
+
{{bc|# systemctl start dnsmasq.service}}
 
+
For those still using sysvinit:
+
 
+
# rc.d start dnsmasq
+
  
 
=== HTTP ===
 
=== HTTP ===
  
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 121: Line 75:
 
== Installation ==
 
== 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.
+
For this portion you will 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 ===
 
=== Boot ===
  
Looking at {{ic|/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:
{{hc|# grep dnsmasq /var/log/messages.log|2=
+
{{hc|<nowiki># journalctl -u dnsmasq -f</nowiki>|2=
 
<nowiki>
 
<nowiki>
Sep 22 15:59:19 helios dnsmasq-dhcp[2544]: DHCPDISCOVER(eth1) 00:1a:64:6a:a2:4d  
+
dnsmasq-dhcp[2544]: DHCPDISCOVER(eth1) 00:1a:64:6a:a2:4d  
Sep 22 15:59:19 helios dnsmasq-dhcp[2544]: DHCPOFFER(eth1) 192.168.0.110 00:1a:64:6a:a2:4d  
+
dnsmasq-dhcp[2544]: DHCPOFFER(eth1) 192.168.0.110 00:1a:64:6a:a2:4d  
Sep 22 15:59:23 helios dnsmasq-dhcp[2544]: DHCPREQUEST(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  
Sep 22 15:59:23 helios dnsmasq-dhcp[2544]: DHCPACK(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  
Sep 22 15:59:23 helios 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/pxelinux.0 to 192.168.0.110
Sep 22 15:59:23 helios 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/archiso.cfg to 192.168.0.110
Sep 22 15:59:23 helios 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/whichsys.c32 to 192.168.0.110
Sep 22 15:59:23 helios 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/archiso_pxe_choose.cfg to 192.168.0.110
Sep 22 15:59:23 helios 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/ifcpu64.c32 to 192.168.0.110
Sep 22 15:59:23 helios 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_pxe_both_inc.cfg to 192.168.0.110
Sep 22 15:59:23 helios 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_head.cfg to 192.168.0.110
Sep 22 15:59:23 helios 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_pxe32.cfg to 192.168.0.110
Sep 22 15:59:23 helios 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_pxe64.cfg to 192.168.0.110
Sep 22 15:59:23 helios 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/archiso_tail.cfg to 192.168.0.110
Sep 22 15:59:23 helios 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/vesamenu.c32 to 192.168.0.110
Sep 22 15:59:23 helios dnsmasq-tftp[2544]: sent /mnt/archiso/arch/boot/syslinux/splash.png to 192.168.0.110</nowiki>}}
+
dnsmasq-tftp[2544]: sent /mnt/archiso/arch/boot/syslinux/splash.png to 192.168.0.110</nowiki>}}
  
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.
+
After you load {{ic|pxelinux.0}} and {{ic|archiso.cfg}} via TFTP, you will (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
Line 160: Line 114:
  
 
{{bc|1=
 
{{bc|1=
Sep 22 15:59:30 helios 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/vmlinuz to 192.168.0.110
Sep 22 15:59:32 helios dnsmasq-tftp[2544]: sent /mnt/archiso/arch/boot/x86_64/archiso.img 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:  
 
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:  
Line 171: Line 125:
 
1348347588 192.168.0.110 "GET /arch/any/usr-share.fs.sfs" 200 63693037 "" "curl/7.27.0"}}
 
1348347588 192.168.0.110 "GET /arch/any/usr-share.fs.sfs" 200 63693037 "" "curl/7.27.0"}}
  
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 will eventually end up at a root zsh prompt with that fancy [https://www.archlinux.org/packages/extra/any/grml-zsh-config/ grml config].
  
 
=== 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 will not work anyway unless you [[Simple stateful firewall#Setting up a NAT gateway|set it up properly]]), you will want to kill {{pkg|dnsmasq}} and get a new lease on the install target, as appropriate for your network layout.
  
# systemctl stop dnsmasq.service
+
{{bc|# systemctl stop dnsmasq.service}}
  
For sysvinit users:
+
You can also kill {{pkg|darkhttpd}}; the target has already downloaded the root filesystem, so it's no longer needed. While you are at it, you can also unmount the installation image:
  
# rc.d stop dnsmasq
+
{{bc|# umount /mnt/archiso}}
  
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:
+
At this point you can follow the [[Installation guide|official installation guide]].
  
# umount /mnt/archiso
+
== Alternate Methods ==
  
At this point you can follow the [[Installation_Guide|official installation guide]].
+
As implied in the syslinux menu, there are several other alternatives:
  
== Alternate Methods ==
+
=== NFS ===
  
{{Accuracy|verify}}
+
You will need to set up an [[NFS|NFS server]] with an export at the root of your mounted installation media, which would be {{ic|/mnt/archiso}} if you followed the [[#Preparation|earlier sections]] of this guide.  After setting up the server, add the following line to your {{ic|/etc/exports}} file:
  
As implied in the syslinux menu, there are several other alternatives:
+
{{hc|/etc/exports|/mnt/archiso 192.168.0.0/24(ro,no_subtree_check)}}
  
=== NFS ===
+
If the server was already running, re-export the filesystems with {{ic|exportfs -r -a -v}}.
  
You will need to setup a [[NFS|NFS server]] with the root export at the root of your mounted installation media--that would be ''/mnt/archiso'' if you followed the [[PXE#Preparation|earlier sections]] of this guide.
+
The default settings in the installer expect to find the NFS at {{ic|/run/archiso/bootmnt}}, so you will need to edit the boot options.  To do this, press Tab on the appropriate boot menu choice and edit the {{ic|archiso_nfs_srv}} option accordingly:
 +
 
 +
{{bc|1=archiso_nfs_srv=${pxeserver}:/mnt/archiso}}
 +
 
 +
Alternatively, you can use {{ic|/run/archiso/bootmnt}} for the entire process.
 +
 
 +
After the kernel loads, the Arch bootstrap image will copy the root filesystem via NFS to the booting host.  This can take a little while.  Once this completes, you should have a running system.
  
 
=== NBD ===
 
=== NBD ===
 +
 +
{{Accuracy|verify}}
 +
{{Expansion}}
  
 
Install {{pkg|nbd}} and configure it:
 
Install {{pkg|nbd}} and configure it:
Line 207: Line 170:
 
[archiso]
 
[archiso]
 
     readonly = true
 
     readonly = true
     exportname = /dev/disk/by-label/ARCH_201208}}
+
     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. You should be aware that this option currently does not work if using HTTP for the transfer; NFS or NBD must be used.

Revision as of 13:05, 25 February 2014

Related articles

From Wikipedia:Preboot Execution Environment:

The Preboot eXecution Environment (PXE, also known as Pre-Execution Environment; sometimes pronounced "pixie") is an environment to boot computers using a network interface independently of data storage devices (like hard disks) or installed operating systems.

In this guide, PXE is used to boot the installation media with an appropriate option-rom that supports PXE on the target.

Preparation

Download the latest official install media from here.

Next mount the image:

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

Server setup

You will need to setup a DHCP, TFTP, and HTTP server to configure networking, load pxelinux/kernel/initramfs, and finally load the root filesystem (respectively).

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 will 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.

Install dnsmasq:

# pacman -S dnsmasq

Configure dnsmasq:

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

Start dnsmasq:

# systemctl start dnsmasq.service

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).

First, install darkhttpd:

# pacman -S darkhttpd

Then start darkhttpd using our /mnt/archiso as the document root:

# darkhttpd /mnt/archiso
darkhttpd/1.8, copyright (c) 2003-2011 Emil Mikulic.
listening on: http://0.0.0.0:80/

Installation

For this portion you will 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 will (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:

1348347586 192.168.0.110 "GET /arch/aitab" 200 678 "" "curl/7.27.0"
1348347587 192.168.0.110 "GET /arch/x86_64/root-image.fs.sfs" 200 107860206 "" "curl/7.27.0"
1348347588 192.168.0.110 "GET /arch/x86_64/usr-lib-modules.fs.sfs" 200 36819181 "" "curl/7.27.0"
1348347588 192.168.0.110 "GET /arch/any/usr-share.fs.sfs" 200 63693037 "" "curl/7.27.0"

After the root filesystem is downloaded via HTTP, you will 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 will not work anyway unless you set it up properly), you will 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 are at it, you can also unmount the installation image:

# umount /mnt/archiso

At this point you can follow the official installation guide.

Alternate Methods

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

NFS

You will need to set up an NFS server with an export at the root of your mounted installation media, which would be /mnt/archiso if you followed the earlier sections of this guide. After setting up the server, add the following line to your /etc/exports file:

/etc/exports
/mnt/archiso 192.168.0.0/24(ro,no_subtree_check)

If the server was already running, re-export the filesystems with exportfs -r -a -v.

The default settings in the installer expect to find the NFS at /run/archiso/bootmnt, so you will need to edit the boot options. To do this, press Tab on the appropriate boot menu choice and edit the archiso_nfs_srv option accordingly:

archiso_nfs_srv=${pxeserver}:/mnt/archiso

Alternatively, you can use /run/archiso/bootmnt for the entire process.

After the kernel loads, the Arch bootstrap image will copy the root filesystem via NFS to the booting host. This can take a little while. Once this completes, you should have a running system.

NBD

Tango-inaccurate.pngThe factual accuracy of this article or section is disputed.Tango-inaccurate.png

Reason: verify (Discuss in Talk:PXE#)

Tango-view-fullscreen.pngThis article or section needs expansion.Tango-view-fullscreen.png

Reason: please use the first argument of the template to provide a brief explanation. (Discuss in Talk:PXE#)

Install nbd and configure it:

# vim /etc/nbd-server/config
[generic]
[archiso]
    readonly = true
    exportname = /srv/archlinux-2013.02.01-dual.iso

Low memory

The copytoram initramfs 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. You should be aware that this option currently does not work if using HTTP for the transfer; NFS or NBD must be used.