Setting Up a Serial Console on RedHat Linux 9.0

I put these instuctions together several years ago. I am moving from a co-located physical server to a VPS with Hands-on Web Hosting so in the process of moving I am trying to consolidate some of my older sites that I no longer update. I am guessing these instructions should also be usable on newer versions of RedHat, Fedora, or other Linux distros.

If you are running RedHat 9.0 and want to run “headless” (no monitor, keyboard, or mouse) but still want to have a console to receive console messages or login, here are the basics of what I did to get it working.

This example will set up a serial console on Com 1 (ttyS0) at 38.4K Baud, Data bits 8, Parity None, 1 stop bit.

Requirements:

* agetty – alternative Linux getty – agetty is included in the RedHat 9.0 Installation (unless you chose not to install it)
* A Null Modem Cable – To connect to your PC, laptop, or terminal. You can make one yourself or pick one up from Radio Shack for a few bucks.
* Running lilo as your boot loader.
* Support for console on serial port must be compiled into the kernel (not loaded as a module) This option is located under Character devices – it is compiled in by default on Redhat 9 installations.
* Root access.

Make sure you set up your BIOS to continue on Keyboard or Mouse errors. Some machines will allow you to ignore these errors specifically, on others you may have to configure it to continue on any error.

In /etc/lilo.conf add this to the global section:

serial = 0,38400n8

Then add this to the append line in the kernel section:

append = “console=ttyS0,38400n8″

If you are already using an append for other options just add console=ttyS0,38400n8 to the end of those. Once you have made the changes to /etc/lilo.conf remember to run /sbin/lilo to set the new configuration for the next boot.

To enable the ability to login on to the machine using the serial console add the following line to /etc/inittab:

s0:12345:respawn:/sbin/agetty -i -h -L 38400 ttyS0 vt100

Connect the null modem cable to Com 1 and then to your PC, Laptop, or Terminal. Configure the connection (terminal program) for 38400 baud (38.4k), 8 data bits, parity none, and stop bits 1. (On windows you can connect using Hyperterminal, TeraTerm, or any other terminal program that supports serial ports. On a Linux machine you can use minicom).

Now reboot the linux box that you configured the serial console on and monitor the connection. You should see the kernel decompress and then the boot messages over your serial connection. Once the machine has finished booting you should receive a logon prompt on the console.

If you receive a bunch of garbage on the terminal check your baud and parity settings. If you do not receive a logon prompt check you inittab configuration and make sure agetty is running on ttyS0 (ps -ef | grep agetty).

For more help check out the man pages for agetty, lilo, lilo.conf, and inittab.

You can also try a google search for linux serial console, there are a lot of other similar ways to do this.

August 8, 2009 | Filed Under My Notes | Leave a Comment 

Welcome

Thanks for dropping by! Feel free to join the discussion by leaving comments, and stay updated by subscribing to the RSS feed. Enjoy!
 

Not into geek stuff? Check out The VABiker.Net or SuffolkSky.com.
 

Why not Follow Me on Twitter?

 

  • Geek Reads

     
    • VMware vSphere 4.1 HA and DRS Technical Deepdive
      This technical guide covers the basic steps needed to create a VMware HA and DRS cluster, but even more important explains the concepts and mechanisms behind HA and DRS which will enable you to make well educated decisions. This book will take you in to the trenches of HA and DRS and will give you the tools to understand and implement e.g. HA admission control policies, DRS resource pools and resource allocation settings.
       
    • Mastering vSphere 4 by Scott Lowe
      Install and manage one or one thousand virtual servers in your enterprise with the latest generation of VMware virtualization software, vSphere 4, and this comprehensive guide.

    • vSphere 4.0 Quick Start Guide
      vSphere 4.0 Quick Start Guide continues from an idea started several years ago by a few engineers. The idea was simple, provide an easy to use reference guide for all level administrators, consultants and architects.