RH6: libvirt and console

I have done this onRHEL6 and on Centos6

On the guest-os :

In this example I will make ttyS1 my terminal to connect my console to

Create the file [ /etc/init/ttyS1.conf ]

# tty – getty
#
# This service maintains a getty on the specified device.
#
# Do not edit this file directly. If you want to change the behaviour,
# please create a file tty.override and put your changes there.

start on runlevel [345]
stop on runlevel [S016]

respawn
instance /dev/ttyS1
exec /sbin/agetty ttyS1 19200 vt100-nav
usage ‘tty TTY=/dev/ttyX – where X is console id’

 

Edit the file [ /boot/grub/grub.conf ]

Add the following lines before the “hiddenmenu”

serial –unit=1 –speed=19200 –word=8 –parity=no –stop=1
terminal –timeout=5 serial console

Add to the latest kernel line the following :

console=tty0 console=ttyS1,19200n8

 

Edit the file [ /etc/securetty ]

Add at the end of the file the new console tty :

ttyS1

 

NOW REBOOT YOUR VM

 

After the reboot of the VM you can connect virsh to the new console :

# virsh
Welcome to virsh, the virtualization interactive terminal.

Type: ‘help’ for help with commands
‘quit’ to quit
virsh #

 

virsh # list
Id Name State
—————————————————-
1 server1 running
2 server2 running
3 server3 running

virsh #

 

virsh # console server1
Connected to domain server1
Escape character is ^] <PRESS ENTER>

CentOS release 6.7 (Final)
Kernel XXXXX on an x86_64

 

Leave a comment

Your email address will not be published.


*


Fix this before you comment on this post * Time limit is exhausted. Please reload the CAPTCHA.