通常情况下使用virsh console连接虚拟机会出现如下情况:
[root@host ~]# virsh console vm1
Connected to domain vm1
Escape character is ^]
笔者连接Ubuntu虚拟机时,尝试如下配置即可正常连接:
systemctl disable systemd-networkd-wait-online
systemctl enable serial-getty@ttyS0.service
systemctl start serial-getty@ttyS0.service
使用结束后通过CTRL+]
退出。