OpenBSD: Setup a Serial Console

How do I enable console redirection under OpenBSD so that I can see my remote server boot information and any diagnostic information that is normally printed to the screen? I’ve already enabled serial ports in my server BIOS and wired them up. How do I configure and access OpenBSD UNIX x86/amd64 server over serial console?

Tutorial details
Difficulty Intermediate (rss)
Root privileges Yes
Requirements OpenBSD
Serial port
Time N/A
OpenBSD operating system supports serial console. You can use the serial console for the following purpose:

  1. Remote server management.
  2. See console output.
  3. Debugging the server problem.
  4. Headless OpenBSD installation via network/PXE boot.

Configuration: Setup a serial console

To direct the boot process to use the serial port as a console, edit /etc/boot.conf, enter:
# vi /etc/boot.conf
Edit / append as follows:

set tty com0

The above will use first serial port as your console. You can also define baud rate (default baud rate is set to 9600bps). Append the following line to /etc/boot.conf (set baud rate to 115200):

stty com0 115200

Save and close the file. Reboot the server to test your configuration.

How do I connect to a serial console under Unix/OpenBSD/Linux?

You can also use client tool such as cu, scree, putty (Windows based), and putty for management purpose:
screen /dev/serialdevice 19200,cs8
cu -l /dev/serialdevice -s baud-rate-speed

You can also use minicom, ipmi or KVM over IP clients:
Sample session:

Fig.01: Connected To OpenBSD using KVM serial console

See also
🐧 If you liked this page, please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
1 comment… add one
  • Barry Aug 23, 2012 @ 19:17

    This was second hit on my google search, so I thought I’d add a comment that might help someone else:

    When connecting from an OpenBSD computer, the cu(1) command is available. It has always been part of the OpenBSD base install, and is often overlooked. A simple “cu -l /dev/cua00 -s 115200” will allow you to connect to the serial console. No need to add packages. Note: To leave cu you need to type “~.”, neither Esc nor Ctrl-C will work.

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.