Simple Ubuntu PXE Menu
If this is your first time configuring a PXE server, for the first step, I recommend following my steps in the "PXE Magic" article to install and configure DHCP and TFTP. Otherwise, if you have existing servers in place, just make sure that DHCP is configured to point to your TFTP server (if it's on the same machine, that's fine). And, if you already have any sort of pxelinux configuration in your tftpboot directory, I recommend that you back it up and move it out of the way—I'm going to assume that your entire /var/lib/tftpboot (or /tftpboot on some systems) directory is empty to start with. For the rest of this article, I reference /var/lib/tftpboot as the location to store your PXE configuration files, so if you use /tftpboot, adjust the commands accordingly.Both Debian and Ubuntu provide a nice all-in-one netboot configuration for each of their releases that makes it simple to PXE boot a particular release yourself. The file is called netboot.tar.gz and is located in a netboot directory along with the rest of the different install images. For instance, the netboot.tar.gz for the i386 Ubuntu 12.04 release (named Precise) can be found at http://us.archive.ubuntu.com/ubuntu/dists/precise/main/installer-i386/current/images/netboot/netboot.tar.gz.
To get started,
cd
to your tftpboot directory, and
then use wget
to pull
down the netboot.tar.gz file (I'm assuming you'll need root permissions
for all of these steps, so I'm putting sudo
in front
of all of my commands),
and then extract the tarball:
$ cd /var/lib/tftpboot
$ sudo wget http://us.archive.ubuntu.com/ubuntu/dists/precise/
↪main/installer-i386/current/images/netboot/netboot.tar.gz
$ sudo tar xzf netboot.tar.gz
$ ls
netboot.tar.gz pxelinux.0 pxelinux.cfg
↪ubuntu-installer version.info
As the ls
command shows, an ubuntu-installer directory was created
along with pxelinux.0 and pxelinux.cfg symlinks that point inside
that ubuntu-installer directory to the real files. Without performing
any additional configuration, provided your DHCP and TFTP servers were
functioning, you could PXE boot a server with this configuration and get
a boot menu like the one shown in Figure 1.source linuxjournal
No comments