KVM虚拟化笔记(七)------kvm虚拟机VNC的配置
? 本文主要講述的是通過vnc方式訪問虛擬機不是在kvm虛擬機安裝配置vnc,通過虛擬主機的IP地址與端口進行訪問,kvm虛擬化對vnc的支持相對比較好,在虛擬主機上配置vnc訪問虛擬機也是多提供一種方式訪問虛擬機,以下是相關(guān)的配置步驟:
1,修改qemu.conf配置文件
[root@KVM?qemu]#?vi?/etc/libvirt/qemu.conf? #?Master?configuration?file?for?the?QEMU?driver. #?All?settings?described?here?are?optional?-?if?omitted,?sensible #?defaults?are?used. #?VNC?is?configured?to?listen?on?127.0.0.1?by?default. #?To?make?it?listen?on?all?public?interfaces,?uncomment #?this?next?option. # #?NB,?strong?recommendation?to?enable?TLS?+?x509?certificate #?verification?when?allowing?public?access # vnc_listen?=?"0.0.0.0" #?Enable?this?option?to?have?VNC?served?over?an?automatically?created #?unix?socket.?This?prevents?unprivileged?access?from?users?on?the #?host?machine,?though?most?VNC?clients?do?not?support?it. # #?This?will?only?be?enabled?for?VNC?configurations?that?do?not?have #?a?hardcoded?'listen'?or?'socket'?value.?This?setting?takes?preference #?over?vnc_listen. # #vnc_auto_unix_socket?=?1 #?Enable?use?of?TLS?encryption?on?the?VNC?server.?This?requires #?a?VNC?client?which?supports?the?VeNCrypt?protocol?extension. #?Examples?include?vinagre,?virt-viewer,?virt-manager?and?vencrypt #?itself.?UltraVNC,?RealVNC,?TightVNC?do?not?support?this # #?It?is?necessary?to?setup?CA?and?issue?a?server?certificate #?before?enabling?this. # #vnc_tls?=?1說明1:vnclisten默認綁定127.0.0.1?在配置文件里指定VNC?綁定0.0.0.0IP,就不用在安裝kvm虛擬機時指定vnclisten參數(shù)了。
說明2:在虛擬主機上有很多個虛擬機的時候,需要指定每個虛擬機的端口。
2,修改虛擬機的配置文件添加如下配置:
<graphics?type='vnc'?port='5913'?autoport='no'?listen='0.0.0.0'>???????
??<listen?type='address'?address='0.0.0.0'/>????????
</graphics>
[root@KVM qemu]# virsh edit hadoop3
注意修改相應(yīng)的端口號。
3,啟動并測試VNC,查看VNC端口
[root@KVM?qemu]#?netstat?-lntp?|grep?59*使用vnc進行登錄
最后使用vnc登錄的效果如下圖:
備注:第一次在使用vnc訪問虛擬機的時候會出現(xiàn)一閃就不見了的問題?具體的解決方法如下:
依次打開vnc客戶端--->依次點擊option--->Advanced--->Expert--->找到ColourLevel,默認的值是pal8,修改為rgb222或full.,見下圖一圖二:1,2,3
轉(zhuǎn)載于:https://blog.51cto.com/liqingbiao/1741103
總結(jié)
以上是生活随笔為你收集整理的KVM虚拟化笔记(七)------kvm虚拟机VNC的配置的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: centos7;windows下安装和使
- 下一篇: eclipse中Preferences的