netboot ubuntu live CD (using NFS & grub)

Step-by-Step descriptions of how to do things.
Post Reply
User avatar
^rooker
Site Admin
Posts: 1481
Joined: Fri Aug 29, 2003 8:39 pm

netboot ubuntu live CD (using NFS & grub)

Post by ^rooker »

I wanted to boot ubuntu live CD over the network (I hate to burn a CD).
Now there are 2 options:

a) DHCP + tftp + pxelinux
b) Grub on client's disk (e.g. floppy) + NFS

I'm still working on (a), but I got (b) up and running right now, so here we go:

1) download the current ubuntu live ISO (e.g. ubuntu-8.04-desktop-i386.iso)
2) Install NFS on your server:

Code: Select all

apt-get install nfs-kernel-server
3) mount the live ISO on your NFS server:
mount -o loop -t iso9660 ubuntu-8.04-desktop-i386.iso /media/images/ubuntu-hardy

4) share that folder, by adding the following line to /etc/exports:

Code: Select all

/media/images/ubuntu-hardy     192.168.1.0/255.255.255.0(async,no_root_squash,no_subtree_check,ro)
That's just how it looks on my system. you must change the path, IP and submask according to your setup.

5) copy 2 files from that iso to your client's /boot/ folder:
/media/images/ubuntu-hardy/casper/vmlinuz -> /boot/vmlinuz_hardy
/media/images/ubuntu-hardy/casper/initrd.gz -> /boot/initrd_hardy.gz

6) Add the following lines to /boot/grub/menu.lst on your target (client) machine:

Code: Select all

label   ubuntu-netboot
root (hd0,0)
kernel /boot/vmlinuz_hardy root=/dev/nfs boot=casper netboot=nfs ro nfsroot=192.168.1.x:/media/ubuntu-hardy ip=dhcp
initrd /boot/initrd_hardy.gz
7) Now when you boot your client machine, it will load its grub and present you the new boot option "ubuntu-netboot"

Thanks to these info resources:
Grub NFS boot (sjoerd)
Live CD netboot (ubuntu wiki)
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
User avatar
^rooker
Site Admin
Posts: 1481
Joined: Fri Aug 29, 2003 8:39 pm

Post by ^rooker »

Problems I've encountered:
During booting of the live distro over nfs, it got stuck in a loop of these error messages:
Begin: Running /scripts/nfs-premount
mount: Device or resource busy
The logs in /var/log/syslog on my nfs server said:
Oct 28 00:53:47 dracul mountd[1673]: Fake hostname 192-168-001-213.tele.net for 192.168.1.213 - forward lookup doesn't exist
Oct 28 00:53:47 dracul mountd[1673]: authenticated mount request from 192.168.1.213:994 for /media/images/kubuntu-desktop-hardy (/media/images/kubuntu-desktop-hardy)
Oct 28 00:53:48 dracul mountd[1673]: Fake hostname 192-168-001-213.tele.net for 192.168.1.213 - forward lookup doesn't exist
Oct 28 00:53:48 dracul mountd[1673]: authenticated mount request from 192.168.1.213:777 for /media/images/kubuntu-desktop-hardy (/media/images/kubuntu-desktop-hardy)
Oct 28 00:53:48 dracul mountd[1673]: Fake hostname 192-168-001-213.tele.net for 192.168.1.213 - forward lookup doesn't exist
Oct 28 00:53:48 dracul mountd[1673]: refused unmount request from 192.168.1.213 for /root (/): not exported
Oct 28 00:53:49 dracul mountd[1673]: Fake hostname 192-168-001-213.tele.net for 192.168.1.213 - forward lookup doesn't exist
Oct 28 00:53:49 dracul mountd[1673]: authenticated mount request from 192.168.1.213:816 for /media/images/kubuntu-desktop-hardy (/media/images/kubuntu-desktop-hardy)
This was caused by using old kernel options in /boot/grub/menu.lst. The broken entry looked like this:

Code: Select all

kernel /boot/vmlinuz_hardy root=/dev/nfs nfsroot=192.168.1.x:/media/images/ubuntu-hardy ip=dhcp
Since ubuntu "Hardy" (8.04), you must supply additional options:

Code: Select all

boot=casper netboot=nfs
The problem with "fake hostname" still persists on my system, but it works.
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply