本文主要讲述的是通过vnc方式访问虚拟机不是在kvm虚拟机安装配置vnc,通过虚拟主机的IP地址与端口进行访问,kvm虚拟化对vnc的支持相对比较好,在虚拟主机上配置vnc访问虚拟机也是多提供一种方式访问虚拟机,以下是相关的配置步骤:
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