17.5. Setting Up the Serial Console

You have a Linux laptop or workstation all ready to go into service as a serial console; all you need to know is how to configure it, and how to use the communications software. You want to connect directly to your headless server.

First, you need these things:

Then, configure Minicom, connect the two systems, and you're done.

Start up Minicom with -s for Setup:

	# minicom -s
	------[configuration]------
	| Filenames and paths
	| File transfer protocols
	| Serial port setup
	| Modem and dialing
	| Screen and keyboard
	| Save setup as dfl
	| Save setup as..
	| Exit
	| Exit from Minicom
	----------------------------

Select Serial port setup. From the following menu, select the letter of the option you want to change, then hit Return to get back to the "Change which setting?" screen:

	------------------------------------------
	| A -    Serial Device      : /dev/ttyS0
	| B - Lockfile Location     : /var/lock
	| C -   Callin Program      :
	| D -  Callout Program      :
	| E -    Bps/Par/Bits       : 9600 8N1
	| F - Hardware Flow Control : Yes
	| G - Software Flow Control : No
	|
	|    Change which setting?
	-------------------------------------------

From here, hit Return again to get back to the main menu. Next, select the Modem and dialing option, and make sure the Init string and Reset string settings are blank. Finally, select Save setup as dfl to make this the default, and then Exit from Minicom.

Now, take your nice new null-modem cable, and connect the two machines. Then, fire up Minicom:

	# minicom
	Welcome to minicom 2.1
	OPTIONS: History Buffer, F-key Macros, Search History Buffer, I18n
	Compiled on Nov 12 2003, 19:21:57
	Press CTRL-A Z for help on special keys
	headless login:

Login to your server, and you're in business. To exit, hit Ctrl-A, X.

What can you do now? Anything that you can do from any Linux command shell. Now you can disconnect the keyboard and monitor from the server. Always turn computers off before connecting or disconnecting PS/2 keyboards and mice. I know, some folks say you don't have to turn off the power before removing PS/2 keyboards and mice. I say it's cheap insurance against possibly damaging your system; the PS/2 port was not designed to be hot-pluggable.

The default Bps value for option E - Bps/Par/Bits in the Minicom setup can be anything from 9600 to 115200, depending on your Linux distribution. The Bps setting, when you're connecting with a null modem cable, must be the same throughout all of your configurations—in the bootloader, /etc/inittab, and Minicom. 9600 is the safest. You can experiment with higher speeds: 38400 is the standard Linux console speed. If it doesn't work, try 19200.

The setserial command displays the speed of your UART:

	$ setserial -g /dev/ttyS0
	/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4

But, it's unlikely you'll successfully go higher than 38400. These are all the possible serial line speeds:

110 bps
300 bps
1200 bps
2400 bps
4800 bps
9600 bps
19,200 bps
38,400 bps
57,600 bps
115,200 bps