Just moozing

Before you can check your notes, you must make them…

Pxe booting – now with menus

with 2 comments

I decided that the command line solution described in an earlier post, could be made to look nicer with menus and I want it to be easier to update the entries with the latest Backtrack or Debian.

How it used to look

It works, but you have to type everything. This is awkward with entries like squeeze_i386_install and no tab-completion.

After doing a bit of research and digging through memory, it turns out that we are able to do most of the boot time niceness that we see on most Linux distros. Splash, menus, graphics and so on are all controlled by syslinux. We are relying on a subpart called pxelinux.

I downloaded the latest syslinux from their site, and that gave me a lot of files and binaries – including the .c32 files mentioned later.

For debugging, I have Virtualbox running with a disk less virtual machine that I reboot again and again to test the configuration.


That is simple (when you know how to do it). The documentation is found here. It boils down to adding

default menu.c32

to pxelinux.cfg/default, and copying menu.c32 to the root (as in the parent directory of pxelinux.cfg/).

Instead of menu.c32, you could use vesamenu.c32, but since I mostly use it for booting virtual machines and thin clients based on MAC, I decided on the simpler text-based menus.

The entries about BT5 and Debian are submenus. The last entry is just for booting for the local disk instead of via the network. Another point worth mentioning is the last entry in the bt5 submenu (not shown), it points back to the main menu (see the file below for details). Most entries are also using NFS for mounting the root file system (the nfsroot keyword) – it uses IP addresses, not the server host name…

Resulting config

Final pxelinux.cfg/default.

DEFAULT menu.c32

LABEL futsi
 MENU futsi
 KERNEL futsi/boot/vmlinuz-2.6.32-futsinfs
 APPEND root=/dev/nfs initrd=futsi/boot/initrd.img-2.6.32-futsinfs nfsroot= ip=dhcp rw

# include bt5 menu
 MENU LABEL BT5 submenu
 KERNEL menu.c32
 APPEND pxelinux.cfg/bt5.menu

# include debian squeeze menu
 MENU LABEL Debian squeeze submenu
 KERNEL menu.c32
 APPEND pxelinux.cfg/debian_squeeze.menu

# weel, booting from hdd might be smart also 🙂
label hd
 menu label Hard Drive Boot - boot the first hard disk
 localboot 0x80
 append -

An example of a submenu (pxelinux.cfg/bt5.menu)

menu title BT5r1 KDE

 menu label BackTrack Memtest - Run memtest
 kernel bt5/isolinux/memtest
 append -

 menu label Default Backtrack boot
 kernel bt5/casper/vmlinuz
 append nfsroot= netboot=nfs ro file=/cdrom/preseed/custom.seed boot=casper initrd=bt5/casper/initrd.gz

 menu label BackTrack Forensics - No Drive or Swap Mount
 kernel bt5/casper/vmlinuz
 append nfsroot= netboot=nfs ro file=/cdrom/preseed/custom.seed boot=casper initrd=bt5/casper/initrd.gz

LABEL back
 KERNEL menu.c32


Written by moozing

June 12, 2012 at 09:00

Posted in Tech

Tagged with , ,

2 Responses

Subscribe to comments with RSS.

  1. Wonderful submit, very informative. I wonder why the other experts of this sector don’t notice this. You must proceed your writing. I’m confident, you’ve a huge readers’ base already!|What’s Going down i am new to this, I stumbled upon this I’ve found It positively useful and it has aided me out loads. I hope to contribute & assist other customers like its aided me. Great job.

    diskless caffe

    July 25, 2012 at 13:42

    • Calling my readers’ base “huge” is overly optimistic, but I like that people benefit from my writings, so thanks for the nice comment.


      July 25, 2012 at 20:35

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: