KVM虚拟化笔记(七)------kvm虚拟机VNC的配置
? 本文主要講述的是通過(guò)vnc方式訪問(wèn)虛擬機(jī)不是在kvm虛擬機(jī)安裝配置vnc,通過(guò)虛擬主機(jī)的IP地址與端口進(jìn)行訪問(wèn),kvm虛擬化對(duì)vnc的支持相對(duì)比較好,在虛擬主機(jī)上配置vnc訪問(wèn)虛擬機(jī)也是多提供一種方式訪問(wèn)虛擬機(jī),以下是相關(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說(shuō)明1:vnclisten默認(rèn)綁定127.0.0.1?在配置文件里指定VNC?綁定0.0.0.0IP,就不用在安裝kvm虛擬機(jī)時(shí)指定vnclisten參數(shù)了。
說(shuō)明2:在虛擬主機(jī)上有很多個(gè)虛擬機(jī)的時(shí)候,需要指定每個(gè)虛擬機(jī)的端口。
2,修改虛擬機(jī)的配置文件添加如下配置:
<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)的端口號(hào)。
3,啟動(dòng)并測(cè)試VNC,查看VNC端口
[root@KVM?qemu]#?netstat?-lntp?|grep?59*使用vnc進(jìn)行登錄
最后使用vnc登錄的效果如下圖:
備注:第一次在使用vnc訪問(wèn)虛擬機(jī)的時(shí)候會(huì)出現(xiàn)一閃就不見(jiàn)了的問(wèn)題?具體的解決方法如下:
依次打開(kāi)vnc客戶端--->依次點(diǎn)擊option--->Advanced--->Expert--->找到ColourLevel,默認(rèn)的值是pal8,修改為rgb222或full.,見(jiàn)下圖一圖二:1,2,3
轉(zhuǎn)載于:https://blog.51cto.com/liqingbiao/1741103
總結(jié)
以上是生活随笔為你收集整理的KVM虚拟化笔记(七)------kvm虚拟机VNC的配置的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: centos7;windows下安装和使
- 下一篇: 幼稚的反义词