I posted a while back on the usefulness of using the PXE Netboot client available in most modern PCs, to boot up a Ubuntu install session over the network. I found this particularly useful, since I have a laptop with no DVD/CD, so the install CD option is really a non-starter. However, I recently started wondering if it was possible to boot a full live Ubuntu session over PXE Netboot, basically creating full diskless workstations using open-source tech. I did a bit of research, and found that the folks on the Ubuntu documentation wiki, have already made some great strides in that regard (https://wiki.ubuntu.com/LiveCDNetboot). I’ve modified their instructions slightly for my environment, and to get a bit more flexibility. In my previous post on using PXE to netboot, I highlighted the setup for hcpd3, tftd and pxe that would allow a PXE client to boot up with the Ubuntu installer. I’ve added some modifications to that, creating an option for booting using the 8.10 (Intrepid) Live CD image.

The first change I made was to mount and copy the livecd image for Intrepid Ibex (Ubuntu 8.10),  on the filesystem using a standard loopback:

$ sudo mkdir /mnt/ubuntu8-iso

$ sudo mount -o loop ubuntu-8.10-desktop-i386.iso /mnt/ubuntu8-iso

$ ls -CF /mnt/ubuntu8-iso
autorun.inf  install/    pics/     README.diskdefines  wubi.exe
casper/      isolinux/   pool/     ubuntu@
dists/       md5sum.txt  preseed/  umenu.exe

I made a copy of the mounted image in the /var/lib/tftpboot directory to use as the source for mounting in my PXE-based live sessions:

$ cd /var/lib/tftpboot

$ sudo mkdir ubuntu8-iso

$ sudo cp -R  /mnt/ubuntu8-iso/* ubuntu8-iso/

$ cd /var/lib/tftpboot

The livecd boot mechanism requires that the boot image filesystem be available to the PXE client after the PXE boot process has begun; to enable this. an NFS export is made that shares the filesystem for mounting at boot itme on the client. The first step was to edit the /etc/exports file with the path to the image fileystem:

$  sudo vi /etc/exports

and adding the following line (your server and path may vary):

/var/lib/tftpboot/ubuntu8-iso,no_root_squash,async)                 #share the image filesystem to all IP’s in the subnet, read-only, don’t use the squash filesystem

I then restarted the nfs service to export the new share:

$ sudo /etc/init.d/nfs-kernel-server reload

Theoretically, it should be possible to do this share using a samba mount as well, which may be preferable in situations where NFS is unavailable or undesirable.

The next step was to modify the default PXE config file to include a menu option for booting up from the livecd image. I changed working directory to the /var/lib/tftpboot/pxelinux.cfg directory, and edited the file default.

$ cd /var/lib/tftpboot/pxelinux.cfg

$ vi default

I then added a new option for the livecd as follows:

DEFAULT livecd
LABEL livecd
kernel ubuntu8-iso/casper/vmlinuz
append break=init
append boot=casper netboot=nfs nfsroot= initrd=ubuntu8-iso/casper/initrd.gz splash —

Having already configured my laptop to pick up the PXE service, all that was necessary was to boot it up in LAN agent mode, at which point the default Ubuntu boot screen turned up. Since my default was now set to livecd, hitting enter, started the boot process. There was one snafu, which seems particular to Intrepid; the boot process hangs after the diagnostics indicate that X-Windows should be starting. Some investigation on the Launchpad bug list suggested that bug 268005 (basically, network availability at boot time) was the problem. The simplest workaround, was to press alt+sysrq+e, all at the same time. This terminated all the processes which were running/hanging, and allowed the X-server to come up, giving a full live cd Ubuntu session. I’m sure that software or configuration work-around exists, hopefully it will make it’s way to the bug tracker soon. None the less, this worked out pretty well.