ubuntu10.10安裝使用vnc,ubuntu10.10vnc

來源:互聯網
上載者:User

ubuntu10.10安裝使用vnc,ubuntu10.10vnc

原文發表於:2010-12-15
轉載至cu於:2012-07-21

搭安全實驗的環境,在vmware上安裝了ubuntu10.10(大學的時候用過,最早用的好像是6系列吧)。安裝好後想用遠端桌面控制,畢竟在vmware上看到的介面比較小,不太方便。

使用的是vnc, 相關資訊請看http://www.realvnc.com/

在安裝上vnc,做了一些配置(vnc使用gnome-seeion啟動)後,使用時出了兩個問題:

1. 從遠端使用vncviewer串連上後,只有一個終端,沒有圖形介面,有"could not acquire name on session bus"字樣;

2. 上面的問題解決,vnc上後,按鍵"d"不能使用。

從網上找到解決辦法,記錄下來,以供後用。

1. 在ubuntu上安裝:

sudo apt-get install vnc4server

2. 啟動vncserver:

vncserver

初次開機會要求設定密碼,後面可以使用vncpasswd修改;

看到 New '****:1 (****)' desktop is ****:1 (****代表主機名稱)即表示啟動vnc成功,在使用者主目錄下產生一個.vnc目錄;

此時可以遠端連線,注意上面的數字"1",代表終端號,使用網頁登陸即http://ip:5901, 使用vncviewer即ip:1;

3. 關閉vnc:

vncserver -kill :1

注意看kill後有空格;

4. 本來想像centos中修改vnc啟動的圖形介面調用gnome-session就算完事了,但不幸發生了,問題如上描述。解決辦法如下(來自網路),修改vnc開機檔案:

備份原有xstartup檔案:

mv ~/.vnc/xstartup ~/.vnc/xstartup.bak

複製一份新的xstartup檔案:

cp /etc/X11/Xsession ~/.vnc/xstartup

(上面兩步還有一種方法:

sudo gedit ~/.vnc/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
vnccon** -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &

修改後:

#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc  (也可以修改為/etc/X11/Xsession, xinitrc在沒有修改許可權時遠端桌面可能是一片雪花)
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#xsetroot -solid grey
#vnccon** -iconic &
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &

修改/etc/X11/xinit/xinitrc檔案許可權,使起可執行:

sudo chmod 755 /etc/X11/xinit/xinitrc

)

5. 第一個問題在經過上面的配置後即可解決,下面是第二個問題:

ubuntu 10.10下有對Windows鍵的定義,在裡面被定義為Super鍵,當使用者在vnc下按下字母"d"時,會被錯誤的當做返回案頭的捷徑導致"d"無法輸入,此時可修改快速鍵方式來避免此bug,新開啟一個終端,在裡面輸入:

gconf-editor

彈出對話方塊,到“Apps->Metacity->Global keybingdings"中找“show desktop”,將其預設值<Super>D改為<Ctl>D即可。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.