April 29, 2009
Live CDs are great. In particular, they’re a great way to try out software, knowing that the chances of damaging the host system are minimal and you can throw away the entire system if you want to.
Sometimes you want to use a live CD environment without a CD. CDs are slow, get lost and scratched, and require a CD drive. If you’re going to use live environments a lot, you’d probably prefer to boot them over the network from a machine with a hard disk and a cache.
Luckily, Ubuntu’s live CD includes all the necessary support to do this easily, if you know how to use it. Unfortunately, it’s not really documented as far as I can tell. Please correct me if I’m wrong about this.
I managed to make the live CD boot over the network on a PXE client using the following steps.
- set your DHCP server up to hand off to a TFTP server. For example, add the following lines to your subnet definition in /etc/dhcp3/dhcpd.conf:
next-server 10.0.156.34; filename "pxelinux.0";
pxelinux.0from the pxelinux package and put it in the tftproot of your TFTP server.
casperdirectory off the CD and put it into your tftproot as well.
/etc/exportson the server and export the mount directory to the world by adding the following line:
DEFAULT live-804 LABEL live-804 kernel casper/vmlinuz append file=/cdrom/preseed/ubuntu.seed boot=casper initrd=ubuntu/ubuntu-8-04/casper/initrd.gz netboot=nfs nfsroot=220.127.116.11:/var/nfs/ubuntu/live quiet splash --
I hope this helps someone, and that NFS-booting a live environment will be properly documented (better than this!) one day.
(Also filed on Ubuntu bug 296089.)