[root@localhost ~]#rpm -qa | grep -E "vnc|vnc-server"
2、如果没有安装,安装下
[root@localhost ~]#yum -y install vnc-server
3、修改配置文件
[root@localhost ~]#vim /etc/sysconfig/vncservers # VNCSERVERS="2:myusername" VNCSERVERS="2:root" # VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost" VNCSERVERARGS[2]="-geometry 1024x768"
4、设置vnc密码
[root@localhost ~]#vncpasswd
5、启动vnc服务
[root@localhost ~]#service vncserver start
6、修改xstartup配置文件
[root@localhost ~]#vi ./.vnc/xstartup xsetroot -solid grey vncconfig -iconic xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" gnome-session #startkde #kde desktop #twm &
7、重启vnc服务,查看监听端口。在防火墙允许端口,或者关闭防火墙
[root@localhost ~]#service vncserver restart [root@localhost ~]#netstat -anptu |grep vnc [root@localhost ~]#netstat -anptu |grep vnctcp 0 0 0.0.0.0:5902 0.0.0.0:* LISTEN 7303/Xvnc tcp 0 0 0.0.0.0:6002 0.0.0.0:* LISTEN 7303/Xvnc tcp 0 0 :::6002 :::* LISTEN 7303/Xvnc
8:vnc viwer工具远程服务器
IP地址:2
原文地址:http://blog.51cto.com/net881004/2054661