How to enable the serial port on XEN servers

November 30th, 2008 Categories: HOWTO's


XEN uses /dev/ttyS0 for it’s own internal console, which is a neat way to manage the XEN server and access the console from another machine.

But, this also means that you won’t be able to use the computer / server’s serial port to access for instance a network switch or serial UPS from Linux.

If you would rather use the serial port to access serial devices, then you need to modify the grub menu file (/boot/grub/menu.lst) as follows:

Original grub menu:
[sourcecode language='sh']

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/System/root
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-92.1.18.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-92.1.18.el5
module /vmlinuz-2.6.18-92.1.18.el5xen ro root=/dev/System/root rhgb quiet
module /initrd-2.6.18-92.1.18.el5xen.img

[/sourcecode]

Modified Grub menu:

[sourcecode language='sh']
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/System/root
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-92.1.18.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-92.1.18.el5
module /vmlinuz-2.6.18-92.1.18.el5xen ro root=/dev/System/root rhgb quiet xencons=tty6
module /initrd-2.6.18-92.1.18.el5xen.img
[/sourcecode]

As you can see, I have added the line xencons=tty6 after the “module /vmlinuz-2.6.18-92.1.18.el5xen” line to tell XEN to use /dev/tty6 console instead.

Other options are:

xencons=off disable console at all
xencons=ttyX attach console to /dev/ttyX
xencons=ttySX attach console to /dev/ttySX
xencons=xvcX attach console to /dev/xvcX

Tags:

One Response to “How to enable the serial port on XEN servers”

1 trackbacks

  1. servers | Digg hot tags Pingback | 2008/12/01
You must be logged in to post a comment.