2

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.

sachin
  • 21
  • 1
  • 1
  • 4

3 Answers3

2

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

dyasny
  • 18,802
  • 6
  • 49
  • 64
  • Thanks! I tried with `speed 115200` and it worked fine also. I'm not sure if in the KVM realm the serial bit-rate has any meaning. – ndemou Dec 18 '17 at 19:53
1

I had the same issue right after virt-install, then after trying to connect to the guest, too. I tried all the suggested solutions but none of them helped. Then I realized that I forgot to install KVM. A simple 'yum -y install kvm' resolved the whole issue.

user105279
  • 11
  • 1
0

This also might be corrupted installation. Just faced that problem yesterday. The domain is existing, virsh shows that it is running, but in fact installation is not finished and it hangs up. Read more carefully messages during the installation process.