在centos5下安裝配置VNC
@import url(http://www.aygfsteel.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);VNC簡介
不能免俗,簡單說介紹下VNC吧。
VNC,全稱為Virtual Network Computing,是一個桌面共享系統。它的功能,類似于windows中的遠程桌面功能。VNC使用了RFB(Remote FrameBuffer,遠程幀緩沖)協議來實現遠程控制另外一臺計算機。它把鍵盤、鼠標動作發送到遠程計算機,并把遠程計算機的屏幕發回到本地。
VNC技術與平臺無關,VNC Viewer可以和VNC Server在不同的操作系統上。VNC幾乎支持所有的操作系統,也支持Java,甚至可以通過支持Java的瀏覽器來訪問VNC Server。多個VNC客戶端可以同時連接到一個VNC Server上。
在centos5下安裝配置VNC
1.檢查VNC客戶端和服務器端是否已經安裝
rpm -q vnc vnc-server
如果返回類似如下信息,
package vnc is not installed
vnc-server-4.0-8.1
則說明系統已經默認安裝了vnc服務器端(一般來說,系統都默認安裝了vnc server)。
假如服務器未被安裝,請用這個指令來安裝它:yum install vnc-serve執行如下命令:
2. 將用戶名加入到配置文件中
使用如下命令編輯配置文件,添加帳戶信息:
vi /etc/sysconfig/vncservers
做如下修改(紅色部分為添加的部分):
#
# Uncomment the line below to start a VNC server on display :1
# 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
# <URL:http://www.uk.research.att.com/vnc/sshvnc.html>.
# VNCSERVERS="1:myusername"
# VNCSERVERS="1:gavin 2:john" # use the method for more user
VNCSERVERS="2:root"
# VNCSERVERARGS[1]="-geometry 800x600"
VNCSERVERARGS[2]="-geometry 1024x768"
3.設置 root用戶的密碼
使用如下命令設置密碼:
vncpasswd
當提示Verify時,再次輸入密碼確認。
4.啟動VNC服務
使用如下命令啟動VNC SERVER
sbin/service vncserver start
當顯示如下信息時,表示啟動成功:
Starting VNC server: 2:root [ OK ]
5.修改VNC SERVER的窗口管理器
vnc server默認使用的窗口管理器是twn,這是一個非常簡單的窗口管理器,我們可以改成常用的GNOME或者KDE。
先使用如下命令進入用戶的home目錄:
cd ~/.vnc
編輯啟動項:
vi xstartup
按照如下方式修改啟動項:
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session & #以GNOME作為VNC的窗口管理器
#startkde & #kde desktop
#twm & #注掉系統默認的窗口管理器
6.重啟VNC SERVER
/sbin/service vncserver restart
當系統提示如下信息時,表示重啟成功:
Shutting down VNC server: 2:root [ OK ]
Starting VNC server: 2:root [ OK ]
windows登錄到VNC SERVER
1.從IE登錄
直接從IE瀏覽器中輸入如下地址:
輸入密碼即可使用。
2.從VNC view登錄
@import url(http://www.aygfsteel.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);在windows上安裝vnc view,然后輸入xxx.xxx.xxx.xxx:2,連接登錄,輸入密碼即可。
備注:如果從vnc view登錄時,提示connection refused(10061),則是因為linux防火墻的問題,登錄centos系統,選擇System-->Preferences-->Remote Desktop,勾選sharing中的兩項,Security兩項不勾,點擊關閉,然后再重新用vnc view登錄即可。
posted on 2011-09-01 10:55 tobyxiong 閱讀(259) 評論(0) 編輯 收藏 所屬分類: linix