RHEL6 virsh console domain

To use the #virsh console command on a RHEL6 Virtual Server you need to configure the guests. If you do not configure them, this

Escape character is ^] Is all you get.

For RHEL6  clients you have to configure 2 files:

  1. /boot/grub/menu.lst

add the modification in bold:
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
serial –unit=0 –speed=115200
terminal –timeout=10 console serial

hiddenmenu
title Red Hat Enterprise Linux (2.6.32-71.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-71.el6.x86_64 ro root=/dev/mapper/vg_testhost-lv_root console=tty0 console=ttyS0,115200n8 rd_LVM_LV=vg_testhost/lv_root rd_LVM_LV=vg_testhost/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet
initrd /initramfs-2.6.32-71.el6.x86_64.img

  1. and /etc/inittab

S0:2345:respawn:/sbin/agetty ttyS0 115200 linux

your done 🙂 reboot the box.

11 thoughts on “RHEL6 virsh console domain

  • you should be able to use virt-install with extra options

    –extra-args “console=tty0 console=ttyS0,115200n8”

  • Hi,
    I have a rhel 6 VM running on rhel 5.6 XEN hypervisor in paravirtualized mode.
    I am able to ssh to it, but console does not work.

    Any ideas?

    -Alok

  • In RHEL6 you should leave /etc/inittab untouched and put this in /etc/init/ttyS0.conf instead.

    # ttyS0 – agetty
    #
    # This service maintains a agetty on ttyS0.
    #
    stop on runlevel [S016]
    start on runlevel [23]
    #
    respawn
    exec agetty -h -L -w /dev/ttyS0 115200 vt102

  • I have used this in CentOS6.3
    but there is no point editing grub.conf and inittab file and even no use of edit them.
    Console can connect with adding
    after your complete virt-install command.
    Can you please mentioned complete case in which only editing of these files will work for “virsh console vm_name”

  • I have used this in CentOS6.3
    but there is no point editing grub.conf and inittab file and even no use of edit them.
    Console can connect with adding
    –extra-args=’console=tty0 console=ttyS0,115200n8 serial’
    after your complete virt-install command.
    Can you please mentioned complete case in which only editing of these files will work for “virsh console vm_name”

    • Hi,

      In rhel 6.3 you’ll need to use /etc/init/ttyS0.conf instead as Marcus suggested.

      # ttyS0 – agetty
      #
      # This service maintains a agetty on ttyS0.
      #
      stop on runlevel [S016]
      start on runlevel [23]
      #
      respawn
      exec agetty -h -L -w /dev/ttyS0 115200 vt102

  • If the instructions provided doesn’t work, try to run the following in VM:

    cat /var/log/dmesg | grep 'console \['

    If you see something like this:
    console [tty0] enabled
    console [hvc0] enabled

    then replace ttyS0 with hvc0 everywhere above.

    Enjoy!

Leave a Reply

Your email address will not be published. Required fields are marked *

*


Hit Counter provided by laptop reviews