1、 查询系统是否安装vnc-server
[root@localhost ~]# rpm –qa | grep vnc
如果有返回值,类似于vnc-server-的值,说明已经安装了vnc-server
2、 安装vnc-server
网上大都搜到的方法是输入
[root@localhost ~]# yum install tigervnc-server
但是在我们的环境中执行时却提示:No package tigervnc-server available.
所以只能采用另一种办法,就是先执行
[root@localhost ~]# yum search vnc
在返回结果中找到可用的包,再相应执行对应的包即可。
[root@localhost ~]# yum install vnc-server
3、 配置vnc-server的配置文件
输入
[root@localhost ~]# vi /etc/sysconfig/vncservers
内容如下:
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on display :2
# as my 'myusername' (adjust this to your own). You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, see
# <URL:http://www.uk.research.att.com/archive/vnc/sshvnc.html>.
# Use "-nolisten tcp&#