Serial console on Mint 9

Post Reply
the suicidal eggroll
Posts: 2
Joined: Wed Feb 22, 2012 9:41 pm

Serial console on Mint 9

Post by the suicidal eggroll »

I had some issues finding out how to do this through Google, so I thought I'd post the steps here.

This should be applicable to any Mint 9 installation, regardless of the hardware, but it's especially useful on the fit-PC since I'm sure many users will be installing them in "headless" configurations with no keyboard, mouse, or monitor.

To be clear, the serial console allows you to log into the system through an RS-232 null modem cable, giving you the ability to do maintenance in case the network connection goes down, without having to piece together a keyboard, mouse, and monitor just to troubleshoot. It's completely reversible, and doesn't affect your ability to log in graphically like normal.

Step 1 - Add the console information to the kernel parameters so you get boot/shutdown information in the console

First, backup your existing /boot/grub/grub.cfg file:

Code: Select all

sudo cp /boot/grub/grub.cfg /boot/grub/grub.cfg.backup
Open /boot/grub/grub.cfg in your favorite text editor using sudo.
Find the line that looks something like:

Code: Select all

        linux   /boot/vmlinux-2.6.35-34-fitpc2 root=UUID-gibberish-gibberish-gibberish ro quiet splash
And append "console=tty0 console=ttyS0,115200n8" to the end of the line, so it looks something like:

Code: Select all

        linux   /boot/vmlinux-2.6.35-34-fitpc2 root=UUID-gibberish-gibberish-gibberish ro quiet splash console=tty0 console=ttyS0,115200n8
There should be a couple of these lines in the file (for regular boot, recovery mode, etc), append the console information to all of them.

Step 2 - Now the OS should be dumping boot/shutdown information to the console, but you still need to allocate a terminal to it so you can log in

Open "/etc/init/ttyS0.conf" as sudo in your favorite text editor. This file shouldn't exist yet, you'll be creating it. Paste the following into this file:

Code: Select all

start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]

exec /sbin/getty -L ttyS0 115200 vt100
Now just reboot, and it should be good to go. To reverse the procedure, just move /etc/boot/grub.cfg.backup back to /etc/boot/grub.cfg, and delete /etc/init/ttyS0.conf.

To connect to the console, use the provided adapter to convert the mini connector to DB9, then attach a DB9 null modem cable between the fit-PC and your computer (using the serial port if you have one, or a USB/serial adapter if you don't). On your computer, you can use any serial communication program (kermit/minicom on linux, hyperterminal on windows, among many others), set it for 115200 bps, 8 data bits, 1 stop bit, no parity, no flow control, then connect and go. Usage should be exactly like connecting to the fit-PC through SSH.

Hopefully this helps somebody out there, if not, oh well.

Post Reply

Return to “Linux Mint”