My reward: a fully operational
I have been tasked with helping my son's school make use of a server someone donated. It has a copy of Windows Server 2008, but nobody knew the password.
Nobody was really married to the idea of a windows server, so after failing to guess the password 3 or 4 times (my son's suggestion: "fluffy pink unicorns"), I decided to just install a new base OS.
The problem here: this particular HP server has no CD ROM drive. No problem: I'll just grab a USB key and install from USB. Unfortunately, my USB key must have had some bad sectors, because I couldn't get the installer to load without a corrupted file or two.
Plan B: TFTP / PXE Boot from Network
Back in the 90s, I used to help at a company that used network installation to image machines using Norton Ghost. From this experience, I knew I could run a network install. But, could I do it using my Windows laptop serving from a WiFi network? I wasn't sure.
It turns out that it is, but it ain't easy. Here are the steps:
Step 1: Check your network settingsYou'll want to check your local DHCP settings to make sure there is an open range of about 3-5 addresses. The TFTP server sends its boot configuration information out via DHCP, so you'll need to run a DHCP service as well. Fortunately, the TFTP server I found has that built in, and it does not seem to cause too many problems to have the DHCP on the router running at the same time as the DHCP in the TFTP service.
Step 2: Download the TFTP server and netboot files
Netboot files for Ubuntu Server 12.04 LTS (named netboot.tar.gz)
Unzip the TFTP server anywhere (I chose
.../Desktop/netboot). Create a directory under netboot called root. This will be where your PXE boot files go. Unzip the files from the netboot tarball into the root directory. Your root directory should look like this:
ubuntu-installerdirectory to locate the "real files" and copy them into the
rootfolder. At the same time, you'll need to copy in the linux loader and root images,
ubuntu-installer/amd64/initrd.gz ubuntu-installer/amd64/linux ubuntu-installer/amd64/pxelinux.0
Once you've copied these files directly to the root, your directory will look like this:
These file sizes are much more believable!
Step 3: Configure the TFTP serverNow, run the TFTP server and there's some configuration to be done.
The first thing to do is to set the root directory to the directory you just prepared. That's done in the initial screen:
Next, press the "Settings" button, and get set on the TFTP tab. I believe the most important part is the "PXE" compatibility checkbox, but I also changed the "Base Directory" to match the root we prepared.
Finally, the DHCP tab must be set. The software will complain if you leave without setting this up completely. The hardest part is to get the network configurations to match your home network. The IP pool start address must exist on your local network, and should not be allocated by your local router. The boot file is the
pxelinux.0file we found earlier.
Saving this, the software will want you to restart the TFTP server. Do so.
Step 4: Do a PXE boot on your target machineFinally, we're ready for action. Using the bios boot configuration, do a PXE boot. In time, the target machine will locate the DHCP server you just configured, and attempt to use TFTP to load the
If you are unlucky, your PXE boot firmware might get confused by two DHCP servers. If that happens, just disable the one on your local router for now.
After the boot loader is downloaded and installed, you might notice there's an error that says something like
unable to load pxelinux.cfg/default. Ignore this. Normally this would give you a pretty little GUI. Unfortunately, the TFTP server doesn't seem to like relative paths (no starting '/' here), so tried as I might I couldn't get the menu system to load. No fear -- we're doing network boot, and we're not afraid of the command line.
Fortunately, there's a little command line right below the error message
Step 5: Run the installerThis might look familiar to some folks who have been around linux a long time. It has been so long for me that it took a couple of hours research to discover the correct parameters to launch both the bootstrapper and the kernel. The benefit of my research follows:
boot: /linux kernel=/initrd.gz
That's it. After hitting enter, the loader downloads from the TFTP server, the installer starts up, and all the packages are downloaded off the main mirror sites. What you're left with is a perfectly healthy Ubuntu system to enjoy.
Any tweaks? Let me know!