我的java天地

          在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,是一個桌面共享系統(tǒng)。它的功能,類似于windows中的遠(yuǎn)程桌面功能。VNC使用了RFB(Remote FrameBuffer,遠(yuǎn)程幀緩沖)協(xié)議來實現(xiàn)遠(yuǎn)程控制另外一臺計算機(jī)。它把鍵盤、鼠標(biāo)動作發(fā)送到遠(yuǎn)程計算機(jī),并把遠(yuǎn)程計算機(jī)的屏幕發(fā)回到本地。 
          VNC技術(shù)與平臺無關(guān),VNC Viewer可以和VNC Server在不同的操作系統(tǒng)上。VNC幾乎支持所有的操作系統(tǒng),也支持Java,甚至可以通過支持Java的瀏覽器來訪問VNC Server。多個VNC客戶端可以同時連接到一個VNC Server上。

          在centos5下安裝配置VNC

          1.檢查VNC客戶端和服務(wù)器端是否已經(jīng)安裝

          rpm -q vnc vnc-server

          如果返回類似如下信息,

          package vnc is not installed
          vnc-server-4.0-8.1

           則說明系統(tǒng)已經(jīng)默認(rèn)安裝了vnc服務(wù)器端(一般來說,系統(tǒng)都默認(rèn)安裝了vnc server)。
          假如服務(wù)器未被安裝,請用這個指令來安裝它:yum install vnc-serve執(zhí)行如下命令:


          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.設(shè)置 root用戶的密碼

          使用如下命令設(shè)置密碼:

           vncpasswd

          當(dāng)提示Verify時,再次輸入密碼確認(rèn)。

          4.啟動VNC服務(wù)

          使用如下命令啟動VNC SERVER

          sbin/service vncserver start

          當(dāng)顯示如下信息時,表示啟動成功:

          Starting VNC server: 2:root                [   OK   ]

          5.修改VNC SERVER的窗口管理器

          vnc server默認(rèn)使用的窗口管理器是twn,這是一個非常簡單的窗口管理器,我們可以改成常用的GNOME或者KDE。

          先使用如下命令進(jìn)入用戶的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 &                        #注掉系統(tǒng)默認(rèn)的窗口管理器

          6.重啟VNC SERVER

          /sbin/service vncserver restart

          當(dāng)系統(tǒng)提示如下信息時,表示重啟成功:

          Shutting down VNC server: 2:root                           [   OK   ]
          Starting VNC server: 2:root                [   OK   ] 

          windows登錄到VNC SERVER

          1.從IE登錄

          直接從IE瀏覽器中輸入如下地址:

          http://xxx.xxx.xxx.xxx:5802

          輸入密碼即可使用。

          2.從VNC view登錄

          在windows上安裝vnc view,然后輸入xxx.xxx.xxx.xxx:2,連接登錄,輸入密碼即可。

          備注:如果從vnc view登錄時,提示connection refused(10061),則是因為linux防火墻的問題,登錄centos系統(tǒng),選擇System-->Preferences-->Remote Desktop,勾選sharing中的兩項,Security兩項不勾,點擊關(guān)閉,然后再重新用vnc view登錄即可。

          @import url(http://www.aygfsteel.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);

          posted on 2011-09-01 10:55 tobyxiong 閱讀(268) 評論(0)  編輯  收藏 所屬分類: linix

          <2011年9月>
          28293031123
          45678910
          11121314151617
          18192021222324
          2526272829301
          2345678

          導(dǎo)航

          統(tǒng)計

          常用鏈接

          留言簿(3)

          隨筆分類(144)

          隨筆檔案(157)

          相冊

          最新隨筆

          搜索

          積分與排名

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 通道| 饶阳县| 惠东县| 陈巴尔虎旗| 祁连县| 赞皇县| 马鞍山市| 泸水县| 淳化县| 定西市| 嘉鱼县| 嘉禾县| 边坝县| 和顺县| 定兴县| 阿图什市| 桦甸市| 青河县| 喀什市| 绥阳县| 萍乡市| 闵行区| 镇沅| 始兴县| 敦化市| 乌拉特前旗| 邮箱| 永春县| 临夏县| 诏安县| 清镇市| 行唐县| 松滋市| 屏东县| 肥城市| 沈丘县| 赞皇县| 南汇区| 太仓市| 镇赉县| 克什克腾旗|