kvm serial console access

How to setup a serial console access to a libvirt based KVM machine?


/etc/init/ttyS0.conf:

# ttyS0 - getty
#
# This service maintains a getty on ttyS0 from the point the system is
# started until it is shut down again.

start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]

respawn
exec /sbin/getty -L 38400 ttyS0 vt102

grub:

GRUB_CMDLINE_LINUX="console=ttyS0,38400n8 console=tty0"

libvirt:

    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>

Now you can connect:

$ virsh console VM
avatar

About tompos

Hungary, Budapest
This entry was posted in Fedora, IT, Linux, RedHat, Ubuntu. Bookmark the permalink.

Leave a Reply