FreeBSD remote install

Many computer systems around the world have been possessed by penguins; some have even been possessed by dead rats. In light of this, it is desireable to exorcize these evil spirits, and replace them with a nice, friendly daemon.

(More to the point, there are a number of dedicated server hosting companies which only offer Linux (or, in some cases, Linux and Windows); being able to remotely replace Linux with FreeBSD makes the (typically very low cost) offerings from these companies available to those who want to run FreeBSD.

I've put together some code for building a FreeBSD disk image which will boot into memory, configure the network, set a root password, and enable SSH. This can be used to "depenguinate" a Linux box, without requiring any access beyond a network connection.

The remainder of this page relates to the original (December 2003) version of my depenguinator. For a more recent version (which works with FreeBSD 7.0) see my blog post about my depenguinator version 2.0.


The code is available here with MD5 hash ccc4030dce62bf0509f2641e6f0c3570.

This code is beta-quality at best. Do not use this unless you know what you're doing.

Note: This code only supports i386 systems, and it requires quite a lot of RAM (512MB is enough; 256MB might be, but I'm not sure).

To remotely install FreeBSD:

  1. Download and untar the depenguination code.
  2. Download a FreeBSD ISO image. I haven't tested this with versions of FreeBSD prior to 5.2-BETA, and I know that it will not work with any 4.x releases.
  3. Look at initconf.conf.dist, and create initconf.conf.
  4. Run makeimage.sh
  5. Make sure that the first 40MB of space on your hard drive is not being actively used. If the first partition on your hard drive is being used for swap, run swapoff to disable it; otherwise, move your partitions around so that this is the case. Update: I have been told that, if you have partitions in the first 40MB which are mounted as ext2 (not ext3!) and you reboot -nf, then this might work. It didn't work for me.
  6. Use dd to write disk.img to the hard drive.
  7. Reboot.
  8. Log in via SSH with the root password you specified in initconf.conf.
  9. Slice and label your disks, install FreeBSD, et cetera. Since the system is now running out of an image stored entirely in memory, you can do anything you like to the disk (for example, install vinum, which you can't do via sysinstall), as long as you have a bootable filesystem in place before you next reboot.

This code uses makefs.

      This product includes software developed by Christos Zoulas.
      This product includes software developed by Manuel Bouyer.
      This product includes software developed by the University of
      California, Berkeley and its contributors.
      This product includes software developed by the NetBSD
      Foundation, Inc. and its contributors.
      This product includes software developed for the NetBSD Project by
      Wasabi Systems, Inc.