If you don’t know the kpartx command, you miss something!
If you regularly play with virtual machines under KVM, you know that sometimes things go wrong.
A change in the /etc/fstab file or in the ssh configuration and you are in trouble, you can no longer access your virtual machine because you hadn’t set any virtual console: you need to reinstall it and it’s not fun!
But there is a solution! I call it emergency procedure.
This solution consists in stopping your virtual machine with the destroy command, then map your virtual machine image file in your physical host environment with the kpartx command. Mount the /boot partition and edit your /boot/grub2/grub.cfg file, adding the console=ttyS0 string at the end of every kernel boot line.
Finally, unmount the /boot partition, unmap your virtual machine image and reboot your virtual machine: from now on, you’ve got your virtual console!
This tip works at least for RHEL 6/CentOS 6 and RHEL 7/CentOS 7.
To get all the details, go to the RHEL 7 virtual console page.