FreeBSD Handbook
Prev | Chapter 2 Installing FreeBSD | Next

# 2.12 Advanced Installation Guide

Contributed by Valentino Vaschetto. Updated by Marc Fonvieille.

This section describes how to install FreeBSD in exceptional cases.

## 2.12.1 Installing FreeBSD on a System without a Monitor or Keyboard

This type of installation is called a “headless install”, because the machine that you are trying to install FreeBSD on either does not have a monitor attached to it, or does not even have a VGA output. How is this possible you ask? Using a serial console. A serial console is basically using another machine to act as the main display and keyboard for a system. To do this, just follow the steps to create an installation USB memstick, explained in Section 2.3.7 or download the correct installation ISO image see Section 2.13.1.

To modify these media to boot into a serial console, follow these steps (If you want to use a CDROM you can skip the first step):

1. Enabling the Installation USB Stick to Boot into a Serial Console

   If you were to boot into the USB stick that you just made, FreeBSD would boot into its normal install mode. We want FreeBSD to boot into a serial console for our install. To do this, you have to mount the USB disk onto your FreeBSD system using the mount(8) command.

       # mount /dev/da0a /mnt

   > Note: Adapt the device node and the mount point to your situation.

   Now that you have the stick mounted, you must set the USB stick to boot into a serial console. You have to add to the `loader.conf` file of the USB stick file system a line setting the serial console as the system console:

       # echo 'console="comconsole"' >> /mnt/boot/loader.conf

   Now that you have your USB stick configured correctly, you must unmount the disk using the umount(8) command:

       # umount /mnt

   Now you can unplug the USB stick and jump directly to the third step of this procedure.

2. Enabling the Installation CD to Boot into a Serial Console

   If you were to boot into the CD that you just made from the installation ISO image (see Section 2.13.1), FreeBSD would boot into its normal install mode. We want FreeBSD to boot into a serial console for our install. To do this, you have to extract, modify and regenerate the ISO image before burning it on a CD-R media.

   From the FreeBSD system where is saved the installation ISO image, for example `FreeBSD-`8.1`-RELEASE-`i386`-disc1.iso`, use the tar(1) utility to extract all the files:

       # mkdir /path/to/headless-iso
       # tar -C /path/to/headless-iso -pxvf FreeBSD-8.1-RELEASE-i386-disc1.iso

   Now you must set the installation media to boot into a serial console. You have to add to the `loader.conf` file from the extracted ISO image a line setting the serial console as the system console:

       # echo 'console="comconsole"' >> /path/to/headless-iso/boot/loader.conf

   Then we can create a new ISO image from the modified tree. The mkisofs(8) tool from the `sysutils/cdrtools` port is used:

       # mkisofs -v -b boot/cdboot -no-emul-boot -r -J -V "Headless_install" \
               -o Headless-FreeBSD-8.1-RELEASE-i386-disc1.iso /path/to/headless-iso

   Now that you have your ISO image configured correctly, you can burn it on a CD-R with your favorite burning application.

3. Connecting Your Null-modem Cable

   You now need to connect a null-modem cable between the two machines. Just connect the cable to the serial ports of the 2 machines. A normal serial cable will not work here, you need a null-modem cable because it has some of the wires inside crossed over.

4. Booting Up for the Install

   It is now time to go ahead and start the install. Plug in the USB memstick on the machine you are doing the headless install on, and power on the machine. If you are using a prepared CDROM, power on the machine and insert the disk to boot on.

5. Connecting to Your Headless Machine

   Now you have to connect to that machine with cu(1):

       # cu -l /dev/cuau0

   On FreeBSD 7.X use the following command instead:

       # cu -l /dev/cuad0

That's it! You should now be able to control the headless machine through your `cu` session. It will load the kernel and then it will come up with a selection of what kind of terminal to use. Select the FreeBSD color console and proceed with your install!

Prev | Home | Next
Troubleshooting | Up | Preparing Your Own Installation Media