The Pragmatic Addict

Raspberry Pi as a serial console server

This is a very brief overview on how to configure a Raspberry Pi as a serial console server using conman and a USB to serial port adapter.

Serial Console Server

KVM era

In the early days of Linux, the kernel would crash or a configuration error would occur taking the server off the network. I’d have to go down to the home “server room” fire up the KVM and try and figure out what went wrong with one of the PCs. This is not without cost or limitations:

Graphics interface vs text interface

My middle school teacher (when typewriters were still heavily used) gave me sage advice:

Learn to type and you will have a valuable skill to use for the rest of your life.

My corollary is this:

Learn to operate a Linux machine through a text terminal and you will be more productive than most admins in the field.

Serial Console

My console management changed rather suddenly when I acquired a bunch of Sun SPARC servers. They didn’t have standard VGA, keyboard or mouse connectors, breaking my beloved KVM solution. I had to resort to using a null modem cable and Minicom. This limited me to a text based console. Fortunately for me, Linux was designed for complete administration over text. This led to a revelation:

You might be asking, so who cares about a serial console? This is only limiting your options. Not so!

Enter conman

Minicom and other terminal programs proved to be to laborious to manage multiple serial ports, trying to decide which computer was hooked up to ttyS0, ttyS1 etc. Enter a wonderful solution called conman:

Equipment used

Overview/Lessons Learned

Raspberry Pi configuration

console name="larry" dev="/dev/serial/by-id/usb-FTDI_USB__-__Serial_Cable_FT3Q2OW0-if00-port0" seropts="115200"
console name="moe" dev="/dev/serial/by-id/usb-FTDI_USB__-__Serial_Cable_FT3Q2OW0-if01-port0" seropts="115200"
console name="curly" dev="/dev/serial/by-id/usb-FTDI_USB__-__Serial_Cable_FT3Q2OW0-if02-port0" seropts="115200"
console name="shemp" dev="/dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0" seropts="115200"
systemctl enable conman.service
systemctl start conman.service
conman larry

Wrap up

I’ve been running this configuration for about 3-4 years now and it’s been rock solid as far as uptime as well as connectivity. To it’s credit conman can do far more than what small piece of functionality I’ve shown. If you’ve got something you’d like to add to help my bit of documentation, feel free and contact me!


Created: 2021-10-24 Modified: 2024-04-11