KVM Console Access

  • So you can always access the console for a VM via Virt-Manager. But if you want to access the console from the hypervisor itself, it's fairly easy.

    Using a CentOS 7 VM, you just need to append console=tty0 console=ttyS0,115200 to the kernel line in your grub config.

    grubby --update-kernel $(grubby --default-kernel) --args="console=tty0 console=ttyS0,115200"

    Reboot the VM, and type

    virsh console <Domain>

    You may run into an issue with libvirt telling you the console is already being accessed. Just restart libvirt with systemctl restart libvirtd and you will be able to pull up the console.

    [[email protected] jhooks]# virsh console Bind
    Connected to domain Bind
    Escape character is ^]
    Last login: Mon May  2 19:07:58 on ttyS0
    [[email protected] ~]$

    As the output says, to escape the console type ctrl+].

  • thanks!