After creating the KVM guests, I can be able to access them via SSH, VNC client, Virt-viewer, Virt-manager and Cockpit web console etc. But I couldn't access them using virsh console command. For those wondering, the virsh console command is used to connect to the guest machine's console from the host system. After looking into the KVM documentation, I found that we should enable serial console in the KVM guest system in order to enable virsh console access for KVM guests.
I have a CentOS 8 virtual machine running in my Ubuntu 20.04 system.
$ virsh list Id Name State ------------------------- 1 centos8 running
I tried to access the console of CentOS 8 VM using the following command:
$ virsh console centos8
I got this this output:
Connected to domain centos8 Escape character is ^]
It says that I am connected to centos8 VM, but I don't see the VM's console. I can't get past this screen. It kept showing this blank screen until I manually exit it by pressing CTRL+] key. If you've ever been in this situation, just enable serial console service as described below.
Enable Virsh Console Access For KVM Guests
Like I already mentioned, you have to add a serial console in your guest machine in order to access its virsh console from the host system.
To do so, log in to your guest machine via SSH or Virt-manager or Cockpit and run the following commands to enable and start a serial console:
# systemctl enable [email protected]
# systemctl start [email protected]
Please note that the above commands should be run in KVM guest system (virtual machine), not in the KVM host.
That's it. We have enabled the serial console interface in the guest.
You can verify it by looking into the VM's configuration XML file:
$ virsh edit centos8
If serial console is enabled, you will see the following lines:
<serial type='pty'>
<target type='isa-serial' port='0'>
<model name='isa-serial'/>
</target>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console> Close the XML file and exit from the guest machine.
Now start the virsh console of the guest system from the host using command:
$ virsh console centos8
You will be greeted with this message:
Connected to domain centos8 Escape character is ^]
Press ENTER again and type your user name and password to connect to the guest machine:
You are now inside the guest machine's console. Start using it. You can switch back to the host console at any time by pressing "CTRL+]" keys.




4 comments
How can I enable the console on the guest VM?
Still I have no console access?
It is clearly mentioned in the article. Log in to your guest machine via SSH or Virt-manager or Cockpit and run the following commands to enable and start a serial console:
# systemctl enable [email protected]# systemctl start [email protected]Hi I am not able to launch Graphic console in remote viewer ..any solution for that …console is working now after above fix .
Is console works or not? I couldn’t understand your question.