centos配置安装vnc

前端之家收集整理的这篇文章主要介绍了centos配置安装vnc前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1、本次配置源于网络yum源,配置安装之前,请确保网络yum源安装配置正确。

参考:

http://blog.csdn.net/kadwf123/article/details/78231694

2、安装vnc服务包,如果yum源选择的aliyun下一步没有成功,请换成网易源,本例使用网易源

  1. [root@MYDNS yum.repos.d]# yum -y install tigervnc-server
  2. Loaded plugins: fastestmirror,security
  3. Loading mirror speeds from cached hostfile
  4. Setting up Install Process
  5. Resolving Dependencies
  6. --> Running transaction check
  7. ---> Package tigervnc-server.x86_64 0:1.1.0-24.el6 will be installed
  8. --> Processing Dependency: pixman >= 0.27.2 for package: tigervnc-server-1.1.0-24.el6.x86_64
  9. --> Processing Dependency: libX11 >= 1.6.0 for package: tigervnc-server-1.1.0-24.el6.x86_64
  10. --> Processing Dependency: xorg-x11-xkb-utils for package: tigervnc-server-1.1.0-24.el6.x86_64
  11. --> Processing Dependency: xorg-x11-fonts-misc for package: tigervnc-server-1.1.0-24.el6.x86_64
  12. --> Processing Dependency: xkeyboard-config for package: tigervnc-server-1.1.0-24.el6.x86_64
  13. --> Processing Dependency: libxshmfence.so.1()(64bit) for package: tigervnc-server-1.1.0-24.el6.x86_64
  14. --> Processing Dependency: libXdmcp.so.6()(64bit) for package: tigervnc-server-1.1.0-24.el6.x86_64
  15. --> Running transaction check
  16. ---> Package libX11.x86_64 0:1.5.0-4.el6 will be updated
  17. ---> Package libX11.x86_64 0:1.6.4-3.el6 will be an update
  18. --> Processing Dependency: libX11-common = 1.6.4-3.el6 for package: libX11-1.6.4-3.el6.x86_64
  19. ---> Package libXdmcp.x86_64 0:1.1.1-3.el6 will be installed
  20. ---> Package libxshmfence.x86_64 0:1.2-1.el6 will be installed
  21. ---> Package pixman.x86_64 0:0.26.2-4.el6 will be updated
  22. ---> Package pixman.x86_64 0:0.32.8-1.el6 will be an update
  23. ---> Package xkeyboard-config.noarch 0:2.16-1.el6 will be installed
  24. ---> Package xorg-x11-fonts-misc.noarch 0:7.2-11.el6 will be installed
  25. ---> Package xorg-x11-xkb-utils.x86_64 0:7.7-12.el6 will be installed
  26. --> Processing Dependency: libxkbfile.so.1()(64bit) for package: xorg-x11-xkb-utils-7.7-12.el6.x86_64
  27. --> Running transaction check
  28. ---> Package libX11-common.noarch 0:1.5.0-4.el6 will be updated
  29. ---> Package libX11-common.noarch 0:1.6.4-3.el6 will be an update
  30. ---> Package libxkbfile.x86_64 0:1.0.6-1.1.el6 will be installed
  31. --> Processing Conflict: libX11-1.6.4-3.el6.x86_64 conflicts libxcb < 1.9.1-3
  32. --> Restarting Dependency Resolution with new changes.
  33. --> Running transaction check
  34. ---> Package libxcb.x86_64 0:1.8.1-1.el6 will be updated
  35. ---> Package libxcb.x86_64 0:1.12-4.el6 will be an update
  36. --> Finished Dependency Resolution
  37.  
  38. Dependencies Resolved
  39.  
  40. ================================================================================
  41. Package Arch Version Repository Size
  42. ================================================================================
  43. Installing:
  44. tigervnc-server x86_64 1.1.0-24.el6 base 1.0 M
  45. Updating:
  46. libxcb x86_64 1.12-4.el6 base 180 k
  47. Installing for dependencies:
  48. libXdmcp x86_64 1.1.1-3.el6 base 30 k
  49. libxkbfile x86_64 1.0.6-1.1.el6 base 74 k
  50. libxshmfence x86_64 1.2-1.el6 base 6.2 k
  51. xkeyboard-config noarch 2.16-1.el6 base 802 k
  52. xorg-x11-fonts-misc noarch 7.2-11.el6 base 5.8 M
  53. xorg-x11-xkb-utils x86_64 7.7-12.el6 base 98 k
  54. Updating for dependencies:
  55. libX11 x86_64 1.6.4-3.el6 base 587 k
  56. libX11-common noarch 1.6.4-3.el6 base 171 k
  57. pixman x86_64 0.32.8-1.el6 base 243 k
  58.  
  59. Transaction Summary
  60. ================================================================================
  61. Install 7 Package(s)
  62. Upgrade 4 Package(s)
  63.  
  64. Total download size: 9.0 M
  65. Downloading Packages:
  66. (1/11): libX11-1.6.4-3.el6.x86_64.rpm | 587 kB 00:00
  67. (2/11): libX11-common-1.6.4-3.el6.noarch.rpm | 171 kB 00:00
  68. (3/11): libXdmcp-1.1.1-3.el6.x86_64.rpm | 30 kB 00:00
  69. (4/11): libxcb-1.12-4.el6.x86_64.rpm | 180 kB 00:00
  70. (5/11): libxkbfile-1.0.6-1.1.el6.x86_64.rpm | 74 kB 00:00
  71. (6/11): libxshmfence-1.2-1.el6.x86_64.rpm | 6.2 kB 00:00
  72. (7/11): pixman-0.32.8-1.el6.x86_64.rpm | 243 kB 00:00
  73. (8/11): tigervnc-server-1.1.0-24.el6.x86_64.rpm | 1.0 MB 00:00
  74. (9/11): xkeyboard-config-2.16-1.el6.noarch.rpm | 802 kB 00:00
  75. (10/11): xorg-x11-fonts-misc-7.2-11.el6.noarch.rpm | 5.8 MB 00:02
  76. (11/11): xorg-x11-xkb-utils-7.7-12.el6.x86_64.rpm | 98 kB 00:00
  77. ------------------------------------------------------------------------------------------------------------------------------------
  78. Total 1.9 MB/s | 9.0 MB 00:04
  79. warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature,key ID c105b9de: NOKEY
  80. Retrieving key from http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
  81. Importing GPG key 0xC105B9DE:
  82. Userid: "CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>"
  83. From : http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
  84. Running rpm_check_debug
  85. Running Transaction Test
  86. Transaction Test Succeeded
  87. Running Transaction
  88. Installing : libxshmfence-1.2-1.el6.x86_64 1/15
  89. Installing : xkeyboard-config-2.16-1.el6.noarch 2/15
  90. Updating : libX11-common-1.6.4-3.el6.noarch 3/15
  91. Updating : libxcb-1.12-4.el6.x86_64 4/15
  92. Updating : libX11-1.6.4-3.el6.x86_64 5/15
  93. Installing : libxkbfile-1.0.6-1.1.el6.x86_64 6/15
  94. Installing : xorg-x11-xkb-utils-7.7-12.el6.x86_64 7/15
  95. Updating : pixman-0.32.8-1.el6.x86_64 8/15
  96. Installing : xorg-x11-fonts-misc-7.2-11.el6.noarch 9/15
  97. Installing : libXdmcp-1.1.1-3.el6.x86_64 10/15
  98. Installing : tigervnc-server-1.1.0-24.el6.x86_64 11/15
  99. Cleanup : libX11-1.5.0-4.el6.x86_64 12/15
  100. Cleanup : libX11-common-1.5.0-4.el6.noarch 13/15
  101. Cleanup : libxcb-1.8.1-1.el6.x86_64 14/15
  102. Cleanup : pixman-0.26.2-4.el6.x86_64 15/15
  103. Verifying : libXdmcp-1.1.1-3.el6.x86_64 1/15
  104. Verifying : libxkbfile-1.0.6-1.1.el6.x86_64 2/15
  105. Verifying : libX11-1.6.4-3.el6.x86_64 3/15
  106. Verifying : xorg-x11-fonts-misc-7.2-11.el6.noarch 4/15
  107. Verifying : pixman-0.32.8-1.el6.x86_64 5/15
  108. Verifying : libxcb-1.12-4.el6.x86_64 6/15
  109. Verifying : libX11-common-1.6.4-3.el6.noarch 7/15
  110. Verifying : xorg-x11-xkb-utils-7.7-12.el6.x86_64 8/15
  111. Verifying : xkeyboard-config-2.16-1.el6.noarch 9/15
  112. Verifying : libxshmfence-1.2-1.el6.x86_64 10/15
  113. Verifying : tigervnc-server-1.1.0-24.el6.x86_64 11/15
  114. Verifying : pixman-0.26.2-4.el6.x86_64 12/15
  115. Verifying : libX11-common-1.5.0-4.el6.noarch 13/15
  116. Verifying : libX11-1.5.0-4.el6.x86_64 14/15
  117. Verifying : libxcb-1.8.1-1.el6.x86_64 15/15
  118.  
  119. Installed:
  120. tigervnc-server.x86_64 0:1.1.0-24.el6
  121.  
  122. Dependency Installed:
  123. libXdmcp.x86_64 0:1.1.1-3.el6 libxkbfile.x86_64 0:1.0.6-1.1.el6 libxshmfence.x86_64 0:1.2-1.el6
  124. xkeyboard-config.noarch 0:2.16-1.el6 xorg-x11-fonts-misc.noarch 0:7.2-11.el6 xorg-x11-xkb-utils.x86_64 0:7.7-12.el6
  125.  
  126. Updated:
  127. libxcb.x86_64 0:1.12-4.el6
  128.  
  129. Dependency Updated:
  130. libX11.x86_64 0:1.6.4-3.el6 libX11-common.noarch 0:1.6.4-3.el6 pixman.x86_64 0:0.32.8-1.el6
  131.  
  132. Complete!
3、设置vnc服务开机自启动
  1. [root@MYDNS yum.repos.d]# chkconfig vncserver on

4、检查是否设置成功
  1. [root@MYDNS yum.repos.d]# chkconfig vncserver on
  2. [root@MYDNS yum.repos.d]# chkconfig --list |grep vnc
  3. vncserver 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭

5、启动vncserver:
  1. [root@MYDNS yum.repos.d]# vncserver :1
  2.  
  3. You will require a password to access your desktops.
  4.  
  5. Password:
  6. Verify:
  7. xauth: creating new authority file /root/.Xauthority
  8. xauth: (stdin):1: bad display name "MYDNS:1" in "add" command
  9.  
  10. New 'MYDNS:1 (root)' desktop is MYDNS:1
  11.  
  12. Creating default startup script /root/.vnc/xstartup
  13. Starting applications specified in /root/.vnc/xstartup
  14. Log file is /root/.vnc/MYDNS:1.log

6、检验是否启动成功:
  1. [root@MYDNS yum.repos.d]# ps -ef|grep vnc
  2. root 2162 1 0 10:39 pts/0 00:00:00 /usr/bin/Xvnc :1 -desktop MYDNS:1 (root) -auth /root/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /root/.vnc/passwd -rfbport 5901 -fp catalogue:/etc/X11/fontpath.d -pn
  3. root 2168 1 0 10:39 pts/0 00:00:00 vncconfig -iconic
  4. root 2246 1957 0 10:40 pts/0 00:00:00 grep vnc

7、本地vnc客户端连接服务端vnc

发现连接超时。

可能两种情况:

a、服务端服务未起来。

b、服务端防火墙限制。

本例中服务端已确认过起来了,那可能的原因就是防火墙。

8、关闭防火墙

  1. [root@MYDNS yum.repos.d]# service iptables stop
  2. iptables:清除防火墙规则:[确定]
  3. iptables:将链设置为政策 ACCEPTfilter [确定]
  4. iptables:正在卸载模块:[确定]
关闭开机自启动:
  1. [root@MYDNS yum.repos.d]# chkconfig iptables off
  2. [root@MYDNS yum.repos.d]# chkconfig --list |grep iptables
  3. iptables 0:关闭 1:关闭 2:关闭 3:关闭 4:关闭 5:关闭 6:关闭
  4. [root@MYDNS yum.repos.d]#

9、再次通过vnc viewer 连接服务端

连接输入:192.168.0.88:1

ip就是vncserver运行的服务器的ip地址

冒号1就是启动vncserver时后面指定的东西。

10、成功。

猜你在找的CentOS相关文章