PXE install of Ubuntu on a Lenovo Thinkpad X200

Introduction
The easiest way to install Ubuntu on a subnotebook such as the thinkpad X200 is to use Unetbootin and I would have loved it to be so easy. However the Windows Vista Boot Manager would boot on the image and told me that:

File: \ubnldr.mbr
Status: 0xc000000f
Info: The selected entry could not be loaded because the application is missing or corrupt.


So I needed to find another way of installing Ubuntu on my new laptop. The following is not an easy method but in my case it was the only way. In short I will setup a TFTP server Ubuntu machine and configure the DHCP server in DD-WRT router to give this information to the PXE client on my Thinkpad X200 laptop.

Requirements
This can of cause be done on any machine running Linux with a DHCP server but I found it was really nice to have my current DHCP server on my Linksys WRT54GL router (running DD-WRT) to tell the PXE client that the files was on my located on a different machine.

Setting up the router
The first thing I did was to setup the router. The router uses the opensource firmware DD-WRT which I can use to point to a TFTP server to serve bootup files. Under Administration/Services I have enable the DNSMasq and given the following “Additional DNS Options”:

dhcp-boot=/var/lib/tftpboot/pxelinux.0,nobel,192.168.1.153

This will make PXE clients load the file /var/lib/tftpboot/pxelinux.0 from the tftp server running on the machine called nobel with the ip 192.168.1.153.

Setting up the TFTP server
The machine on 192.168.1.153 is my server running Ubuntu 8.04.1 LTS. I installed the tftp-hpa package:

aptitude install tftpd-hpa

and by looking in the file /etc/default/tftpd-hpa I could see that the default folder for the fileserver was /var/lib/tftpboot/. So change the directory to the folder and downloaded the netboot.tar.gz folder for Ubuntu 8.04 that I wanted to use:

cd  /var/lib/tftpboot/
wget http://archive.ubuntu.com/ubuntu/dists/hardy/main/installer-i386/current//images/netboot/netboot.tar.gz
tar xvzf netboot.tar.gz
chmod -R 777 /var/lib/tftpboot/

Now the files were in place so I needed to tell inetd.conf to find the files in that folder, so edited /etc/inetd.conf.

root@nobel:/var/lib/tftpboot# cat /etc/inetd.conf
tftp            dgram   udp     wait    root    /usr/sbin/tcpd  /usr/sbin/in.tftpd /var/lib/tftpboot/

Two things should be noted here. When editing this file tabs and spaces are not the same. The second and more annoying thing is that the TFTP server needs to run as root and not as nobody since it will otherwise fail like this (see /var/log/syslog):

May  9 16:46:13 lime in.tftpd[1172]: cannot set groups for user nobody
May  9 16:46:15 lime in.tftpd[1173]: cannot set groups for user nobody
May  9 16:46:17 lime in.tftpd[1174]: cannot set groups for user nobody

After having edited these files I restarted inetd and the tftp-hda servers. In the official Ubuntu document it is falsely stated that this is done by writing /etc/init.d/inetd reload but the correct commands are:

/etc/init.d/openbsd-inetd restart
/etc/init.d/tftpd-hpa restart

Since openbsd-inetd is the inetd version that is provided with tftpd-hpa which is the prefered TFTP server in the official documentation.

References
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=4662&highlight=pxe
https://help.ubuntu.com/8.04/installation-guide/i386/install-tftp.html
http://www.packetpro.com/~peterson/linux-tftpd.html

Only registered users can comment.

Leave a Reply