[libvirt-users] virsh console logging and pty usage

Is it possible to both log the serial console and to actually use it? A few of the VMs I've got are configured as follows: <serial type='file'> <source path='/var/log/libvirt/qemu/serial/bb-2.6.18-128.el5-x86_64.log'/> <target port='0'/> </serial> <console type='file'> <source path='/var/log/libvirt/qemu/serial/bb-2.6.18-128.el5-x86_64.log'/> <target type='serial' port='0'/> </console> Because people are hoping to capture the logs after the fact to see if there was any console output which could help them debug an issue. However, if you need to connect to the console of the VM its impossible (e.g. it needs the root password for a fsck). Any suggestions to allow logging but allow it to be usable via "virsh console" as well? Thanks. -- Doug Goldstein

Hi Doug, Replace your console type from 'file' to 'pty' it looks like this: <serial type='pty'> <target port='0'/> </serial> <console type='pty'> <target port='0'/> </console> And then append the parameter "console=ttyS0,115200" to guest kernel cmdline and reboot your guest, to use virsh console to connect your guest again. For details, please refer to the following link: http://libvirt.org/formatdomain.html#elementsConsole Good Luck! Alex ----- Original Message ----- From: "Doug Goldstein" <cardoe@gentoo.org> To: libvirt-users@redhat.com Sent: Wednesday, May 9, 2012 6:03:57 AM Subject: [libvirt-users] virsh console logging and pty usage Is it possible to both log the serial console and to actually use it? A few of the VMs I've got are configured as follows: <serial type='file'> <source path='/var/log/libvirt/qemu/serial/bb-2.6.18-128.el5-x86_64.log'/> <target port='0'/> </serial> <console type='file'> <source path='/var/log/libvirt/qemu/serial/bb-2.6.18-128.el5-x86_64.log'/> <target type='serial' port='0'/> </console> Because people are hoping to capture the logs after the fact to see if there was any console output which could help them debug an issue. However, if you need to connect to the console of the VM its impossible (e.g. it needs the root password for a fsck). Any suggestions to allow logging but allow it to be usable via "virsh console" as well? Thanks. -- Doug Goldstein _______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users

On Tue, May 8, 2012 at 9:43 PM, Alex Jia <ajia@redhat.com> wrote:
Hi Doug,
Replace your console type from 'file' to 'pty' it looks like this: <serial type='pty'> <target port='0'/> </serial> <console type='pty'> <target port='0'/> </console>
And then append the parameter "console=ttyS0,115200" to guest kernel cmdline and reboot your guest, to use virsh console to connect your guest again.
For details, please refer to the following link: http://libvirt.org/formatdomain.html#elementsConsole
Good Luck! Alex
Alex, I was actually looking to use the logging functionality that I had configured, while still having a tty available to connect through via virsh console. Basically does libvirt have the ability to multiplex the output from qemu's serial port in any way? -- Doug Goldstein

On Wed, May 09, 2012 at 11:39:10AM -0500, Doug Goldstein wrote:
On Tue, May 8, 2012 at 9:43 PM, Alex Jia <ajia@redhat.com> wrote:
Hi Doug,
Replace your console type from 'file' to 'pty' it looks like this: <serial type='pty'> <target port='0'/> </serial> <console type='pty'> <target port='0'/> </console>
And then append the parameter "console=ttyS0,115200" to guest kernel cmdline and reboot your guest, to use virsh console to connect your guest again.
For details, please refer to the following link: http://libvirt.org/formatdomain.html#elementsConsole
Good Luck! Alex
Alex,
I was actually looking to use the logging functionality that I had configured, while still having a tty available to connect through via virsh console. Basically does libvirt have the ability to multiplex the output from qemu's serial port in any way?
FWIW, I've heard of people using conserver to solve this problem. Dave
-- Doug Goldstein
_______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users
participants (3)
-
Alex Jia
-
Dave Allan
-
Doug Goldstein