First, determine what serial port you want to use. For IPMI Serial over Lan (SOL), it is whatever is designated in the firmware (BIOS or UEFI) as the console. For Xen, it is most like the first serial port (ttyu0, aka com1 for Windoze users). You will also need the port address to use (0x3F8 for the first port, 0x2F8 for second port, do a google search for the others).
The following documentation assumes we are installing for SOL on a bare metal machine, using the second serial port (ttyu1, address 0x2F8). If you are doing this for the first serial port, change those to ttyu0 and 0x3F8. It also assumes our serial speed is set to 57600, though modern hardware will want anything from 9600 to 115200; faster is better.
Find the line for ttyu1 and modify as follows. This sets the port to respond at 57600, using vt100 protocol and requiring a login.
ttyu1 "/usr/libexec/getty std.57600" vt100 onifconsole secure
This tells the kernel to send messages to the serial port and the internal console, and sets the speed to 57600
echo "-Dh -S57600" > /boot.config
Add/edit the following in /boot/loader.conf to set up console redirect when booting.
boot_multicons="YES" boot_serial="YES" console="comconsole,vidconsole" comconsole_port="0x2F8" hint.uart.0.flags="0x00" hint.uart.1.flags="0x10"
Hint: change hint.uart.0.flags=“0x00” to hint.uart.0.flags=“0x10” (and set 00 for uart 1) if using the first serial port.
Boot from multiple consoles (in our case, the serial and the video)
Guess what this one means
Boot from the serial port AND the video console
Sets up to use second serial port, at 0x2F8. use 0x3F8 for the first port, or whatever memory range you are using
Disable console on first serial port
Set second serial port (uart.1) as a potential serial console. 0x20 says “always use it as a serial console”
You can now reboot and view the output on your SOL connection. If you have issues, you can find them after rebooting with
dmesg | grep uart