Console Configuration

From CSCWiki
Revision as of 03:42, 26 April 2008 by Mspang (talk | contribs)
Jump to navigation Jump to search

This article explains how to configure various operating system to use a serial console.

GRUB

To use the serial console exclusively for GRUB, add the following lines to menu.lst:

serial --unit=0 --speed=115200
terminal serial

To allow use of either the serial console or monitor/keyboard, add these lines instead:

serial --unit=0 --speed=115200
terminal console serial

Linux

Kernel Messages

To make /dev/console the serial port, append "console=ttyS1,9600" to the kernel command line. You can replace 115200 by any valid baud rate. This will make calls to printk() display to the serial port.

You can have kernel messages displayed on both the serial port and the monitor by specifying two consoles, as in "console=ttyS0,115200 console=tty0".

Console Login

To get a login prompt on the serial port, you need to edit /etc/inittab. For example, if you have a vt100 connected to the first serial port at 128k baud, use a line such as the following:

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

Note: we use Puppet to manage inittab. You must make this change in nodes.pp rather than editing inittab directly.

Solaris

To make /dev/console the serial port, use eeprom:

eeprom console=ttya ttya-mode="115200,8,n,1,-"

You must update the boot archive after doing this:

bootadm update-archive

Unfortunately, there does not seem to use both the serial port and monitor as the console in Solaris. Adding a GRUB entry to boot using the keyboard and monitor as the console is highly recommended:

title Solaris 10 AMD64 TEXT CONSOLE
kernel /platform/i86pc/multiboot kernel/amd64/unix -B console=text
module /platform/i86pc/boot_archive

title Solaris 10 AMD64 SERIAL CONSOLE
kernel /platform/i86pc/multiboot kernel/amd64/unix -B console=ttya,ttya-mode="115200,8,n,1,-"
module /platform/i86pc/boot_archive

Next, modify /etc/ttydefs so that console-login doesn't change the baud after boot:

 console:115200 hupcl opost onlcr:115200::console

Finally, restart console-login:

 svcadm restart console-login