Virsh console hangs whenever I connect to Virtual Machine

kvm-virtualizationvirsh

Whenever I try to connect to VM using virsh console <vm name> my screen hangs and displays:

Connected to domain <vm name>
Escape character is ^]

I have found many solutions on the internet but nothing has worked for me and I am even not able to find the /etc/init directory as CentOS 7 has a different directory structure.

I need /etc/init directory to create a script which I found on the internet as a solution.

I am using only ssh connection and no GUI and I do not have any access to the physical machine.

Best Answer

Edit “/etc/sysconfig/grub” Add to end of GRUB_CMD_LINELINUX, “console=ttyS0”

example:

GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap crashkernel=auto rhgb quiet console=ttyS0"

Run the following commands as root:

stty -F /dev/ttyS0 speed 9600

grub2-mkconfig -o /boot/grub2/grub.cfg

systemctl start getty@ttyS0

Reboot the VM.

Try to run virsh console VMNAME

Related Topic