Revision 2 as of 2005-07-19 01:36:17

Clear message

Serial Console Howto for Ubuntu 5.04

This document presents the minimum amount of work required to enable a serial console login on an Ubuntu 5.04 installation.

This procedure was developed using the Remote Serial Console HOWTO ([ http://www.faqs.org/docs/Linux-HOWTO/Remote-Serial-Console-HOWTO.html]), and adapted to apply specifically to Ubuntu 5.04. The reader is referred to this document for any issues arising from using this HOWTO.

Assumptions

  • You are familiar with console software, ie minicom, and can set it up to listen to the appropriate serial port with the appropriate speed, data bits etc.
  • The serial connection is being made at 9600 baud 8n1, on console port /dev/ttyS0
  • You are comfortable editing critical system files such as /etc/inittab, /boot/grub/menu.lst

Configuring the console login process

This section details how to configure the 'getty' process to enable a login via the console port.

1) Edit /etc/inittab

sudo vi /etc/inittab

2) Change the following line:

#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100

to:

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

3) Restart init:

sudo /sbin/telinit q

At this point, a new login prompt should appear on the output of the serial console.

Configuring grub

This section details how to get grub talking via the serial port.

This section is optional if the user does not want grub interaction via the serial console port.

1) Edit /boot/grub/menu.lst:

vi /boot/grub/menu.lst

2) Add the following lines to the top of the file:

# Enable console output via the serial port. unit 0 is /dev/ttyS0, unit 1 is /dev/ttyS1...
serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1
terminal serial

3) When you next reboot, the output from grub should come out of the console port specified in the --unit option.

Configuring the kernel boot parameters

This section details how to configure the kernel boot parameters to get boot information through the console port.

This section is optional if the user does not want the kernel boot messages to appear on the serial console port.

The following procedure can be carried out by modifying the 'kernel' line in grub prior to committing the changes directly to the /boot/grub/menu.lst file.

1) Edit /boot/grub/menu.lst:

sudo vi /boot/grub/menu.lst

2) Modify the kernel line for the image you want to boot using the serial console on. In this case, I'm setting up the default 2.6.10-5.386 kernel to use the serial console line. Change:

title           Ubuntu, kernel 2.6.10-5-386
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.10-5-386 root=/dev/hda1 ro quiet splash
initrd          /boot/initrd.img-2.6.10-5-386
savedefault
boot

to:

title           Ubuntu, kernel 2.6.10-5-386
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.10-5-386 root=/dev/hda1 ro quiet splash console=tty0 console=ttyS0,9600n8
initrd          /boot/initrd.img-2.6.10-5-386
savedefault
boot

NOTE: the first console parameter is 'console=tty0', not ttyS0

3) Reboot into this kernel. Output from the boot process should be sent via the serial console line.