今天裝了下VNC,解決了不少問題,寫個教學貼,給新手們看看,如果你們碰到同樣的問題,就可以迅速解決,無需頭疼甚至放棄了。
系統內容
VM+RHEL5.1[root@localhost .vnc]# uname -r2.6.18-53.el5xen
本地XP系統安裝VNCVIEW去控制VM中的RHEL5.1
下面在LINUX上安裝VNCSERVER
1、去www.realvnc.com去下載免費版for x86 linux
2、下載是一個tar.gz檔案,解壓後進入檔案夾,裡面有個README,請注意這塊不要下載RPM包,依賴問題以及包頭的安全簽名會讓你很鬱悶的。
3、解壓縮,進入該檔案夾,按照readme 要求執行4步
% ./vncinstall /usr/local/bin% ./vncinstall /usr/local/bin /usr/local/man% mkdir -p /usr/local/vnc/classes% cp java/* /usr/local/vnc/classes
4、啟動VNCSERVER,輸入串連密碼
5、可能會提示linux1x: error while loading shared libraries: libstdc++-libc6.2-2.so.3: cannot open shared object file: No such file or directory
去下載libstdc++-libc6.2-2.so.3,放到/usr/lib裡面,這個我碰到了,通過下載這個SO檔案解決了)
下面這個方法在這個版本中不可取,我已經試過,是無效的
在我的系統上ls命令的結果是 libstdc++.so.5.0.7 libstdc++.so.6.0.8
libstdc++.so.6.0.8就是我們要找的,給它做個連結
代碼:
$ sudo ln -s libstdc++.so.6.0.8 libstdc++-libc6.2-2.so.3
會出現如下錯誤:
vncpasswd: symbol lookup error:vncpasswd: undefined symbol: __builtin_vec_new
看到這個錯感覺就是那兩個庫不一樣造成的字元未定義
6、繼續啟動vncserver,可能還有錯誤,如下
vncext: VNC extension running!vncext: Listening for VNC connections on port 5901vncext: Listening for HTTP connections on port 5801vncext: created VNC server for screen 0error opening security policy file /usr/X11R6/lib/X11/xserver/SecurityPolicyCould not init font path element /usr/X11R6/lib/X11/fonts/misc/, removing from list!Could not init font path element /usr/X11R6/lib/X11/fonts/Speedo/, removing from list!Could not init font path element /usr/X11R6/lib/X11/fonts/Type1/, removing from list!Could not init font path element /usr/X11R6/lib/X11/fonts/CID/, removing from list!Could not init font path element /usr/X11R6/lib/X11/fonts/75dpi/, removing from list!Could not init font path element /usr/X11R6/lib/X11/fonts/100dpi/, removing from list!
Fatal server error:could not open default font 'fixed'xsetroot: unable to open display 'localhost.localdomain:1'vncconfig: unable to open display "localhost.localdomain:1"Warning: This program is an suid-root program or is being run by the root user.The full text of the error or warning message cannot be safely formattedin this environment. You may get a more descriptive message by running theprogram as a non-root user or by removing the suid bit on the executable.xterm Xt error: Can't open display: %s
原因:vncserver預設尋找的X系統的字型路徑在/usr/X11R6/lib/X11/fonts/下,但RHEL5卻在/usr /share/X11/fonts/下
解決:
mkdir /usr/X11R6/libcd /usr/X11R6/libln -s /usr/share/X11 X11