歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu 12.04 Unity桌面環境VNC配置手記

Ubuntu 12.04 Unity桌面環境VNC配置手記

日期:2017/2/28 14:43:15   编辑:Linux教程

注意,本說明只適用於Ubuntu 12.04 unity 桌面版本,其他版本請酌情參考即可。

安裝vnc:
sudo apt-get install vnc4server

運行服務端:
安裝好後直接運行 vncserver 即可,更多參數可以參考man vncserver。首次運行要求設置密碼,生成配置文件在~/.vnc目錄下,無限root權限運行。

在另外一台電腦通過遠程vnc可以鏈接到桌面:
例如:vncviewer 1.2.3.4:1 連接到遠端桌面

配置問題:
默認配置文件~/.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
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &

采用默認配置可能存在的問題:
1. 采用默認配置,你登陸到vnc桌面後,只能看到桌面背景和一個終端,其他什麼也沒有,如下圖。

2. 登陸時出現 Counld not acquire name on session bus 等錯誤提示,如下圖。

接下來請看第2頁精彩內容:http://www.linuxidc.com/Linux/2013-10/90818p2.htm

Copyright © Linux教程網 All Rights Reserved