Serial console in OpenBSD

To get serial console working on OpenBSD, we need two things.

  1. The kernel should be ‘attached’ to a serial port,
  2. A getty should be spawned, so we can login.

To get the first working, we add ‘set tty com0′ to /etc/boot.conf (create if it doesn’t exist). To get the second working, we need to have a ‘console’ line in /etc/ttys; /dev/cua00 or something won’t work, because the kernel is already using it. Summary: 

/etc/boot.conf:
set tty com0 
 
/etc/ttys: 
console "/usr/libexec/getty std.9600"   vt100   on  secure 

Remember to disable the getty if you don’t use the serial console anymore, or two gettys will try to read from the same console (switch to vc2 to log in).

Comments are closed.