I'd like be able to establish a connection to a headless Ubuntu 18.04 server from a Ubuntu 18.04 laptop via serial console in order to avoid having a graphic card consuming energy in the server.
The motherboard is an ASRock X99 Extreme3. Its UEFI has an option to enable/disable the serial port which I set to enable - smart as I am - and to select 3F8h/IRQ4
or 3E8h/IRQ4
for the "Serial Port Address" where I left the initially selected 3F8h/IRQ4
without knowing what the values stand for.
On the server, I connected a RS232 to D-Sub connector (DB9) to the serial port of the motherboard and plugged in a gender changer. It translates
------------- -----------
\ 5 4 3 2 1 / to / 5 4 3 2 1 \
\ 9 8 7 6 / / 9 8 7 6 \
--------- ---------------
The laptop doesn't have a serial port, so I use a Serial-USB adapter which causes
[ 4303.030466] pl2303 3-1.1:1.0: pl2303 converter detected
[ 4303.031471] usb 3-1.1: pl2303 converter now attached to ttyUSB0
to be printed in dmesg
after it's plugged-in.
On the server side the output of dmesg | grep tty
is
[ 0.218803] printk: console [tty0] enabled
[ 2.079815] 00:03: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
I read about the possibility to specify a serial console to GRUB and related kernel parameters, however I don't find any clear statement whether that's necessary or not to be able to connect after the system booted (I don't need to be able to connect to GRUB's console for now).
When I try to connect to the server using
sudo minicom -D /dev/ttyUSB0
or putty
, I see
CTRL-A Z for help | 115200 8N1 | NOR | Minicom 2.7.1 | VT102 | Offline | ttyUSB0
in the footer for the former and both terminals don't take any input. I payed attention to match the device file to connect to with the one printed in dmesg
.
I'm suspicious that I don't have to install or configure anything on the server side except turning on the serial port in the UEFI. Can that be correct?
Maybe the BAUD rate isn't negotiated automatically and needs to be configured, but I have no idea how to figure out the correct value. I ran the configuration for minicom
, but could only select default values because I don't find a good explanations - in all tutorials the connection just magically works after minicom -s
apparently. Maybe the connection works and I'm missing the final step to connect.
I added the desktop user account and root to the groups dialout
and uucp
.
I can provide all necessary information for both server and laptop.
Some good reading is available from Official Ubuntu Documentation:
Alternative serial client: screen
GNU screen actually is a very capable serial terminal.
To install:
To start:
Some additional tips:
1. adjust the
n
to what you need:sudo
for this or need to hand this out to users not having access tosudo
, add them to thedialout
group.To end the session, use Ctrl-A or Shift-K.
The link above that the kernel detected in 16550 UART which provides a ttyS0 port and some resources allocated to it ( 0x3f8 IO address and IRQ 4 ).
On the server side, Make sure
Next Step, Setting up the Minicom should be like :
Choose "Serial port Setup" menu and Then do the configuration as needed and save setup as dfl. Finally restart your Minicom.
On the Laptop side, open Serial client like
screen
orputty
:Use
screen
serial :$screen /dev/ttyUSB0 115200, cs8, -parenb, -cstopb
Or
Use
putty
serial :$sudo putty /dev/ttyUSB0 -serial -sercfg 115200,8,n,1,N
Hope this helps.