Enabling Serial Console Output

From Peter Pap's Technowiki
Revision as of 01:47, 21 September 2010 by Ppapa (talk | contribs)

Jump to: navigation, search

A serial port can be setup for use as a console quiet easily. This example works for GRUB 1. I have not yet had need to do it for GRUB2.

For example. for use as COM1 (ttyS0), 38400 baud, 8 bits, 1 stop, no parity:

1. To enable the GRUB menu, add the following to /boot/grub/menu.lst:

  serial --unit=0 --speed=38400 --word=8 --parity=no --stop=1
  terminal --timeout=10 serial console

2. To redirect the messages during the boot process, append the following kernel parameters: "console=tty0 console=ttyS0,38400n8". For example:

  title CentOS (2.6.18-53.1.4.el5) (hd0)
  root (hd0,0)
  kernel /vmlinuz-2.6.18-53.1.4.el5 ro root=/dev/md2 rhgb quiet console=tty0 console=ttyS0,38400n8
  initrd /initrd-2.6.18-53.1.4.el5.img

NOTE: enabling the redirection of the kernel messages will disable the splash screen on the video monitor.

3. To enable serial console login once the system is booted, add "agetty" to "/etc/inittab". For example:

  # Run gettys in standard runlevels
  co:2345:respawn:/sbin/agetty ttyS0 38400 vt102


Now reboot the computer and connect a laplink style serial cable between this computer and another "client" computer. Start a serial terminal program like "minicom" (set to 38400 baud) on the client and you should see some text asking you to press any key or maybe the GRUB menu once the timeout (10 seconds) has expired. Once the system has fully booted, you can login to the machine using your own account or the root account.