Netbooting Ubuntu Live CDs

Introduction

It is possible to boot an Ubuntu live CD from the network, although the process is quite experimental. There are two parts to this: booting vmlinuz+initrd.gz from a PXE boot server, and accessing the root filesystem (containing filesystem.squashfs) over NFS. These are independent, and you can do either one without the other. e.g. for testing you could boot vmlinuz and initrd.gz from a disk or USB drive with GRUB or syslinux, as long as you pass the right kernel command line. NFS root is the tricky part, since it depends on scripts in the initramfs's /init to do the right thing; current status:

* Gutsy and earlier: working. Previous versions of this page only documented this case, so if it's wrong now, try looking back at previous versions.

* Hardy: working

* Intrepid : working

* Jaunty : working

* Karmic : working (And, if you are installing Karmic you can use the super-simple process described in the "Automation script" section below.)

Preparation

All var=value arguments set environment vars for /init, but /init parses /proc/cmdline only for lower-case options. Sometimes it does more than just setting the uppercase equivalent. quiet and splash are optional. text would stop GDM from running. (This isn't specific to netbooting, though)

Example

My syslinux livecd label looks like this with the following details:

# menu.c32 is in the syslinux package.  It will tftp load the pxelinux.cfg config file itself, which can be useful when editting it.
default menu.c32
SAY press return for menu
#TIMEOUT 50


LABEL live-gutsy
        kernel ubuntu-7.10-desktop/casper/vmlinuz
        append root=/dev/nfs boot=casper netboot=nfs nfsroot=192.168.1.100:/data/images/diskless/ubuntu-7.10-desktop initrd=ubuntu-7.10-desktop/casper/initrd.gz quiet splash --

LABEL live-hardy-i386
        kernel hardy-i386/vmlinuz
        append boot=casper netboot=nfs nfsroot=192.168.2.200:/srv/tftpboot/hardy-i386/mnt initrd=hardy-i386/initrd.gz --

LABEL live-intrepid-i386
        kernel intrepid-i386/vmlinuz
        append boot=casper netboot=nfs nfsroot=192.168.2.200:/srv/tftpboot/intrepid-i386/mnt initrd=intrepid-i386/initrd.gz --

Notes

* If your image hangs during the boot sequence just after the message about "squashfs: version 3.3", after a minute try the key combination Alt+Enter. It will then continue booting.

Automation script

This script completely automates the aforementioned method, with a few modifications (you don't need to download it from this link, the 'wget' described below does this all automatically). Steps to use it:

wget 'http://alkisg.mysch.gr/steki/index.php?action=dlattach;topic=2525.0;attach=1421' -O /tmp/livecd-netboot && sudo sh /tmp/livecd-netboot

It's also possible to use that script in a normal session, but novice users are advised to use it only in live sessions.

Discussion

LiveCDNetboot (last edited 2011-06-27 17:11:50 by alkisg)