1

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.

Richard Slater
  • 6,313
  • 4
  • 53
  • 81
sachin
  • 76
  • 1
  • 7
  • Welcome to StackOverflow, I have tidied up your post as it was difficult to understand exactly what you are asking, however I think you would be better placed to ask this question on our sister site [Server Fault](http://serverfault.com/) please have a read of ["How to ask a good question"](http://serverfault.com/help/how-to-ask) to get the best from the community. – Richard Slater May 06 '16 at 20:46

2 Answers2

0

I think you should start a console (e.g. ttyS0 ). For example on my Debian 8 I enable it with systemd:

systemctl enable getty@tty1.service

Enable Serial Console on CentOS/RHEL 7

On the virtual machine, add ‘console=ttyS0‘ at the end of the kernel lines in the /boot/grub2/grub.cfg file:

grubby --update-kernel=ALL --args="console=ttyS0"

Note: Alternatively, you can edit the /etc/default/grub file, add console=ttyS0 to the GRUB_CMDLINE_LINUX variable and execute

grub2-mkconfig -o /boot/grub2/grub.cfg
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial –speed115200 –unit=0 –word=8 –parity=no –stop=1"
Valeriy Solovyov
  • 5,384
  • 3
  • 27
  • 45
0

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 issue.

user105279
  • 56
  • 5