35.11. Troubleshooting with serial consoles


Linux kernels can output information to serial ports. This is useful for debugging kernel panics and hardware issues with video devices or headless servers. The subsections in this section cover setting up serial console output for machines running Red Hat Enterprise Linux virtualization kernels and their guests.

35.11.1. Serial console output for Xen

By default, the serial console for the Xen hypervisor is disabled and no data is output from serial ports.
To receive kernel information on a serial port modify the /boot/grub/grub.conf file by setting the appropriate serial device parameters.
If your serial console is on com1, modify /boot/grub/grub.conf by inserting the lines com1=115200,8n1, console=tty0 and console=ttyS0,115200 where shown.
title Red Hat Enterprise Linux 5 i386 Xen (2.6.18-92.el5xen)
	root (hd0, 8)
	kernel /boot/xen.gz-2.6.18-92.el5 com1=115200,8n1
	module /boot/vmlinuz-2.6.18-92.el5xen ro root=LABEL=VG_i386 console=tty0
				console=ttyS0,115200
	module /boot/initrd-2.6.18-92.el5xen.img
If your serial console is on com2, modify /boot/grub/grub.conf by inserting the lines com2=115200,8n1 console=com2L, console=tty0 and console=ttyS0,115200 where shown.
title Red Hat Enterprise Linux 5 i386 Xen (2.6.18-92.el5xen)
	root (hd0, 8)
	kernel /boot/xen.gz-2.6.18-92.el5 com2=115200,8n1 console=com2L
	module /boot/vmlinuz-2.6.18-92.el5xen ro root=LABEL=VG_i386 console=tty0
	console=ttyS0,115200
	module /boot/initrd-2.6.18-92.el5xen.img
Save the changes and reboot the host. The hypervisor outputs serial data on the serial (com1, com2 and so on) you selected in the previous step.
Note the example using the com2 port, the parameter console=ttyS0 on the vmlinuz line us used. The behavior of every port being used as console=ttyS0 is not standard Linux behavior and is specific to the Xen environment.

35.11.2. Xen serial console output from para-virtualized guests

This section describes how to configure a virtualized serial console for Red Hat Enterprise Linux para-virtualized guests.
Serial console output from para-virtualized guests can be received using the "virsh console" or in the "Serial Console" window of virt-manager. Set up the virtual serial console using this procedure:
  1. Log in to your para-virtualized guest.
  2. Edit /boot/grub/grub.conf as follows:
    Red Hat Enterprise Linux 5 i386 Xen (2.6.18-92.el5xen)
    	root (hd0, 0) kernel /boot/vmlinuz-2.6.18-92.el5xen ro root=LABEL=VG_i386 console=xvc0 
    	initrd /boot/initrd-2.6.18-92.el5xen.img
    
  3. Reboot the para-virtualized guest.
You should now get kernel messages on the virt-manager "Serial Console" and "virsh console".
Logging the para-virtualized domain serial console output

The Xen daemon(xend) can be configured to log the output from serial consoles of para-virtualized guests.

To configure xend edit /etc/sysconfig/xend. Change the entry:
# Log all guest console output (cf xm console)
#XENCONSOLED_LOG_GUESTS=no
to:
# Log all guest console output (cf xm console)
XENCONSOLED_LOG_GUESTS=yes
Reboot the host to activate logging the guest serial console output.
Logs from the guest serial consoles are stored in the /var/log/xen/console file.

35.11.3. Serial console output from fully virtualized guests

This section covers how to enable serial console output for fully virtualized guests.
Fully virtualized guest serial console output can be viewed with the "virsh console" command.
Be aware fully virtualized guest serial consoles have some limitations. Present limitations include:
  • logging output with xend is unavailable.
  • output data may be dropped or scrambled.
The serial port is called ttyS0 on Linux or COM1 on Windows.
You must configure the virtualized operating system to output information to the virtual serial port.
To output kernel information from a fully virtualized Linux guest into the domain modify the /boot/grub/grub.conf file by inserting the line "console=tty0 console=ttys0,115200".
title Red Hat Enterprise Linux Server (2.6.18-92.el5)
	root (hd0,0)
	kernel /vmlinuz-2.6.18-92.el5 ro root=/dev/volgroup00/logvol00
	console=tty0 console=ttys0,115200
	initrd /initrd-2.6.18-92.el5.img
Reboot the guest.
View the serial console messages using the "virsh console" command.

Important

Serial console messages from fully virtualized domains are not logged in /var/log/xen/console as they are for para-virtualized guests.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.