Difference between revisions of "Install Arch from network via PXE"

From ArchWiki
Jump to: navigation, search
m (added a troubleshooting step for vesamenu.c32 not found)
(Redirected page to PXE)
Line 1: Line 1:
[[Category:Getting and installing Arch]]
+
#REDIRECT[[PXE]]
[[fr:Install PXE]]
 
[[ru:Install Arch from network via PXE]]
 
{{merge|Archiso_as_pxe_server|Other article is more up-to-date, but this one has better explanation}}
 
{{Accuracy|Both the July and August ISO releases have the boot directory inside /arch. |Talk:Install Arch from network via PXE#Confirm : instructions are outdated}}
 
== Network booting ==
 
 
 
Did your tiny laptop come without a CDROM drive, and does not allow you to boot from a usb drive? Fear not, you can boot using PXE.
 
 
 
PXE is short for Preboot eXecution Environment and is a piece of software that usually resides deep within the guts of the BIOS to allow booting over the network interface. In order to boot into PXE check your BIOS' boot options. It is common to use the Ethernet port.
 
 
 
===How it works===
 
 
 
Booting with PXE roughly works as follows:
 
* a client (the one you want to install to) boots into the environment and asks continously for a DHCP lease (or IP if you will).
 
* a DHCP server leases an IP to the client.
 
* then a tftp (which is a lot like regular ftp) server delivers the files to boot to the target.
 
 
 
after that the client boots. Once booted it is rather safe to kill the connection if necessary (e.g. to install from the net instead of the image served by tftp).
 
 
 
=== Requisites ===
 
 
 
You need at least the following:
 
* a server capable of running DHCPD
 
* a server capable of running (a)tftpd
 
* the [ftp://ftp.archlinux.org/iso/archboot/latest/ archboot installation iso] (the official images can not be used for this)
 
 
 
The DHCP and tftp server can be the same computer if you only have one.
 
 
 
Be sure to have the ports to the client (or target) open. When in doubt consider disabling iptables or any firewall that might be active.
 
 
 
Also be sure that the interface (ethX usually) is up and active.
 
 
 
ifconfig eth0 up
 
ifconfig eth0 192.168.0.2
 
 
 
If you want to boot without a router between the server and the client you have to manually set an IP for ethX and a route.
 
 
 
route add default gw 192.168.0.1
 
 
 
a nameserver needs also to be added.
 
 
 
echo nameserver 192.168.0.1 >> /etc/resolv.conf
 
 
 
If a router is between the server and the client disabling DHCP on the router might be necessary, else you should be able to ignore these steps.
 
 
 
Alternatively, if your router has dnsmasq installed (like the *WRT family) you can configure it in the router with the following option:
 
 
 
dhcp-boot=pxelinux.0,''<hostname-of-the-tftd-server>'',''<ip-of-the-tftd-server>''
 
 
 
[http://www.dd-wrt.com/wiki/index.php/PXE Here] is an example for DD-WRT.
 
 
 
== Preparing tftpd ==
 
 
 
Mount archboot.iso and copy the contents of the folder boot to /var/tftpboot/:
 
 
 
mount -o loop,ro archboot.iso /mnt/iso
 
cp -a /mnt/iso/boot/ /var/tftpboot/
 
 
 
Link to pxelinux.0 from the tftp root:
 
 
 
ln -s /var/tftpboot/boot/syslinux/pxelinux.0 /var/tftpboot/pxelinux.0
 
 
 
Create a pxelinux.cfg configuration directory and link to the relevant config file:
 
 
 
mkdir /var/tftpboot/pxelinux.cfg
 
ln /var/tftpboot/boot/syslinux/syslinux.cfg /var/tftpboot/pxelinux.cfg/default
 
 
 
Your Arch Linux network installer is now ready.
 
 
 
If upon booting, you receive errors along the lines of 'vesamenu.c32' not found you may have to edit the path in the /var/tftpboot/pxelinux.cfg/default config file.
 
 
 
  # change the line: DEFAULT vesamenu.c32 to
 
  DEFAULT /boot/syslinux/vesamenu.c32
 
 
 
==Method 1 - Using dnsmasq==
 
 
 
This one is a bit easier since dnsmasq already has a tftp server builtin.
 
Install dnsmasq on your server:
 
 
 
pacman -S dnsmasq
 
 
 
Edit the configuration file for dnsmasq in:
 
 
 
/etc/dnsmasq.conf
 
 
 
The configuration file comments are rather verbose and should be self-explanatory. You should at least enable the following settings:
 
 
 
dhcp-range=192.168.0.50,192.168.0.150,12h
 
dhcp-boot=pxelinux.0
 
enable-tftp
 
tftp-root=/var/tftpboot
 
 
 
As for the necessary files to be able to boot follow the instructions as given at "Preparing tfptd".
 
Now run dnsmasq.
 
 
 
rc.d start dnsmasq
 
 
 
==Method 2 - using dhcpd==
 
 
 
Install the necessary programs on the existing Arch Linux computer which will act as the server for the installation on your client:
 
 
 
pacman -S tftp-hpa dhcp
 
 
 
Replace the default /etc/dhcpd.conf with the following (adjust to your network environment):
 
 
 
# /etc/dhcpd.conf
 
option domain-name-servers 208.67.222.222, 208.67.220.220;
 
default-lease-time 86400;
 
max-lease-time 604800;
 
authoritative;
 
subnet 192.168.0.0 netmask 255.255.255.0 {
 
  range 192.168.0.10 192.168.0.49;
 
  filename "pxelinux.0";        # the PXELinux boot agent
 
  option subnet-mask 255.255.255.0;
 
  option broadcast-address 192.168.0.255;
 
  option routers 192.168.0.1;
 
}
 
 
 
Dhcpd will not run without ipv6. If you have disabled ipv6, reload the module:
 
 
 
modprobe ipv6
 
 
 
Be sure to static the LAN IP to the same subnet as '''option routers''' IP to get the DHCP server to start:
 
ifconfig eth0 192.168.0.1 255.255.255.0
 
 
 
Now make sure the dhcpd and tftpd daemons are running on the server.
 
# /etc/rc.d/tftpd start
 
# /etc/rc.d/dhcpd start
 
 
 
Boot your destination machine over PXE (usually something like F12 (on Dells) or F11 (on Supermicro's), or enable it in the BIOS).
 
 
 
When you get the PXEBoot prompt, type 'arch' or hit return to start the installer. The install should now progress the same as if you booted from CD. You can continue installation by following the [[Beginners' Guide]] or the [[Official Installation Guide]].
 

Revision as of 04:21, 22 September 2012

Redirect to: