Working with the serial console

From ArchWiki
Revision as of 19:32, 26 May 2008 by Daf666 (talk | contribs)
Jump to: navigation, search


Configure your Arch Linux machine, so you can connect to it via the serial console port (com port). This will enable you to administer the machine, even if it has no keyboard, mouse, monitor or network attached to it (a headless server).

As of Arch Linux 2007.x, installation of Arch Linux is possible via the serial console as well.

A basic environment for this scenario is connecting the administering machine to the administered machine, using a serial cable (9-pin connector cable). The administering machine can be any Linux or Windows machine with a terminal emulator program (putty or Minicom for example)


Configure console access on the target machine

1. Edit the grub.conf file:

# vi /boot/grub/menu.lst

Add the console parameters at the end of your current kernel line:


For example, the kernel line should look something like this after modification:

kernel /vmlinuz26 root=/dev/md0 ro md=0,/dev/sda3,/dev/sdb3 vga=773 console=ttyS0,9600

2. Edit the inittab file:

# vi /etc/inittab

Add a new agetty line below the existing ones :

c0:2345:respawn:/sbin/agetty 9600 ttyS0 linux

3. Edit the securetty file:

# vi /etc/securetty

Below the existing tty's add an entry for the the serial console:


4. Reboot the machine

Note that in all of the steps above ttyS1 can also be used, in case that your machine has more than one serial port.

Making Connections

Connect using a terminal emulator program

Perform these steps on the machine used to connect the remote console.

1. Install Minicom:

# pacman -S minicom

2. Start Minicom in setup mode:

# minicom -s

3. Using the textual navigation menu change the serial port settings to the following:

Serial Device: /dev/ttyS0
Bps/Par/Bits: 9600 8N1

Press Enter to exit the menus (pressing Esc will not save changes)

4. Remove the modem Init and Reset strings:

Under the 'Modem and Dialing' menu delete the Init and Reset strings.

5. Save the setup:

From the main menu, choose 'save setup as dfl'

6. Exit Minicom:

From the main menu, choose 'Exit from Minicom'

7. Connect to the target machine:

While the serial cable is connected to the target machine, start the Minicom program:

# minicom

8. Exiting Minicom

To finish the session press 'ctrl-A' and then 'X'.

On Windows machines, connect to the serial port using programs like Putty or Hyper Terminal.

Installing Arch Linux using the serial console

1. Connect to the target machine using the method described above.

2. Boot the target machine using the Arch Linux installation CD.

After a while, output from the console will start showing on screen and setup can be started normally.

Note that after setup is complete, the console settings will not be saved on the target machine, in order to avoid having to connect a keyboard and monitor, configure console access on the target machine before rebooting.