Ubuntu Linux Plug ‘N Play Zone Revisited 04/16/08

LaptopLast month we posted a great idea “Make Your Own Plug ‘N Play Zone Using Ubuntu Linux!“, discussing and introducing the concept of a “zone” where laptop (or other) users could plug their units into and have Linux automatically installed upon boot up.

…It’s a simple 3-step method. Users plug their laptop into one of the two ports and boot off the network. Go away, come back later and it’s all done…

Some readers have asked me about the actual “code” or parameters – this means the PXELinux Boot Loader – for the auto install feature that would be on the TFTP server. If you’re not familiar with the “Plug ‘N Play Zone”, please do read that earlier post first. 😉

One specific question asked:

This is a nice how to, but I’m a little confused on one point. It may have to do with me not actually doing the steps … but I have used netboot images before, both on Ubuntu and on Debian.

My problem is that the netboot images I’ve always used just launched an installer. I know you can kickstart autoinstall, but I don’t see that step here. Has netboot changed in the last year, or am I missing something?

The netboot.tar.gz file that you download, contains the PXELinux boot loader. In my case the boot loader points to this directory: ubuntu-installer/i386/ (because I’m using Ubuntu Linux). The tar contains the following:

ubuntu-installer (the directory with files in it).

When you look in the ‘ ubuntu-installer’ directory, you’ll see the i386 I mentioned above, as well a Linux kernel, initrd image (in the initrd.gz file). To clarify, the boot loader (netboot.tar.gz) gets placed on the TFPT server in /var/lib/tftpboot (and don’t forget to chown it, I forgot the first time and did have trouble because of it).

To automate the Plug ‘N Play Zone (so that you just need to set the BIOS to boot of PXE and walk away, you should add a configure a preseed file. Preseed is pretty much like Kickstart, where the file can contain the information you would normally be prompted (on screen) during an installation. Things like timezone, language, keyboard, package selection, repositories, etc. would be included in that file. We would call the file “preseed.cfg”. An example of a preseed file is pnpzone-generic.cfg. If any of you wonder why it’s referring to Debian in that sample preseed file, that’s because Ubuntu Linux is Debian based.

One nice feature is that you can locate the preseed file anywhere you want. For example, you can control your Linux Plug ‘N Play Zone, but allow authorized personnel to edit the preseed file to fit the needs of the batch of units receiving the Linux installation; then they simply ftp the revise file to the web server and it gets used. Easy customization! :)

Here’s the rub…

In order for the installation (PXELinux et al) to be able to get the preseed file (in my case plugnplayzone.int), we need to tell it where that file is; at which point it will download the file for use. Here’s how we do that:

(Using the command line), go back to /var/lib/tftpboot and look for ‘/pxelinux.cfg/default’ to edit it, something like this:

sudo nano /var/lib/tftpboot/pxelinux.cfg/default

Find this:

LABEL server
kernel ubuntu-installer/i386/linux
append base-installer/kernel/linux/extra-packages-2.6= tasks=standard pkgsel/language-pack-patterns= pkgsel/install-language-support=false vga=normal initrd=ubuntu-installer/i386/initrd.gz --

Change to this:

LABEL server
kernel ubuntu-installer/i386/linux
append locale=en_US console-setup/layoutcode=en_US netcfg/wireless_wep= netcfg/choose_interface=eth0 netcfg/get_hostname= url=http://plugnplayzone.int/preseed.cfg vga=normal initrd=ubuntu-installer/i386/initrd.gz --

In the above example, you can see I actually forced the US keyboard layout, etc. But you can leave all your preferences in the preseed or override them in the ‘default’ for pxelinux.cfg. Also, ‘plugnplayzone.int’ is just the domain created on a web server, yours will be different.

Hopefully this helps to further round-out the original post and gives some of the less experienced a little more insight.

Above all…
Have fun!

Do you love to share?

You can leave a response, or trackback from your own site.

No Responses to this article

Leave a Reply

close comment popup

Leave A Reply