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

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.