一、软件简介
VNC是Virtual Network Computer的缩写,意思是“虚拟网络计算机”,它是运行在UNIX和Linux上虚拟化桌面连接工具,有vncserver和vncviewer两部各部组成,这边下载的vncviewer的客户端软件工具,在运行连接之前,必须先在服务器操作系统上线安装vncserver软件版本。
二、软件截图
三、License KeyWHJRK-UXY7V-Q34M9-CZU8L-8KGFA@b@S4J7A-XWXY5-KXAJW-54KRA-TP3QA@b@48R4P-NFZ46-NBCWY-Q2ZJT-3H9RA@b@NGNW9-7Q8BK-UQGY7-J3KAA-6G39@b@Z456C-LMKTC-NLGWQ-H5CUR-ZVWEA@b@A5HDP-LXKYN-UK4W6-XACZJ-ENWLA@b@NRDX9-ZF9C5-JLGY7-CUC5J-77J2A@b@579R9-9B92W-4QHM9-6TK6D-H6F9A@b@VETPD-HHC3S-63AH9-YAA26-8WVDA@b@SSEWK-HBDM6-YYCWC-M3BQV-9XMDA@b@LFKRU-DCTWH-6GJH2-7SWYR-D4CPA@b@CQUTS-S5RDR-VT2WJ-9B6TU-DLHPA@b@RR36V-7V29A-EVGJA-AYNEC-3DZYA@b@UNLZ3-EHBVR-VACLK-S8QDH-JZMHA@b@TPSNG-YEUGX-J4HZX-DPYSY-HZKXA@b@UCUXY-TAFLN-YFBVV-D7VZE-9SHJA@b@ANN2U-FM59S-DAGV4-4TK96-BDTKA@b@F4X7H-CYLEV-XZ4ZW-USQ7D-KHMGA@b@63P3S-TGU8R-3C4ZE-WCKF4-S2W3A@b@Q35YW-ZVH7L-Z94J4-9UJP9-77VFA@b@3TH6P-DV5AE-BLHY6-PNENS-B3AQA
四、vncserver安装脚本
0. vnc服务查看和启动 ,yum install tigervnc-server查看是否安装VNC服务 ,如下所示[root@GP-1-S1 ~]# yum install tigervnc-server@b@已加载插件:fastestmirror, refresh-packagekit, security@b@设置安装进程@b@base | 3.7 kB 00:00 @b@base/primary_db | 4.7 MB 00:04 @b@extras | 3.4 kB 00:00 @b@extras/primary_db | 37 kB 00:00 @b@updates | 3.4 kB 00:00 @b@updates/primary_db | 4.3 MB 00:06 @b@解决依赖关系@b@–> 执行事务检查@b@—> Package tigervnc-server.x86_64 0:1.1.0-18.el6 will be 安装@b@–> 完成依赖关系计算@b@@b@依赖关系解决@b@@b@========================================================================================================================================@b@ 软件包 架构 版本 仓库 大小@b@========================================================================================================================================@b@正在安装:@b@ tigervnc-server x86_64 1.1.0-18.el6 base 1.0 M@b@@b@事务概要@b@========================================================================================================================================@b@Install 1 Packages)@b@@b@总下载量:1.0 M@b@Installed size: 2.6 M@b@确定吗?[y/N]:y@b@下载软件包:@b@tigervnc-server-1.1.0-18.el6.x86_64.rpm | 1.0 MB 00:01 @b@warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY@b@Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6@b@Importing GPG key 0xC105B9DE:@b@ Userid : CentOS-6 Key CentOS 6 Official Signing Key) @b@ Package: centos-release-6-7.el6.centos.12.3.x86_64 @anaconda-CentOS-201508042137.x86_64/6.7)@b@ From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6@b@确定吗?[y/N]:y@b@运行 rpm_check_debug @b@执行事务测试@b@事务测试成功@b@执行事务@b@Warning: RPMDB altered outside of yum.@b@ 正在安装 : tigervnc-server-1.1.0-18.el6.x86_64 1/1 @b@ Verifying : tigervnc-server-1.1.0-18.el6.x86_64 1/1 @b@@b@已安装:@b@ tigervnc-server.x86_64 0:1.1.0-18.el6 @b@@b@完毕!
1,启动VNCSERVER,第一次启动VNCSERVER会提示输入密码,这里分为管理员账户及普通账户,启动方式略有所不同。
管理员:
[root@localhost /]# vncserver
You will require a password to access your desktops.
Password: 123456 #输入vnc 连接密码
Verify: 123456 #确认vnc密码
xauth: creating new authority file /root/.Xauthority
New ‘localhost.localdomain:1 root)’ desktop is localhost.localdomain:1
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/localhost.localdomain:1.log
普通用户:
[root@localhost /]#su ceboy #ceboy 是用户名
[ceboy@localhost /]$ vncserver
You will require a password to access your desktops.
Password: 123456 #输入vnc 连接密码
Verify: 123456 #确认vnc密码
xauth: creating new authority file /home/ceboy/.Xauthority
New ‘localhost.localdomain:2 ceboy)’ desktop is localhost.localdomain:2
Creating default startup script /home/ceboy/.vnc/xstartup
Starting applications specified in /home/ceboy/.vnc/xstartup
Log file is /home/ceboy/.vnc/localhost.localdomain:2.log
2.执行 vncpasswd命令设置root用户的vnc口令,如果是要允许其他用户登录,需要su 切换用户后在执行 。
3.修改配置文件/etc/sysconfig/vncservers
添加一行
VNCSERVERS="1:root"
保存退出
4.执行service vncserver start启动服务
5.想要系统下次启动是运行vncserver
执行chkconfig vncserver on 就可以了
B.VNC软件安装步骤
1. tar -xzvf vnc-3.3.7-x86_linux/
2. 如果使用gnome桌面加载
cat /root/.vnc/xstartup
#twm & //将此行注册
gnome-session& //添加此行内容
3.vncpasswd
4.vncserverh
C.Redhat下VNC SERVER的配置
1、启动VNC SERVER
输入vncserver,第一次启动会要求输入验证密码,完成后,VNC SERVER就启动了
[root@localhost ~]# vncserver
You will require a password to access your desktops.
Password: //输入密码
Verify: //再次输入密码
xauth: creating new authority file /root/.Xauthority
New ‘localhost.localdomain:1 root)’ desktop is localhost.localdomain:1
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/localhost.localdomain:1.log
[root@localhost ~]#
2、编辑.vnc/xstartup
使用VI打开xstartup文件,如下:
[root@localhost /]# cd /root/.vnc
[root@localhost .vnc]# vi xstartup
删除全部内容,然后添加如下内容:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
3、重启动VNC SERVER
[root@localhost ~]# vncserver -kill :1
Killing Xvnc process ID 21198
[root@localhost ~]# vncserver
New ‘localhost.localdomain:1 root)’ desktop is localhost.localdomain:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/localhost.localdomain:1.log
[root@localhost ~]#
4、查看VNC的监听端口
如下,VNC用到了三个端口:5801、5901、6001。
[root@localhost /]# netstat -nat
Active Internet connections servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:5801 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:6001 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:724 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:2207 0.0.0.0:* LISTEN
tcp 0 0 172.200.102.3:5901 181.181.181.51:1669 ESTABLISHED
tcp 0 0 :::6001 :::* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 0 1364 ::ffff:172.200.102.3:22 ::ffff:181.181.181.51:1599 ESTABLISHED
[root@localhost /]#
5、在防火墙上打开VNC用到的上面三个端口
[root@localhost /]# cd /etc/sysconfig
[root@localhost sysconfig]# vi iptables
添加如下三行:
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 5801 -j ACCEPT
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 5901 -j ACCEPT
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 6001 -j ACCEPT
重记动IPTABLES
[root@localhost sysconfig]# /etc/rc.d/init.d/iptables restart
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: filter [ OK ]
Unloading iptables modules: [ OK ]
Applying iptables firewall rules: [ OK ]
Loading additional iptables modules: ip_conntrack_netbios_ns ip_conntrack_ftp [ OK ]
[root@localhost sysconfig]#
6、使用VNC VIEW连接VNC SERVER
下载VNC VIEW,运行,然后输入IP:端口号,输入刚才设定的密码,进入REDHAT桌面。
五、相关下载
VNC-Server-5.0.5-Linux-x64.rpm版本云盘下载,本地下载
VNC-Viewer-5.0.5-Linux-x64.rpm版本云盘下载
vnc-server-4.1.2-30.fc9.i386.rpm版本云盘下载
vnc-E4_6_3-x86_linux.tar.gz版本下载
vnc-E4_5-x86_linux.rpm版本下载