Return to Solaris Home Page.


Using Serial Consoles - (Solaris / Linux)

by Jeff Hunter, Sr. Database Administrator

Overview

The following article documents some of the tips for connecting the serial port of a UNIX Server (Sun SPARC / Linux) to the serial port (console) of a Sun Server. This is often helpful and even necessary when performing routine administrative tasks or initiating critical and/or long running processes. Access to the serial console for many Sun servers is the only way to perform administrative tasks given these servers do not come with a frame buffer (i.e. video card).

There are times when I need to initiate a long running job but cannot remain connected to the network for the duration of its execution. In cases like this, I can connect to the serial console of the Sun server, initiate the job and disconnect. The job will remain running even when I drop my connection to the serial port. I can, at a later time, reconnect to the serial console to determine the results.

The first two sections of this article explain the applications (programs) used from a Sun SPARC server and then a Linux server for obtaining a serial console connection. The remainder of this article attempts to describe the details (cables, connections, adapters) of obtaining a serial console connection to/from different Sun SPARC servers.

Connect From Sun SPARC Serial Port

From a Sun machine, if you wanted to access the serial console of another computer (ie. Linux, Sun, etc.), you would use the tip command. The configuration file for tip is /etc/remote. In most cases, you will be concerned with the hardwire entry in this file. First, connect the two machines by their serial ports (null modem if required), and from the Sun SPARC (Solaris) machine, type the following at the command-line to connect to the serial console of the other machine (Solaris / Linux):
  # tip hardwire
Below is an example /etc/remote file from the Sun SPARC (Solaris) machine that contains the hardwire entry to go through serial port B (/dev/term/b). If you wanted to change this entry to go out through serial port A instead, change "/dev/term/b" to "/dev/term/a".

cuab:dv=/dev/cua/b:br#2400
dialup1|Dial-up system:\
        :pn=2015551212:tc=UNIX-2400:
hardwire:\
        :dv=/dev/term/b:br#9600:el=^C^S^Q^U^D:ie=%$:oe=^D:
tip300:tc=UNIX-300:
tip1200:tc=UNIX-1200:
tip0|tip2400:tc=UNIX-2400:
tip9600:tc=UNIX-9600:
tip19200:tc=UNIX-19200:
UNIX-300:\
        :el=^D^U^C^S^Q^O@:du:at=hayes:ie=#$%:oe=^D:br#300:tc=dialers:
UNIX-1200:\
        :el=^D^U^C^S^Q^O@:du:at=hayes:ie=#$%:oe=^D:br#1200:tc=dialers:
UNIX-2400:\
        :el=^D^U^C^S^Q^O@:du:at=hayes:ie=#$%:oe=^D:br#2400:tc=dialers:
UNIX-9600:\
        :el=^D^U^C^S^Q^O@:du:at=hayes:ie=#$%:oe=^D:br#9600:tc=dialers:
UNIX-19200:\
        :el=^D^U^C^S^Q^O@:du:at=hayes:ie=#$%:oe=^D:br#19200:tc=dialers:
VMS-300|TOPS20-300:\
        :el=^Z^U^C^S^Q^O:du:at=hayes:ie=$@:oe=^Z:br#300:tc=dialers:
VMS-1200|TOPS20-1200:\
        :el=^Z^U^C^S^Q^O:du:at=hayes:ie=$@:oe=^Z:br#1200:tc=dialers:
dialers:\
        :dv=/dev/cua/b:
--------------------------------------------------------------------
The attributes are:

dv      device to use for the tty
el      EOL marks (default is NULL)
du      make a call flag (dial up)
pn      phone numbers (@ =>'s search phones file; possibly taken from
                              PHONES environment variable)
at      ACU type
ie      input EOF marks (default is NULL)
oe      output EOF string (default is NULL)
cu      call unit (default is dv)
br      baud rate (defaults to 300)
fs      frame size (default is BUFSIZ) -- used in buffering writes
          on receive operations
tc      to continue a capability

Connect to a Sun Serial Console from Linux

Linux provides two methods (programs) that can be used to connect to a serial console of a Sun server.

Connecting Using minicom

The first application I'll talk about is "minicom". Most Linux distributions (i.e. Red Hat) already include minicom. If your particular distribution does not include minicom, you can download it from the following URL: http://www.pp.clinet.fi/~walker/mcdevel.html.

Once you have Minicom installed, start it up with the command "minicom". Press "Ctrl-A Z" to get to the main menu. Press "o" to configure minicom. Go to "Serial port setup" and make sure that you are set to the correct "Serial Device" and that the speed on line E matches the speed of the serial console you are connecting to. (In most cases with Sun, this is 9600.) Here are the settings I made when using my Serial A / COM1 port on my Linux box:

+-----------------------------------------------------------------------+
| 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?                                              |
+-----------------------------------------------------------------------+
After making all necessary changes, hit the ESC key to go back to the "configurations" menu. Now go to "Modem and dialing". Change the "Init string" to "~^M~".
 +--------------------[Modem and dialing parameter setup]---------------------+
 |                                                                            |
 | A - Init string ......... ~^M~                                             |
 | B - Reset string ........ ^M~ATZ^M~                                        |
 | C - Dialing prefix #1.... ATDT                                             |
 | D - Dialing suffix #1.... ^M                                               |
 | E - Dialing prefix #2.... ATDP                                             |
 | F - Dialing suffix #2.... ^M                                               |
 | G - Dialing prefix #3.... ATX1DT                                           |
 | H - Dialing suffix #3.... ;X4D^M                                           |
 | I - Connect string ...... CONNECT                                          |
 | J - No connect strings .. NO CARRIER            BUSY                       |
 |                           NO DIALTONE           VOICE                      |
 | K - Hang-up string ...... ~~+++~~ATH^M                                     |
 | L - Dial cancel string .. ^M                                               |
 |                                                                            |
 | M - Dial time ........... 45      Q - Auto bps detect ..... No             |
 | N - Delay before redial . 2       R - Modem has DCD line .. Yes            |
 | O - Number of tries ..... 10      S - Status line shows ... DTE speed      |
 | P - DTR drop time (0=no). 1       T - Multi-line untag .... No             |
 |                                                                            |
 | Change which setting?       (Return or Esc to exit)                        |
 +----------------------------------------------------------------------------+

Save the settings (as dflt), and then restart Minicom. You should now see a login prompt.


If you receive an error message similar to the following when starting minicom:
# minicom
minicom: WARNING: configuration file not found, using defaults
Device /dev/modem access failed: No such file or directory.
then minicom will need to be configured correctly. Unlike mentioned above, Minicom will not start and provide you with an opportunity to change any options. The serial device will need to be changed from /dev/modem to /dev/ttyS0.

To setup minicom, start it with the -s option.

# minicom -s

Navigate to the menu option Serial port setup and change:

+-----------------------------------------------------------------------+
| A -    Serial Device      : /dev/modem                                |
| B - Lockfile Location     : /var/lock                                 |
| C -   Callin Program      :                                           |
| D -  Callout Program      :                                           |
| E -    Bps/Par/Bits       : 115200 8N1                                |
| F - Hardware Flow Control : Yes                                       |
| G - Software Flow Control : No                                        |
|                                                                       |
|    Change which setting?                                              |
+-----------------------------------------------------------------------+
to
+-----------------------------------------------------------------------+
| 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?                                              |
+-----------------------------------------------------------------------+

After making all necessary changes, hit the ESC key to go back to the "configurations" menu. Now go to "Modem and dialing". Change the "Init string" to "~^M~".

 +--------------------[Modem and dialing parameter setup]---------------------+
 |                                                                            |
 | A - Init string ......... ~^M~                                             |
 | B - Reset string ........ ^M~ATZ^M~                                        |
 | C - Dialing prefix #1.... ATDT                                             |
 | D - Dialing suffix #1.... ^M                                               |
 | E - Dialing prefix #2.... ATDP                                             |
 | F - Dialing suffix #2.... ^M                                               |
 | G - Dialing prefix #3.... ATX1DT                                           |
 | H - Dialing suffix #3.... ;X4D^M                                           |
 | I - Connect string ...... CONNECT                                          |
 | J - No connect strings .. NO CARRIER            BUSY                       |
 |                           NO DIALTONE           VOICE                      |
 | K - Hang-up string ...... ~~+++~~ATH^M                                     |
 | L - Dial cancel string .. ^M                                               |
 |                                                                            |
 | M - Dial time ........... 45      Q - Auto bps detect ..... No             |
 | N - Delay before redial . 2       R - Modem has DCD line .. Yes            |
 | O - Number of tries ..... 10      S - Status line shows ... DTE speed      |
 | P - DTR drop time (0=no). 1       T - Multi-line untag .... No             |
 |                                                                            |
 | Change which setting?       (Return or Esc to exit)                        |
 +----------------------------------------------------------------------------+

Save the settings (as dflt), and then restart Minicom. You should now see a login prompt.

Connecting Using UUCP

Another common application to use in Linux for connecting to a serial console is UUCP. Most Linux distributions include the UUCP application. Start UUCP with the command "cu -l [device] -s [speed]", where [device] is the serial port you are using, such as ttyS0 (COM1) or ttyS1 (COM2), and [speed] is the speed of the serial console that you are connecting to.

Here is an example:

# cu -l /dev/ttyS0 -s 9600
You may need to hit enter before you see the login prompt. If you see a bunch of weird characters, then you probably specified the wrong speed.

To exit, just type "~.".


Sun Blade 100/150


Sun E450


Sun E250


Sun V100



Last modified on: Tuesday, 13-May-2014 02:17:04 EDT
Page Count: 337425