[libvirt] specifying -serial telnet: in XML

I run qemu (version 0.9.1 kvm-84) with -serial option as follows: - serial telnet::2445,server so I can telnet to 2445 and have a serial console. I tried specifying this to libvirt (version 0.6.0) using the following stanza: <serial type='tcp'> <source mode="bind" host="127.0.0.1" service="2445"/> <protocol type="telnet"/> <target port="1"/> </serial> I checked /var/log/libvirt/qemu/<guest>.log and found that libvirt added 'nowait' to the serial option: -serial telnet:127.0.0.1:2445,server,nowait which is fine (I think). But when I start my guest, and "telnet 127.0.0.1 2445" I don't get any output even though the guest boots up fine. After the guest boots $ echo foo > /dev/ttyS0 in the guest shows the 'foo' in the telnet window. But I don't get the boot/shutdown messages. I also have the vnc option in the xml, <graphics type='vnc' port='5902' autoport='no' listen='127.0.0.1'/> so if I open vncviewer, I can see the boot messages. The problem with this though is if the kernel fails to boot for some reason, the vncviewer exits and I can't find the reason the boot failed. My kernel boot command line has 'console=ttyS0' option. Is there anything else I need to ensure 'telnet 127.0.0.1 port' displays the messages ? Thanks, Sukadev

On Wed, Apr 01, 2009 at 10:13:53PM -0700, Sukadev Bhattiprolu wrote:
I run qemu (version 0.9.1 kvm-84) with -serial option as follows:
- serial telnet::2445,server
so I can telnet to 2445 and have a serial console.
I tried specifying this to libvirt (version 0.6.0) using the following stanza:
<serial type='tcp'> <source mode="bind" host="127.0.0.1" service="2445"/> <protocol type="telnet"/> <target port="1"/> </serial>
I checked /var/log/libvirt/qemu/<guest>.log and found that libvirt added 'nowait' to the serial option:
-serial telnet:127.0.0.1:2445,server,nowait
which is fine (I think).
But when I start my guest, and "telnet 127.0.0.1 2445" I don't get any output even though the guest boots up fine. After the guest boots
$ echo foo > /dev/ttyS0
in the guest shows the 'foo' in the telnet window. But I don't get the boot/shutdown messages.
I also have the vnc option in the xml,
<graphics type='vnc' port='5902' autoport='no' listen='127.0.0.1'/>
so if I open vncviewer, I can see the boot messages. The problem with this though is if the kernel fails to boot for some reason, the vncviewer exits and I can't find the reason the boot failed.
My kernel boot command line has 'console=ttyS0' option. Is there anything else I need to ensure 'telnet 127.0.0.1 port' displays the messages ?
That setting should be what's required to make serial console work. Are you sure you've got it set in the correct place of grub.conf for the guest OS ? I have my guests configured using: "console=ttyS0 console=tty" whch makes messages go to the serial port and graphical console Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

| > My kernel boot command line has 'console=ttyS0' option. Is there anything | > else I need to ensure 'telnet 127.0.0.1 port' displays the messages ? | | That setting should be what's required to make serial console work. Are | you sure you've got it set in the correct place of grub.conf for the | guest OS ? I have my guests configured using: | | "console=ttyS0 console=tty" | | whch makes messages go to the serial port and graphical console I am not using the grub.conf file in the guest. Instead, I am specifying the "console=ttyS0" with the <cmdline> tag <os> <type>hvm</type> <kernel>/home/suka/virtmcs/kernels/vmlinuz-ckpt</kernel> <initrd>/home/suka/virtmcs/kernels/initrd-ckpt.img</initrd> <cmdline>"ro debug root=/dev/sda1 console=ttyS0"</cmdline> <boot dev='hd'/> </os> I have the <console> stanza as: <console type='pty' tty='/dev/pts/3'> <source path='/dev/pts/3'/> <target port='0'/> </console> With this,if I add "console=tty" to the <cmdline> line, <cmdline>"ro debug root=/dev/sda1 console=ttyS0 console=tty"</cmdline> or "console=tty0" <cmdline>"ro debug root=/dev/sda1 console=ttyS0 console=tty0"</cmdline> the guest exits a few seconds after "virsh start". I don't see any useful messages in /var/log/libvirt/qemu/guest.log of /var/log/messages. If I remove the "console=tty" i.e go back to <os> stanza above, the guest boots fine and I can use the vnc (graphic console) but I don't see any messages on serial console. Thanks, Sukadev
participants (2)
-
Daniel P. Berrange
-
Sukadev Bhattiprolu