Economy Size Geek - Installation Toolkit
The DHCP server needs to offer up a PXE boot image for this to work. In my case, that meant I needed to update my DD-WRT configuration. I decided to change it first. I went to the Services tab on my router and added dhcp-boot=pxelinux.0,keg,192.168.210.254 to the box for Additional DNSMasq options. That is the PXE image, the name of my file server and my file server's IP. If you are running a DHCP server as well, you need to add something similar, depending on what DHCP software you are running.
Now the rest of the configuration happens on my file server. I installed a tftp server to serve up the PXE boot image:
sudo apt-get install tftpd-hpa
This creates a directory (/var/lib/tftpboot) and a config file (/etc/default/tftpd-hpa). Edit the config file by changing RUN_DAEMON="no" to RUN_DAEMON="yes". Then:
sudo /etc/init.d/tftpd-hpa restart
The next step is to get an installer:
sudo cd /var/lib/tftpboot sudo wget -r -nH --cut-dirs=8 -np ftp://archive.ubuntu.com/ ↪ubuntu/dists/karmic/main/installer-i386/current/images/netboot/
Now you can boot up your machine and have it load the standard Karmic installer. Part of the fun and flexibility of having a PXE server is that you can choose what to install on the fly. I'm going to start with adding on the x64 installer for Karmic. First, I needed to clean up the directory structure a bit. I removed everything (except the pxelinux.0 and pxelinux.cfg, which both turned out to be symlinks to files I deleted):
sudo mkdir -p ubuntu/karmic/i386 sudo mkdir ubuntu/karmic/amd64 sudo wget -r -nH --cut-dirs=8 -np ftp://archive.ubuntu.com/ ↪ubuntu/dists/karmic/main/installer-i386/current/images/netboot ↪-P /var/lib/tftpboot/ubuntu/karmic/i386 sudo wget -r -nH --cut-dirs=8 -np ftp://archive.ubuntu.com/ ↪ubuntu/dists/karmic/main/installer-amd64/current/images/netboot ↪-P /var/lib/tftpboot/ubuntu/karmic/amd64 sudo cp ubuntu/karmic/i386/ubuntu-installer/i386/pxelinux.0 ↪/var/lib/tftpboot/ sudo mkdir /var/lib/tftpboot/pxelinux.cfg
Now, set up a menu to choose between the two installers. Create a /var/lib/tftpboot/boot.txt file with:
- Install Options - karmic_i386_install karmic_i386_expert karmic_amd64_install karmic_amd64_expert
Create a /var/lib/tftpboot/pxelinux.cfg/default file with:
DISPLAY boot.txt LABEL karmic_i386_install kernel ubuntu/karmic/i386/ubuntu-installer/i386/linux append vga=normal initrd=ubuntu/karmic/i386/ ↪ubuntu-installer/i386/initrd.gz -- LABEL karmic_i386_expert kernel ubuntu/karmic/i386/ubuntu-installer/i386/linux append priority=low vga=normal initrd=ubuntu/karmic/ ↪i386/ubuntu-installer/i386/initrd.gz -- LABEL karmic_amd64_install kernel ubuntu/karmic/amd64/ubuntu-installer/amd64/linux append vga=normal initrd=ubuntu/karmic/amd64/ ↪ubuntu-installer/amd64/initrd.gz -- LABEL karmic_amd64_expert kernel ubuntu/karmic/amd64/ubuntu-installer/amd64/linux append priority=low vga=normal initrd=ubuntu/karmic/ ↪amd64/ubuntu-installer/amd64/initrd.gz --
From here on, you just need to download a distribution you want to support and add it to the menu. If you are the graphical type, you even can modify the system to allow menus and pretty icons.
PXE is great, because it allows you to boot up and choose the installer you need. The problem is that it assumes you are on the physical network. In the case of my wireless computers (Netbooks, laptops and that one computer that sits out in my brew house), I couldn't use PXE. The main workaround is to get a wireless bridge so the device can boot over a physical port on the bridge, and let the bridge worry about the Wi-Fi. The question of how to do that has floated around so long, I am not holding out hope a solution will show up any time soon.
Let's say you want some of the features of PXE, but you don't want to bother installing a server. It turns out you have two different options for doing pretty much the same thing over the Internet. You can use boot.kernel.org or www.netboot.me. Both are using gPXE, which allows you to do the same things I did, but you don't need to have any infrastructure (although you may want to have a lot of bandwidth, depending on how much installing you do).
- Is the Private Cloud a Real Cloud?
- Open Axiom
- Give new life to old phones and tablets with these tips!
- Readers' Choice Awards 2014 Poll
- Tech Tip: Really Simple HTTP Server with Python
- Memory Ordering in Modern Microprocessors, Part I
- Linux Systems Administrator
- Senior Perl Developer
- Technical Support Rep
Free DevOps eBooks, Videos, and more!
Regardless of where you are in your DevOps process, Linux Journal can help!
We offer here the DEFINITIVE DevOps for Dummies, a mobile Application Development Primer, and advice & help from the expert sources like:
- Linux Journal