serial terminal with archlinux

general = { about, articles, links, projects }     meta = { date-posted: 2007-05-12 }

I was working on getting serial hooked up from my laptop to one of my linux desktop/servers.

I haven't done a whole lot of work with serial on linux before. First I had to find a linux serial client.
I discovered two:

I was very surprised that screen worked as a serial talker. It works great in fact!

Here is what I did.

The server config

  1. Edit grub on the server. I wanted serial access to kernel choices too!

    This is what I put in the option section of /boot/grub/menu.lst

    timeout   5
    default   0
    color light-blue/black light-cyan/blue
    serial --unit=0 --speed=115200
    terminal --timeout=5 serial console
    

    The --unit=0 option specifies the serial device number. I have ttyS0, so I need --unit=0. The --speed=115200 option is the flow-rate you specify for your serial device.
    Then in the kernel section...

    title ArchLinux
    root   (hd0,0)
    kernel /vmlinuz26 root=/dev/sda3 ro console=tty0 console=ttyS0,115200
    initrd /kernel26.img
    

    In the kernel line, the console options specify the devices that are granted console access. I specified a normal tty first, and the serial second. That seems to work fine for me.

  2. Next I needed to make an addition to /etc/inittab

    S0:12345:respawn:/sbin/agetty -L 115200 ttyS0 vt100
    
  3. If you want root to be able to login over the serial tty that you just specified, then you need to add it to the /etc/securetty file. Just add a new line, with ttyS0 on it (based on the above configs).

  4. I rebooted the box, so that I could try out my serial terminal goodness.

The client w/ screen hotness

  1. I executed the following command...

    screen -R serial /dev/ttyS0 115200
    

    That was it. To kill the screen session, I just did a C-a k. Say yes, and bam. Disconnected. Using gtkterm is fairly self explanatory.