Serial over LAN

Last change on 2021-04-16 • Created on 2020-03-20 • ID: RO-229BB

Introduction

Serial Over LAN (SOL) is a mechanism that enables the input and output of the serial port of a managed system to be redirected over IP. This is done through IPMI.

Activating serial over LAN

In order to activate SOL (serial over LAN), enter the following command:

ipmitool -C 3 -I lanplus -H <ipaddr> -U <user> -P <pass> sol activate

Using cipher suite 3 is essential (if that is not the default) because communication via LANplus is not possible otherwise.

If the following error message appears, you need to activate SOL for the user:

$ ipmitool -C 3 -I lanplus -H <ipaddr> -U <user> -P <pass> sol activate
Info: SOL payload disabled
$ ipmitool -C 3 -I lanplus -H <ipaddr> -U <user> -P <pass> sol payload enable <channel> <user-id>

After that, you can see the BIOS output. Accessing the boot loader and/or the booted system requires additional settings.

GRUB2

For GRUB2, simply change some lines to match the following in /etc/default/grub and re-generate the settings.

With the PX90/120 (Supermicro X9SRi-F), the serial console is on ttyS2/unit=2. With the PX91/121 (Asus Z10PA-U8), it is on ttyS1/unit=1. And with the PX60/70 (Intel S1200V3RPL), it is on ttyS0/unit=0. It should also be noted that the Baud rate needs to be set at 57600 with the PX91/121, and 115200 with all others.

PX60/70

GRUB_CMDLINE_LINUX_DEFAULT="nomodeset console=tty0 console=ttyS0,115200n8"
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"

PX90/120, SX131/291

GRUB_CMDLINE_LINUX_DEFAULT="nomodeset console=tty0 console=ttyS2,115200n8"
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=2 --word=8 --parity=no --stop=1"

PX91/121

GRUB_CMDLINE_LINUX_DEFAULT="nomodeset console=tty0 console=ttyS1,57600n8"
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --speed=57600 --unit=1 --word=8 --parity=no --stop=1"

GRUB (grub-legacy)

For GRUB1 (grub-legacy), add the following lines to /boot/grub/menu.lst or /boot/grub/grub.conf (CentOS):

PX60/70

serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
terminal --timeout=5 serial console

PX90/120, SX131/291

serial --unit=2 --speed=57600 --word=8 --parity=no --stop=1
terminal --timeout=5 serial console

PX91/121

serial --unit=1 --speed=115200 --word=8 --parity=no --stop=1
terminal --timeout=5 serial console

At the same time, you need to add the same serial port needs to the boot options of the kernel. That is ttyS0 with the PX60/70, ttyS1 with the PX91/121, and ttyS2 with the PX90/120.

console=tty0 console=ttyS0,115200n8

This tells the kernel to output information on the first serial port. Changing GRUB_TERMINAL to serial means any input/output is redirected to the serial port. A local screen will not display a boot menu anymore, and thus, it is no longer possible selecting a boot entry via KVM Console or KVM. After a reboot, the output will be sent in parallel to both the local screen and the serial port.

After that, you need to set up a terminal for the serial port in your system. Debian 7.x (wheezy) / Debian 8 with Sys-V Init

You need to add the following line to /etc/inittab. Here again, use ttyS0 and 115200 Baud with the PX60/70, ttyS2 and 115200 Baud with the PX90/120, and ttyS1 and 57600 Baud with the PX91/121:

T0:2345:respawn:/sbin/getty -L ttyS0 115200 vt100

After that, you can activate the terminal by entering init q.

Ubuntu (up until 14.10 with Upstart)

Create the file /etc/init/ttyS0.conf with the following content (or alternatively, ttyS2.conf with ttyS2 and 115200 Baud with the PX90/PX120 models, or ttyS1.conf with ttyS1 and 57600 Baud with the PX91/PX121 models):

# ttyS0 - getty
#
# This service maintains a getty on ttyS0 from the point the system is
# started until it is shut down again.

start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]

respawn
exec /sbin/getty -L ttyS0 115200 vt100

After that, you can activate the terminal by entering start ttyS0.

CentOS

In CentOS 6.x, the configuration is similar to Ubuntu. However, /etc/init/serial.conf automatically starts a getty on the serial port, which adds the port /etc/securetty. So you just need to configure the serial console in grub.conf and attach the appropriate kernel option.

Debian 8 / OpenSuSE / Fedora

For Debian 8 (jessie), OpenSuSE and other distributions such as Fedora which use systemd and GRUB2, just change /etc/default/grub accordingly and renew the configuration using grub2-mkconfig. At the next boot, systemd will automatically start using the serial port of GRUB2.

Serial Console

Now, you will see a login quickly if you connect via ipmitool:

 $ ipmitool -C 3 -I lanplus -H <ipaddr> -U <user> -P <pass> sol activate
 [SOL Session operational.  Use ~? for help]

 Debian GNU/Linux 7 Debian-70-wheezy-64-minimal ttyS0

 Debian-70-wheezy-64-minimal login:
Table of Contents