Remote management of home server without iDrac/iLo, just with serial console

From EnigmaGuy Wiki
Jump to navigation Jump to search

If you want to manage your home server over serial console without iDrac or iLo you can use RaspberryPi with connected serial console converter over USB to control your machine. You have to bear in mind one thing. Normally it is not possible to use USB devices when booting Linux, so for example if you need to enter a password to GRUB or encrypted hard drive during boot-up of Linux it is neccessary to have an PCI Express card (most today mainboards does not supports RS232 connection) not USB module. Fortuntaly, you can all things order for pennies from Aliexpress with free world-wide shipping, see below.

RS232 PCI Express card supported in Linux

RS232 PCI Express card supported in Linux

Description

  • On aliexpress - this link (2019) - [1]
  • This name "2018 High Quality Plug And Play PCI-E PCI to Dual Serial DB9 RS232 Express Serial Controller 2-Port Adapter Card + Driver CD"
  • Works under Linux, (tested Kernel4, slot0 - /dev/ttyUSB4, slot1 - /dev/ttyUSB5)

Advantages

  • Works with every mainboard which has PCI Express (does not have to have build-in serial)

Disadvantages

  • Does not works correctly in GRUB (boot menu cannot be forwarded to higher serial ports, only linux console and kernel works)

USB Serial convertor

USB serial

Description

  • On aliexpress - this link (2019) - [2]
  • This name "1M USB to RS232 Serial 9 Pin Adapter Cable w DB9 Female to DB25 Male Connector"
  • Raspberry Pi driver for Noobs 3.0.0 - [3]

Advantages

  • very cheap, works fine

Disadvantages

  • USB Id is set to zero (all devices has same ID), so you cannot set exact device in Udev for more of these USB serial convertors

Serial bracket

USB serial

Description

  • On aliexpress - this link (2019) - [4]
  • This name "Serial 9 pin DB9 RS232 Motherboard Com Port Ribbon Cable Connector Bracket 27cm Cables"

Advantages

  • price (just 1 USD)
  • works with most mainboards (many mainboards has integrated serial ports, there is just no bracket in package)
  • works correctly with Grub

Grub configuration (tested on Ubuntu 18.04)

Key notes

  • Please keep in mind that if your mainboard supports it, using serial bracket over PCI Express card (which does not have to work correctly in Grub menu) is recommended
  • Serial speed 9600 is recommended (I run into the issues when using 115200)
  • If you update your GRUB configuration you won't see anything on the screen (only serial port)
  • Please backup your GRUB config file before making any changes
  • If you run into the issues with GRUB, you will have to boot from Installation CD, recover your backed-up GRUB file using this tutorial - [5]

Modified /etc/default/grub

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash console=tty0 console=ttyS0,9600n8"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --speed=9600 --unit=0 --word=8 --parity=no --stop=1"

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

Usage

  • After you modify file, please run "sudo update-grub"
  • Make sure you double check information about serial port device and make backup of your original file!

Accessing machine serial port from Raspberry Pi

Raspberry Pi
  • For accessing serial port use this command: sudo screen /dev/ttyUSB0 9600
  • You can use USB serial convertor