Serial Console

From brainsik
Jump to navigation Jump to search

Serial console support was successfully achieved on Debian "etch" and Ubuntu "dapper".

Grub Menu

This is a side-note, but on systems where booting into single-user mode drops you to a root prompt (e.g., Ubuntu), it's a good idea to remove this option from the menu and give Grub a password.

To generate a password, run grub from the command line:

grub> md5crypt
Password: **********
Encrypted: $1$U$JK7xFegdxWH6VuppCUSIb.

Find where the password is set in /boot/grub/menu.lst, and add the following:

password --md5 $1$U$JK7xFegdxWH6VuppCUSIb.
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
terminal --timeout=3 console serial

This gives you 3 seconds to hit a key on the serial console before it defaults back to VGA console.

Kernel Boot

For each Grub menu item you want to boot output to go to the serial console, append the following to the kernel line:

console=tty0 console=ttyS0,115200n8

An alternative approach is to use altoptions to have Grub automagically append the serial console parameters for each kernel:

# altoptions=(serial console) console=tty0 console=ttyS0,115200n8

the default options with get squashed by this, so make sure to add them here as well. For example, if quiet is a default option you would need:

# altoptions=(serial console) quiet console=tty0 console=ttyS0,115200n8

Login

Edit /etc/inittab and uncomment the line under the comment about getty on a serial line. You'll want something like this:

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

To have init re-read its config:

root# init q