Table of Contents
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.
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
Run this command to configure a static address on the PC's Ethernet interface:
# ifconfig eth0 up 192.168.2.1 netmask 255.255.255.0
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
Replace /etc/dhcp3/dhcpd.conf
with the following:
authoritative; shared-network LOCAL-NET { option domain-name-servers 8.8.8.8; subnet 192.168.2.0 netmask 255.255.255.0 { option routers 192.168.2.1; filename "pxeboot"; range 192.168.2.100 192.168.2.200; default-lease-time 600; max-lease-time 7200; } }
Also, edit the file
/etc/default/dhcp3-server
so that its last line
reads:
INTERFACES="eth0"
Now you can start the DHCP server.
# /etc/init.d/dhcp3-server start
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
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
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.
Enter the desired hostname.
Configure IPv4 on the vr0 interface, but skip IPv6 configuration for now.
Choose and enter a root password.
Opt to start sshd(8) and ntpd(8) by default.
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.
Set the default console to com0.
Skip setting up a regular user account for now.
Enter your timezone.
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
Label | FS Type | Mount Point | Blocks | Bytes |
---|---|---|---|---|
wd0a | 4.2BSD | / | 1,048,576 | 512 MB |
wd0d | 4.2BSD | /tmp | 1,048,576 | 512 MB |
wd0e | 4.2BSD | /var | 6,291,456 | 3 GB |
wd0f | 4.2BSD | /usr | 20,971,520 | 10 GB |
wd0g | 4.2BSD | /home | 2,159,338 | 1.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.
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.