Netboot/Ubuntu

From Sidvind
Jump to: navigation, search
Netboot
using pxelinux and tftp.

This shows how to setup serving of multiple ubuntu images over pxelinux netboot.

Prerequisites[edit]

  • DHCP server (assuming dhcpd, but steps should be similar for other servers)
  • NFS server
  • TFTP server

Image creation[edit]

Put the created folder in the TFTP root

  1. Grab DVD image from [1]
  2. Grab netboot files. Ensure you get the same version as the DVD image.
  3. wget -nc -R "index.*" -R '*.gif' -r http://archive.ubuntu.com/ubuntu/dists/oneiric/main/installer-i386/current/images/netboot/
    
  4. Merge files into a single directory (in TFTP root).
  5. cp -R archive.ubuntu.com/ubuntu/dists/*/main/installer-*/current/images/netboot/ubuntu-installer ubuntu-11.10-i386
    cp archive.ubuntu.com/ubuntu/dists/*/main/installer-*/current/images/netboot/*.tar.gz ubuntu-11.10-i386
    
  6. Fix include paths.
  7. find ubuntu-11.10-i386/boot-screens -name '*.cfg' -exec sed -i 's^ubuntu-installer/i386^ubuntu-11.10-i386^g' {} \;
    
  8. Mount DVD iso and copy content to NFS share (Don't forget the .disk directory)
  9. mount -o loop ubuntu-11.10-dvd-i386.iso temp
    mkdir /export/ubuntu-11.10-i386
    cp -r temp/* temp/.disk /export/ubuntu-11.10-i386/
    
  10. Export nfs share
  11. emacs /etc/exports
    /export/ubuntu-11.10-i386 1.2.3.4/255.255.255.0(async,no_root_squash,no_subtree_check,ro)
    /etc/init.d/nfs reload
    
  12. Copy casper to netboot dir
  13. cp -R /export/ubuntu-11.10-i386/casper ubuntu-11.10-i386
    

Configure pxelinux[edit]

  1. Install syslinux
  2. Copy pxelinux.0, pxelinux.cfg and vesamenu.c32 to TFTP root
  3. Edit pxelinux.cfg/default
DEFAULT vesamenu.c32
PROMPT 0
TIMEOUT 50
MENU TITLE netboot

LABEL ubuntu-11.10 i386 live
kernel ubuntu-11.10-i386/casper/vmlinuz
append root=/dev/nfs boot=casper netboot=nfs nfsroot=1.2.3.4:/export/ubuntu-11.10-i386 initrd=ubuntu-11.10-i386/casper/initrd.lz quiet splash --

LABEL ubuntu-11.10 i386 install
kernel ubuntu-11.10-i386/boot-screens/vesamenu.c32
append ubuntu-11.10-i386/boot-screens/menu.cfg

The first entry runs the live DVD of NFS while the second launches a small netinstall.

DHCP[edit]

Simply set:

filename "pxelinux.0";

If you run the TFTP server on another host use "next-server".