服务端:
[root@RS1 ~]# yum install vnc-server Loaded plugins: fastestmirror, refresh-packagekit, security Loading mirror speeds from cached hostfile * rpmforge: ftp.riken.jp Setting up Install Process Resolving Dependencies There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them. --> Running transaction check ---> Package tigervnc-server.x86_64 0:1.1.0-5.el6_4.1 will be installed --> Finished Dependency Resolution Dependencies Resolved =================================================================================================================================================================================== Package Arch Version Repository Size =================================================================================================================================================================================== Installing: tigervnc-server x86_64 1.1.0-5.el6_4.1 updates 1.1 M Transaction Summary =================================================================================================================================================================================== Install 1 Package(s) Total download size: 1.1 M Installed size: 2.9 M Is this ok [y/N]: [root@RS1 sysconfig]# vncserver :1 You will require a password to access your desktops. Password: Verify: xauth: creating new authority file /root/.Xauthority New 'RS1:1 (root)' desktop is RS1:1 Creating default startup script /root/.vnc/xstartup Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/RS1:1.log [root@RS1 sysconfig]#
[root@linux-212 ~]# cd /etc/sysconfig [root@linux-212 sysconfig]# cp vncservers vncservers.bak [root@linux-212 sysconfig]# vim vncservers [root@linux-212 sysconfig]# cat 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 this URL: # http://kbase.redhat.com/faq/docs/DOC-7028 # Use "-nolisten tcp" to prevent X connections to your VNC server via TCP. # Use "-localhost" to prevent remote VNC clients connecting except when # doing so through a secure tunnel. See the "-via" option in the # `man vncviewer' manual page. # VNCSERVERS="2:myusername" # VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost" VNCSERVERS="1:vnc" VNCSERVERARGS[1]="-geometry 1024x768" [root@linux-212 sysconfig]#
错误与处理方法
[root@linux-212 sysconfig]# vncserver :1 You will require a password to access your desktops. Password: Verify: xauth: creating new authority file /root/.Xauthority xauth: (stdin):1: bad display name "linux-212:1" in "add" command WARNING: The first attempt to start Xvnc failed, possibly because the font catalog is not properly configured. Attempting to determine an appropriate font path for this system and restart Xvnc using that font path ... Could not start Xvnc. /usr/bin/Xvnc: symbol lookup error: /usr/bin/Xvnc: undefined symbol: pixman_composite_trapezoids /usr/bin/Xvnc: symbol lookup error: /usr/bin/Xvnc: undefined symbol: pixman_composite_trapezoids
第一个错误解决方法
xauth: (stdin):1: bad display name "linux-212:1" in "add" command
在/etc/hosts文件中加入主机名即可。
类似:
[root@linux-212 vmware]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 linux-212 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 [root@linux-212 vmware]#
第二个错误解决方法
WARNING: The first attempt to start Xvnc failed, possibly because the font catalog is not properly configured. Attempting to determine an appropriate font path for this system and restart Xvnc using that font path ... Could not start Xvnc. /usr/bin/Xvnc: symbol lookup error: /usr/bin/Xvnc: undefined symbol: pixman_composite_trapezoids /usr/bin/Xvnc: symbol lookup error: /usr/bin/Xvnc: undefined symbol: pixman_composite_trapezoids
解决方法为安装三个软件即可
[root@linux-212 sysconfig]# yum install pixman pixman-devel libXfont
参考资料