[Gllug] Virsh Console with KVM

Daniel P. Berrange dan at berrange.com
Thu Jul 22 13:06:04 UTC 2010

On Thu, Jul 22, 2010 at 01:43:43PM +0100, Stephen Nelson-Smith wrote:
> I seem to recall a high degree of expertise concerning libvirt and kvm
> on this list.  I wonder if I could have a spot of help?
> I'm trying to get virsh console to work with KVM, so I can have fast
> console access to my kvm guests.
> I'm using Debian Squeeze hosts and Debian Squeeze and Lenny guests.
> On the guest:
> In /etc/inittab I've added:
> T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100

On my RHEL5 guest that has serial setup I use

   S1:2345:respawn:/sbin/agetty /dev/ttyS0 9600

> ttyS0 is in /etc/securetty
> I've added:
> GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,9600n8 quiet"
> to /etc/default/grub

I don't know what that does on Debian, but on RHEL I directly
edit /etc/grub.conf and add to the 'kernel' line

  kernel /vmlinuz-2.6.18-186.el5 ro root=/dev/VolGroup00/LogVol00 console=tty console=ttyS0,9600n8

> On the host:
> When I connect to the host and run virsh console for the guest I've
> thus configured, I get mixed results:
> 1) Sometimes I can type a few characters, and then the console becomes
> unresponsive
> 2) Sometimes the console is entirely unresponsive
> 3) Once or twice it seems to 'just work'.

You don't mention at which point this happens.  Do you see the
normal kernel + sysv init boot messages OK ? ie does the problem
only start once the 'getty' is running. if so then try agetty
instead of getty

> PS One thing that occurs to me that may be relevant is that I am
> typically within screen session on my workstation when I connect to
> the host and issue the virsh commands.

So have you tried it without the screen session & seen if it works ?

|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: Digital signature
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20100722/5866eb10/attachment.pgp>
-------------- next part --------------
Gllug mailing list  -  Gllug at gllug.org.uk

More information about the GLLUG mailing list