在centos系统未安装桌面的环境下,安装虚拟机操作系统,可以通过vnc来远程连接
vnc 下载地址:www.realvnc.com/en/connect/…
防火墙打开VNC端口
[root@host1 ~]# firewall-cmd --get-active-zones
public
interfaces: enp2s0 br0
[root@host1 ~]# firewall-cmd --zone=public --list-ports
[root@host1 ~]# firewall-cmd --permanent --zone=public --add-port=5900-6300/tcp
success
[root@host1 ~]# firewall-cmd --zone=public --list-ports
[root@host1 ~]# firewall-cmd --reload
success
[root@host1 ~]# firewall-cmd --zone=public --list-ports
6033/tcp
配置VNC
1、网络安装的centos7-init-server没有添加VNC访问方式,配置如下
virsh edit centos7-init-server
插入如下配置:
<graphics type='vnc' port='5910' autoport='no' listen='0.0.0.0'>
<listen type='address' address='0.0.0.0'/>
</graphics>
port='5910' autoport='no'
2、重新加载并重启 centos7-init-server
virsh define /etc/libvirt/qemu/centos7-init-server.xml
virsh reboot centos7-init-server
3、查看TCP端口
netstat -lntp|grep 5910
tcp 0 0 0.0.0.0:5910 0.0.0.0:* LISTEN 65031/qemu-kvm