I’m setting up a new home server. I’m replacing my old PIII-500MHz server with a new P4-2.5GHz server. This means installing a new copy of FreeBSD. Usually when I’m installing a free operating system, I follow a procedure something like this:
- Find ISO images
- Download ISO images (come back the next day)
- Burn CDs (not DVDs — DVD-R’s are in short supply around here)
- Load CD1 into computer, boot from it and start the installation
- Realize that I didn’t need CD3 because the packages I need are all on CD1 and 2.
- File CDs on shelf, in a spare spindle, or on my desk.
- Find CDs 2 years later, realize that they’re useless because Random-Free-OS 2011 is sooo much better than the 2009 version.
- Throw old CDs away, or optionally, refile them into a different spindle.
I don’t want to burn a bunch of CDs for a single use. It’s a waste of blank CD-Rs (I bought 50 of them in 2004, and I’ve only got a few left).
This time I went for a different tactic: a net installation of FreeBSD using another computer as the remote host. This makes the whole process of installation go like this:
1) Download ISO images
2) Put ISO images on an FTP server
3) Boot target machine with a minimal install and point at the FTP server
4) Delete ISO images
These instructions should work (with small modifications) for any reasonable free operating system, since all that I’m aware of have options for network installs.
What I have (you will need something similar):
- P4-2.5GHz computer with no OS.
- A home broadband router serving up DHCP (Linksys WRT running Tomato, but any broadband cable or DSL router will work).
- A Windows XP computer with enough disk space for the twice the size of the ISO images
What to do:
1. On the Windows XP computer, download your ISO images.
2. Burn the 7.2-RELEASE-i386-bootonly.iso image. If these instructions were really cool, there would be steps to make a bootable USB flash drive here. I tried, but wasn’t able to make it work 😦
3. Mount your ISO images. I use the Microsoft Virtual CD control panel, since it’s free and works very well. It doesn’t have a million features like some of the other tools do. To make it work, unzip it, click the Install Driver button, Add a drive, then click Mount and pick your ISO image. It’s as close to
mount -o loop image.iso /mnt/point as you can get on Windows.
Create a folder for your FTP root, say C:\FTP
4. Now open your newly-mounted CD-ROM (which shows up as an icon in My Computer), and copy everything to C:\FTP.
5. Mount the next CD-ROM in the distribution and copy everything to C:\FTP. You should end up with something like this:
C:\FTP\README.TXT & some other files
6. FreeBSD’s installer expects the packages directory to be under 7.2-RELEASE, so move it there. Now you should have a C:\FTP\7.2-RELEASE\packages folder.
7. Copy the next two CDs into C:\FTP. The next two CDs only contain a packages folder. You can make use of a little-known Windows Explorer trick to get the right files in there.
Open C:\FTP\7.2-RELEASE in one window, open X:\ (the drive for your mounted ISO image) in another window. Drag X:\packages into the C:\FTP\7.2-RELEASE window. Explorer will say “there’s already a packages folder here, replace it?” Click Yes to All. Rather than deleting X:\FTP\7.2-RELEASE\packages and replacing it with a new copy, windows is actually merging the two directories. After it’s finished copying, C:\FTP\7.2-RELEASE\packages will contain everything from CD1 and everything from CD2.
Repeat with CD3.
7a. Or, just download the DVD image, which I expect already has everything in the packages folder.
Prepare to FTP
Download a copy of FileZilla FTP Server, and install it. Since you probably don’t want an FTP server running silently on your machine, choose the “Install as a Service and Start manually” option. After installation, if Windows Firewall asks, unblock FileZilla.
Open the FileZilla Server Interface (Start -> Programs -> FileZilla -> FileZilla Server Interface)
Now, create an anonymus ftp user:
From the Edit menu, choose Users.
Click the Add button on the right side, and create a new user named ftp.
Leave “Enabled account” checked, and “Password” unchecked.
Click on “Shared Folders” on the right, then Add a new folder. Select C:\FTP & click OK.
Now test it – open a web browser and punch in ftp://your-ip-address. You should see what’s in your FTP folder. (If you don’t know how to find your Windows machine’s IP, go to Start -> Command Prompt and type “ipconfig”. There will be a bunch of info and something like:
IP Address . . . . 192.168.0.3).
Boot your target machine from the bootonly image that you burned earlier. When you get to the Installation Media section, choose FTP, then instead of picking mirror xyz, pick URL.
In the URL, punch in ftp://your-windows-xp-ip/. (something like ftp://192.168.0.3/).
I was also asked if I wanted IPv6 (say no) and DHCP (say yes, enter localhost for your hostname if you don’t have any better ideas).
Then commit to the installation. If everything is good, when you look at your FileZilla server console, you’ll see each file being transferred. If you get a message on the FreeBSD system about “Can’t find packages”, make sure you moved the packages folder into the right place. HINT: The FileZilla server log will tell you what the right place is! Look for an attempt to RETR packages/INDEX.
Done! You now have a mostly CD-free local install of FreeBSD.
As a bonus, if you want to install some packages later, you can always turn FileZilla server back on.