Fun with FreeBSD Serial Consoles

Like most whom are geeky enough to run a home server, I run my server headless (no keyboard or display attached). This is convenient 99% of the time (namely for everything excluding operating system upgrades or occasions where you firewall yourself out of your own machine while tweaking IPFW rules)…

Traditionally I avoided this problem via a PS/2 KVM switch between my server and desktop PC. That solution met it’s end when I ousted my last desktop PC. In order to continue with the KVM style setup I would need to find a KVM equipped with USB keyboard and mouse ports and both VGA and DVI display ports, which apparently is not easy to come by short of some very high end setups.

It seems more often then not, the old fashioned strategies yield the greatest success. I opted for a NULL Modem cable (1969 called, they want their RS-232 back) and a Keyspan USA-19HS USB to Serial adapter for the Mac Mini.

I specifically opted for the Keyspan product as it is one of the few USB serial adapters with adequate drivers. Every other generic USB serial adapter I’ve stumbled apon has defined adequate as “Windows only” where as the Keyspan has drivers for Windows, Macintosh and Linux.

Enabling serial console on FreeBSD

Like every other task involving Unix derivatives in general and FreeBSD in specific, the setup is dead simple if you know how to do it:

  1. Find the entry for ttyd0 in /etc/ttys and change it to approximate:

    ttyd0   "/usr/libexec/getty std.9600"   vt100   on secure
  2. Add console=”comconsole” to /boot/loader.conf:

    echo console=\"comconsole\" >> /boot/loader.conf
  3. Send init(8) the HUP signal for the changes to be applied:

    kill -HUP 1

Connecting from the Client Machine

Connecting to the FreeBSD server from my Mac Mini (lilpapa) is as simple as using GNU Screen from the Terminal application. In my case:

screen /dev/tty.KeySerial1

Testing my New Setup

Using this new setup I have successfully upgraded Inferno (this server) from FreeBSD 6.1 to FreeBSD 6.2-RELEASE-p5. What better way to test this setup then running make installworld in single user mode via the serial console?

Leave a Reply

Warning: Undefined variable $user_ID in /usr/local/www/wordpress/wp-content/themes/ on line 75