virsh console连接虚拟机遇到的问题


系统:CentOS 7.6

1、在使用 virsh console 命令连接虚拟机的时候,发现无法连接而报以下错误

 

经过测试以后发现,用xml文件创建的虚拟机,均会存在此问题

解决方案:

 

 https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/virtualization_host_configuration_and_guest_installation_guide/app_domain_console

 

2、使用virsh console连接到非使用xml文件创建的虚拟机时,会卡在这里(使用ctrl + ] 退出)

[root@zhimao ~]# virsh console centos7-3 
连接到域 centos7-3
换码符为 ^]

需要在客户机上执行以下操作(让ttyS0允许登录系统)

[root@centos7-3 ~]# echo "ttyS0" >> /etc/securetty 
[root@centos7-3 ~]# grubby --update-kernel=ALL --args="console=ttyS0" # 更新内核参数
[root@centos7-3 ~]# reboot

重新连接

[root@zhimao ~]# virsh console centos7-3 
连接到域 centos7-3
换码符为 ^]          //回车一下

[root@centos7-3 ~]#         //成功连接

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM