Howto setup serial console access on a linux host. It works the same way on bare metal servers as on virtual machines. In this particular setup there a debian installation is used with addition to QEMU. I needed serial console access to this virutal machine as it was a headless server and it is easier to use a terminal like XTerm instead of a pop up window from the virtualization application (here QEMU).

Start the the guest (virtual machine) with following command:

user % qemu-system-i386 -boot c -hda cacti.qcow2

Login to the guest. If using GRUB legacy edit following file

user $ nano /boot/grub/menu.lst

Add a console entry (the baud rate can be 9600,19200,38400 and even higher) I personally prefer 115200 baud if configuring linux hosts. 9600 is rather slow.

📄 File /boot/grub/menu.lst

title Debian GNU/Linux 2.6.42 root (hd0,0) kernel /boot/vmlinuz-2.6.42 ro console=ttyS0,115200 earlyprint=serial,ttyS0,115200 initrd /boot/initrd.img-2.6.32-5-486

Edit the file /etc/inittab and add following entry if using for debian:

📄 File /etc/inittab

... T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100 ...

Then take sure UART serial ports is listed in /etc/securetty

ttyS0

Add username and password to the file /etc/issue

Debian GNU/Linux 3.1 \n \l

Systemusers:    root:cacti

Here the procedure explained for Linux TinyCore. Tinycore uses SYSLINUX as boot manager edit /boot/extlinux/extlinux.conf and add following console entry:

DEFAULT core
LABEL core
KERNEL /boot/vmlinuz console=ttyS0,115200n8
APPEND initrd=/boot/core.gz quiet

Add following line to the /etc/inittab file:

    ttyS0::respawn:/sbin/getty 115200 ttyS0

Then take sure UART serial ports is likset in /etc/securetty

ttyS0

Document username and password in the file /etc/issue

Login to Core Linux

Username "tc", password is not set

The last step is optional.

The procedure explaing form TinyCore has been taken form Radovans Brezular blog. The article linked is really worth reading especially if building a remastered tinycore for own purposes. Thank you Radovan.