我的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簡(jiǎn)介

                   不能免俗,簡(jiǎn)單說(shuō)介紹下VNC吧。

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

           則說(shuō)明系統(tǒng)已經(jīng)默認(rèn)安裝了vnc服務(wù)器端(一般來(lái)說(shuō),系統(tǒng)都默認(rèn)安裝了vnc server)。
          假如服務(wù)器未被安裝,請(qǐng)用這個(gè)指令來(lái)安裝它: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時(shí),再次輸入密碼確認(rèn)。

          4.啟動(dòng)VNC服務(wù)

          使用如下命令啟動(dòng)VNC SERVER

          sbin/service vncserver start

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

          Starting VNC server: 2:root                [   OK   ]

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

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

          先使用如下命令進(jìn)入用戶的home目錄:

          cd ~/.vnc

          編輯啟動(dòng)項(xiàng):

          vi xstartup 

          按照如下方式修改啟動(dòng)項(xiàng):

          #!/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)提示如下信息時(shí),表示重啟成功:

          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登錄時(shí),提示connection refused(10061),則是因?yàn)閘inux防火墻的問(wèn)題,登錄centos系統(tǒng),選擇System-->Preferences-->Remote Desktop,勾選sharing中的兩項(xiàng),Security兩項(xiàng)不勾,點(diǎn)擊關(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 閱讀(259) 評(píng)論(0)  編輯  收藏 所屬分類: linix

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

          導(dǎo)航

          統(tǒng)計(jì)

          常用鏈接

          留言簿(3)

          隨筆分類(144)

          隨筆檔案(157)

          相冊(cè)

          最新隨筆

          搜索

          積分與排名

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 阜新| 花莲县| 黄大仙区| 军事| 封开县| 清原| 鄂托克前旗| 黑龙江省| 石首市| 崇义县| 淮北市| 绍兴县| 东乌珠穆沁旗| 临泽县| 常德市| 启东市| 碌曲县| 依安县| 恩平市| 额敏县| 鄢陵县| 康乐县| 青冈县| 开阳县| 衢州市| 临江市| 邹城市| 射洪县| 黄骅市| 原平市| 抚远县| 北京市| 浮山县| 北辰区| 隆子县| 金阳县| 衡山县| 建瓯市| 天镇县| 德令哈市| 从化市|