vnc老是链接不了kvm虚拟机问题解决报The connection closed unexpectedly.windows
没有为这个kvm虚拟机配置vnc端口,能够本身在*.xml文件中添加
A.virsh edit centos7.0
<graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'>
<listen type='address' address='0.0.0.0'/>
</graphics>centos
B.重启kvm虚拟机,因为是autoport自动分配的端口,因此须要查询下
virsh vncdisplay centos7.0
:0
因为是5900起步的,因此这里是显示0,对应着5900,也能够直接用virsh dumpxml centos7.0这样查更加直观一些。服务器
C.查到端口以后能够用vncviewer去链接,(若是在服务器上已经开了个链接,那么在windows上去用这个vncviewer去链接会失败,这个问题查了一段时间)ide