Tuesday, January 24, 2017

Intel AMT Serial Over LAN

Quick post about what I needed to do to get Serial Over Lan (SOL) working on an HP z420 workstation. This machine has a Xeon processor. Sincce there's no integrated graphics, the KVM capaability of Intel vPro/AMT doesn't work. Modify /etc/default/grub and add the following two lines at the end fo the file.
GRUB_CMDLINE_LINUX="console=tty0 console=ttyS4,115200n8"
GRUB_SERIAL_COMMAND="serial --speed=115200 --port=0xe060 --word=8 --parity=no --stop=1"
Create the file /etc/systemd/system/serial-getty@ttyS4.service with the following contents.
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=Serial Getty on %I
Documentation=man:agetty(8) man:systemd-getty-generator(8)
Documentation=http://0pointer.de/blog/projects/serial-console.html
BindsTo=dev-%i.device
After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service
After=rc-local.service

# If additional gettys are spawned during boot then we should make
# sure that this is synchronized before getty.target, even though
# getty.target didn't actually pull it in.
Before=getty.target
IgnoreOnIsolate=yes

[Service]
ExecStart=-/sbin/agetty --keep-baud 115200 %I vt100-nav 
Type=idle
Restart=always
UtmpIdentifier=%I
TTYPath=/dev/%I
TTYReset=yes
TTYVHangup=yes
KillMode=process
IgnoreSIGPIPE=no
SendSIGHUP=yes

[Install]
WantedBy=getty.target
Enable the ttyS4 getty in systemctl with command below.
systemctl enable serial-getty@ttyS4.service
Reboot your machine. You should be able to use SOl via the following command. There will be a prompt for the AMT password. This was set in your BIOS.
amtterm host or ip address
Check the status of the getty
systemctl status serial-getty@ttyS4.service

4 comments:

Yann Le Mouel said...

Hello,

Thanks for your article, I'm in the same process to set up Serial Over Lan with AMT on Centos 7.
I can connect fine but stuck there:
amtterm: CONNECT -> INIT (redirection initialization)
amtterm: INIT -> AUTH (session authentication)
amtterm: AUTH -> INIT_SOL (serial-over-lan initialization)
amtterm: INIT_SOL -> RUN_SOL (serial-over-lan active)
serial-over-lan redirection ok
connected now, use ^] to escape

Do you have any ideas about the problem?

James Hubbard said...

Did you make sure to setup GRUB correctly? You should be able to see the boot screen if you did.

Yann Le Mouel said...

Yes as below:
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="console=tty1,console=ttyS1,115200n8"
GRUB_SERIAL_COMMAND="serial --speed=115200 --port=0x30e0 --word=8 --parity=no --stop=1"
GRUB_DISABLE_RECOVERY="true"
GRUB_GFXMODE=text

I can see the small pc icon on the top left from the target client, when I'm remotely connected via amtterm, but I can't interact with the system, no output, only when I restart the target client, I can see some message saying PC is restarting, that's all

James Hubbard said...

If you use dmesg to output the inforamation about your tty setup, does it match the speed and port information that you're using? It seems like I had to manually set the com port values in my bios, but I can't reboot my machine to verify that at the moment.

This command should show you the tty data.
dmesg |grep -B3 -A5 tty