fooninja.net

Notes on Linux/BSD/Unix and other digital matters

Linux/BSD network install using PXE and Windows

published

If you need to install Linux or one of the BSD:s on a computer without an optical drive and over the network, it’s simple. Here’s how to do it with Windows as the PXE host. I’ll show you how to install Ubuntu, CentOS and OpenBSD, but you can easily adapt the instructions for other systems.

Prerequisites:

  • A Windows machine running tftpd32, a free TFTP/DHCP server
  • A client machine that supports PXE boot
  • PXE and boot files for the operating system you want to install

Install tftpd32

Tftpd32 is a free DHCP/TFTP/DNS/SNTP/syslog server, and also a TFTP client, for Windows. We only need the DHCP/TFTP part.

  1. Download the latest version (I used 3.50) and install/extract it to C:\tftpd.
  2. Create the subdirectory C:\tftpd\root. You will put the install files here later.

Prepare the network

Depending on your network you might not have to do this, but to avoid any issues with my normal network, which already has a DHCP server that I don’t want to bother changing, I temporarily put the host computer and the client (my laptop) on their own network. I configured the host to use 192.168.1.10, netmask 255.255.255.0. After the installation is successfully started I connect the client to the normal network again and do the usual net install over the Internet.

Note: if you get an error like “PXE-E11: ARP timeout” on the client, make sure nothing strange is going on with the network. Apparently this error can be caused by a number of things, including the hub/switch you use. If you don’t have a different one available, consider getting a crossover cable - cheap and often useful.

Configure tftpd32

  1. Start tftpd32.exe and click on Settings.
  2. In the tab GLOBAL, make sure that at least TFTP Server and DHCP Server are checked.
  3. In the tab TFTP, point Base Directory to C:\tftpd\root.
  4. In the tab DHCP, fill in your desired network settings. Since I had the host and the client on a separate network, and was going to switch over to the normal network later anyway, I just set IP Pool starting address to 192.168.1.100, Size of pool to 10 and mask to 255.255.255.0. Note the field Boot File - you will probably have to change this later.

Tftpd32 settings (TFTP) Tftpd32 settings (DHCP)

Install Ubuntu

  1. Download the netboot files from one of the Ubuntu archive mirrors: dists/maverick/main/installer-amd64/current/images/netboot/netboot.tar.gz The above line is for the amd64 version of Maverick (10.10); replace with whatever architecture/release you need. For your convenience, here’s a direct link to the amd64/maverick file on archive.ubuntu.com. It’s about 13 MB.
  2. Extract netboot.tar.gz to C:\tftpd\root.
  3. Copy the file C:\tftpd\root\ubuntu-installer\amd64\pxelinux.cfg\default to C:\tftpd\root\pxelinux.cfg (change amd64 to i386 if necessary)
  4. In Tftpd32 -> Settings -> DHCP, set Boot File to pxelinux.0

You should now be good to go. In the client computer’s BIOS, make sure that network boot comes first. (On my Thinkpad X61s, it’s “PCI LAN: …” in Startup -> Boot.)

If you get an error like “TFTP prefix: Unable to locate configuration file”, double-check that you copied the files correctly.

If you still have problems, also see the comment by Dmitri below.

Install CentOS

  1. Download the contents of the isolinux directory from one of  the  CentOS mirrors: e.g. 5.5/os/x86_64/isolinux.
  2. Put all the files right in C:\tftpd\root (not in a subdirectory).
  3. Create the directory C:\tftpd\root\pxelinux.cfg
  4. Copy C:\tftpd\root\isolinux.cfg to C:\tftpd\root\pxelinux.cfg\default. Note: no extension! In Explorer’s Folder options, make sure “Hide extensions for known file types” is not checked.
  5. Download syslinux (Version 4! See note below) and extract the file pxelinux.0 to C:\tftpd\root. It’s in the core directory in the syslinux zip/tar.gz.
  6. In Tftpd32 -> Settings -> DHCP, set Boot File to pxelinux.0

Basil comments: Be sure to use syslinux version 4. Versions 5 and 6 made significant changes in COM32 and will not work with these instructions. Took me reading an install script (and a couple of hours searching) where the programmer kindly left great comments on the topic.

Done!

Install OpenBSD

  1. Download pxeboot and bsd.rd from your favorite mirror. They are in e.g. 4.7/amd64, 4.7/i386.
  2. Put the files in C:\tftpd\root.
  3. In Tftpd32 -> Settings -> DHCP, set Boot File to pxeboot.

That’s it. If you require other settings than the pxeboot defaults, look here.

If you get the error “panic: reverse arp not answered by rarpd(8) or dhcpd(8)”, maybe you loaded bsd instead of bsd.rd?

Comments