Chapter 3. OpenBSD Installation

Table of Contents

3.1. PXE server setup
3.1.1. Ubuntu packages
3.1.2. Network configuration & NAT
3.1.3. DHCP server
3.1.4. TFTP server
3.1.5. Serial console
3.2. PXE booting
3.3. The OpenBSD installer
3.3.1. Basic setup
3.3.2. Partitioning
3.3.3. Installation sets

3.1. PXE server setup

Installing OpenBSD on the ALIX.2D3 is a little more involved than installing on standard PC hardware, due to the lack of a video card or the ability to boot from CD-ROM (even from USB CD-ROM devices). Instead we will have to use the ALIX board's PXE boot capability to boot into the installer, by running a PXE boot server on the PC mentioned in Section 1.4, “Prerequisites”.

Thankfully, the Ubuntu desktop live CD is flexible enough to serve as a platform for the temporary boot server, without requiring any permanent changes to your PC.

3.1.1. Ubuntu packages

Boot the Ubuntu live CD and quit the installer. Ensure that Ubuntu has a working Internet connection, then enable the "universe" package repository by uncommenting the corresponding lines in /etc/apt/sources.list. Now open a terminal and run the following commands to install prerequisite packages:

$ sudo -s
# apt-get update
# apt-get install dhcp3-server tftpd xinetd cu

3.1.2. Network configuration & NAT

Run this command to configure a static address on the PC's Ethernet interface:

# ifconfig eth0 up netmask

I've found you may also need to configure the static address on your Ethernet adapter in the "Network Connections" dialog (under Preferences in the System menu) to prevent Network Manager from getting in the way. Yes, this is a little hackish, but we only need it to work for the duration of the install...

Now enable routing and configure a simple NAT using iptables so that the ALIX board can access the Internet through your PC's wireless connection:

# echo 1 > /proc/sys/net/ipv4/ip_forward
# iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
# iptables -A FORWARD -i eth0 -j ACCEPT
# iptables -A FORWARD -i wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT

3.1.3. DHCP server

Replace /etc/dhcp3/dhcpd.conf with the following:


shared-network LOCAL-NET {
  option domain-name-servers;

  subnet netmask {
    option routers;
    filename "pxeboot";
    default-lease-time 600;
    max-lease-time 7200;

Also, edit the file /etc/default/dhcp3-server so that its last line reads:


Now you can start the DHCP server.

# /etc/init.d/dhcp3-server start

3.1.4. TFTP server

Create an xinetd file at /etc/xinetd.d/tftp with:

service tftp
  socket_type = dgram
  protocol = udp
  wait = yes
  user = root
  server = /usr/sbin/in.tftpd
  server_args = -s /tftpboot

Next create the aforementioned directory /tftpboot. Download the files bsd.rd and pxeboot from the /4.8/i386/ directory on your favorite OpenBSD mirror and copy them here. Then, restart xinetd to load the new configuration:

# /etc/init.d/xinetd restart

3.1.5. Serial console

Connect your laptop's serial port (or plugged-in USB-serial adapter) to the ALIX board's serial port with your null modem cable, then use the cu command to open the serial console. For example, if you're using a USB adapter:

# cu -e -o -s 115200 -l /dev/ttyUSB0

3.2. PXE booting

With your serial console ready, plug in the ALIX board's power adapter, and you should see the board begin to boot. Enter the following at the OpenBSD boot menu:

boot> stty com0 115200
boot> set tty com0
boot> bsd.rd

3.3. The OpenBSD installer

3.3.1. Basic setup

When the OpenBSD ramdisk boots, you will be prompted with the choices: (I)nstall, (U)pgrade, or (S)hell? – press the I key to begin the installer. Therein you will be asked a few preliminary questions.

  1. Enter the desired hostname.

  2. Configure IPv4 on the vr0 interface, but skip IPv6 configuration for now.

  3. Choose and enter a root password.

  4. Opt to start sshd(8) and ntpd(8) by default.

  5. Specify that you do not expect to run the X Window System. This will cause the machdep.allowaperature sysctl to be disabled, possibly improving your system's security.

  6. Set the default console to com0.

  7. Skip setting up a regular user account for now.

  8. Enter your timezone.

3.3.2. Partitioning

Next you will need to set up your disk partitions and slices. In fdisk(8), specify that you want to use the whole disk for OpenBSD. Then you will be brought to the BSD disk label editor.

Press P to view the disk's current BSD slices; you shouldn't see anything here except the "c" slice, which represents the entire disk. Use the A command to create the disk slice set shown in Table 3.1, “OpenBSD disk slices”.

Table 3.1. OpenBSD disk slices

LabelFS TypeMount PointBlocksBytes
wd0a4.2BSD/1,048,576512 MB
wd0d4.2BSD/tmp1,048,576512 MB
wd0e4.2BSD/var6,291,4563 GB
wd0f4.2BSD/usr20,971,52010 GB
wd0g4.2BSD/home2,159,3381.03 GB

When that is done, press Q to quit the label editor, then press Y to confirm that you wish to write the new disk label. Confirm your way past any relevant warning messages, and the CF card will be partitioned and formatted for OpenBSD's installation.

3.3.3. Installation sets

Next you will be asked where to find the OpenBSD installation sets: choose the default mechanism, http, and use the default OpenBSD mirror (or any other mirror of your choice). Make any desired changes to the default set selection and then proceed to the next stage of the installer.[4]

Once the sets have been installed, you can shut down your Ubuntu PXE boot server and reboot the ALIX board into its new OpenBSD installation. You may also wish to disable PXE booting in the ALIX's BIOS while you are not using it.

[4] I have heard it said that it is a good idea to install all of the OpenBSD sets if one wants to build packages from the ports tree, even if one does not intend to run X11. However, I have not found this to be necessary in my own experience.