ubuntu下vnc使用

來源:互聯網
上載者:User




剛開始在普通使用者下開vncserver,結果發現案頭一直出不來,所以應該在root下啟動vncserver。


1.在remote端安裝vnc4server:
apt-get install vnc4server
然後啟動:
vncserver
第一次啟動會提示輸入密碼,並且密碼只能設8位。


2.local端安裝vncviewer
sudo apt-get install vncviewer # Tight VNC
#sudo apt-get install gvncviewer # gvncviewer,不推薦
#sudo apt-get install vnc-java #jvncviewer,不推薦
啟動:
vncviewer ${remote}:1
輸入密碼就看到了遠程視窗,但是案頭是一片黑。所以需要在vnc server端配好gnome案頭。


3.remote端配置gnome案頭
vncserver -kill :1
apt-get install x-window-system-core
apt-get install gdm
apt-get install ubuntu-desktop


修改~/xstartup,注掉最後的x-window-manager &,加上gnome-session
#!/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 &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
gnome-session &


重新啟動vncserver,發現案頭有了,但是沒有工作列、視窗沒有標題列,xstartup最後加入:
metacity --replace &
重啟vncserver,發現有標題列了,但是沒有案頭,滑鼠右鍵也不能用。
需要安裝gnome-panel,並在xstartup最後加上gnome-panel &,這樣工作列和滑鼠右鍵都可以使用了。
側邊欄需要換gnome-session的樣式,ls /usr/share/gnome-session/sessions/可以看到不同樣式,經測試只有ubuntu-2d有側邊欄,dashboard等。即修改xstartup中:
gnome-session & => gnome-session --session=ubuntu-2d &


預設的vncserver解析度是1024 x 768,如要調整,可以這樣:
vncserver :1 -geometry 1366x768


tight vnc中按F8彈出一個popup進入全屏(還可以在local和remote中傳送clipboard資料),但是全屏不能按F8退出,google了很久也沒找到有效方法,只能通過Ctrl + Alt + F8, Ctrl + Alt + F2,登入其他帳號kill掉vncviewer進程,囧。


在vncviewer中使用IME有問題,可能因為ctrl + space,不會發給遠程機器,而是發給本地機器了。


3.總結
總的來說,linux做vnc server,需要配置圖形介面的啟動指令碼xstartup,ubuntu版本的vncviewer不太友好,可能有的配置還不全.


參考:
http://help.aliyun.com/manual?helpId=1371

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.