天天看點

ubuntu16.04 14.04 安裝 vnc server 及eclipse配置

在ubuntu16.04 使用gnome桌面的情況下的環境配置。

Ubuntu 16.04 VNC Server 配置

1. 安裝 x11vnc server

sudo apt-get install x11vnc

2. 配置vnc server密碼

sudo x11vnc -storepasswd /etc/x11vnc.pass

3. 建立服務檔案

vi /lib/systemd/system/x11vnc.service

[Unit]

Description=Start x11vnc at startup.

After=multi-user.target

[Service]

Type=simple

ExecStart=/usr/bin/x11vnc -xkb -capslock -auth guess -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared

[Install]

WantedBy=multi-user.target

4. 配置Systemd服務

sduo systemctl daemon-reload

sudo systemctl enable x11vnc.service

sudo systemctl start x11vnc.service

5. 使用vnc用戶端連接配接

6.設定vnc分辨率

建立/etc/X11/xorg.conf檔案,然後添加如下内容:

Section "Device"

        Identifier "Configured Video Device"

EndSection

Section "Monitor"

        Identifier "Configured Monitor"

Section "Screen"

        Identifier "Default Screen"

        Monitor "Configured Monitor"

        Device "Configured Video Device"

        SubSection "Display"

                   Depth 24

                   Virtual 1680 1050

        EndSubSection

如果ubuntu安裝在實體機上就可以使用該檔案來設定ubuntu的分辨率,如果ubuntu安裝在vmware中,可在ubuntu中安裝vmware-tools來驅動vmware的顯驅。

如果ubuntu安裝在hyper-v中需要修改啟動檔案/etc/default/grub中的下面這行,修改完如下:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:1920x1080"

使用VNC連接配接即可成設定的最佳分辨率

x11vnc和windows的複制粘貼功能:安裝glipper

apt-get install glipper 

安裝完後,可以用滑鼠的用滑鼠不能用滑鼠的地方可以用快捷鍵C-c, C-v, C-insert, Shift-insert

Q:所有的設定都完成連接配接到gnome桌面的時候,居然不能識别鍵盤的大寫,大寫使用shift鍵。。。。我也是醉了。

A:該問題的解決方式:在x11vnc選項上面加上-xkb -capslock選項

ubuntu 14.04 desktop安裝x11vnc server

安裝軟體包

$ sudo apt-get update

$ sudo apt-get install x11vnc

建立密碼

$ sudo x11vnc -storepasswd /etc/x11vnc.pass

啟動X11VNC服務

$ sudo x11vnc -auth guess -forever -loop -noxdamage -repeat -rf bauth /etc/x11vnc.pass -rfbport 5900 -shared

設定在系統啟動x11vnc伺服器的自動啟動

$ sudo vi /etc/init/x11vnc.conf

# description "Start x11vnc on system boot"

description "x11vnc"

start on runlevel [2345]

stop on runlevel [^2345]

console log

respawn

respawn limit 20 5

exec /usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /home/rahul/.vnc/passwd -rfbport 5900 -shared

也可以使用如下的配置:

$sudo vim /etc/init/x11vnc.conf

start on login-session-start 

script 

/usr/bin/x11vnc -xkb -auth /var/run/lightdm/root/:0

-noxrecord -noxfixes -noxdamage 

-rfbauth /etc/x11vnc.pass 

-forever -bg -rfbport 5900 -o /var/log/x11vnc.log 

end script

重新開機ubuntu系統,自動啟動x11vnc服務

看來還是要安裝一個vnc4server

ubuntu16.04 vnc4server的安裝

更新系統

apt update

apt upgrade -y

安裝必要的桌面環境

apt install ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal -y

安裝vnc server

apt install vnc4server -y

配置vncserver

vncserver -geometry 1920x1080 :1

結束vncserver

vncserver -kill :1

修改配置檔案,添加下面的配置到~/.vnc/xstartup

gnome-panel &

gnome-settings-daemon &

metacity &

nautilus &

vncconfig -nowin &

啟動vncserver(第四步)

配置開機啟動

crontab -e

添加如下行:

@reboot /usr/bin/vncserver :1

安裝完畢,使用vnc client連接配接使用。

安裝完vnc4server後使用如下步驟取消快捷鍵:

I've had the same thing happen. Here's what I do to solve:

Go to <code>System</code> menu -&gt; <code>Preferences</code> -&gt; <code>Keyboard Shortcuts</code>

Under the <code>Window Management</code> catagory, select the entry for <code>Hide all normal windows and set focus to the desktop</code> and press the Backspace key to clear the entry

Restart the <code>vncserver</code> session

An alternative option is to use the command line within the session. Paste the following in the terminal:

ubuntu16.04 配置eclipse mars版本不能正常顯示功能設定(可以使用oxygen版本的就正常),功能不正常這個和gnome有關。

在eclipse.ini檔案 --launcher.appendVmargs語句前加:

--launcher.GTK_version

2

在ubuntu系列的系統中eclipse不能正常顯示下劃線的主要原因是因為字型的原因,可以設定其他不同的字型來顯示下劃線或其他不能正常顯示的字型

編輯eclipse.desktop檔案内容如下

[Desktop Entry]

Version=1.0

Name=Eclipse

Exec=env SWT_GTK3=0 UBUNTU_MENUPROXY= eclipse

Terminal=false

Icon=/eclipse/icon.xpm

Type=Application

Categories=IDE;Development

X-Ayatana-Desktop-Shortcuts=NewWindow

[NewWindow Shortcut Group]

Name=New Window

TargetEnvironment=Unity

在使用vnc client連接配接到x11vnc server後,使用eclipse時可以取消ubuntu的系統快捷鍵和eclipse快捷鍵的沖突。(設定完有可能重新開機後又恢複了。)

System Settings–&gt;keyboard--&gt;shortcuts--&gt;navigation--&gt;switch to workspace left/right/above/below--&gt;disabled

ubuntu 16.04 安裝ibus中文輸入法

安裝中文語言包

System Settings–&gt;Language Support–&gt;Install/Remove Languages

選中chinese,點選Apply應用即可,等待下載下傳安裝完成。

安裝ibus

sudo apt-get install ibus ibus-clutter ibus-gtk ibus-gtk3 ibus-qt4

啟動ibus

im-config -s ibus

安裝pinyin

sudo apt-get install ibus-sunpinyin

設定ibus,添加拼音輸入法

sudo ibus-setup

設定text entry,添加拼音輸入法以便使用快捷鍵切換。這裡可能需要重新開機電腦才能添加拼音輸入法。

ubuntu 16.04 安裝fcitx和拼音輸入法

安裝相關的包

sudo apt install fcitx fcitx-googlepinyin fcitx-table-wbpy fcitx-pinyin fcitx-sunpinyin

系統設定 ---》 語言支援 ---》選擇fcitx為預設的輸入法

重新開機電腦組態text entry

安裝fcitx輸入法後會和eclipse的alt+/鍵沖突,沒找到在哪設定這個熱鍵。

還有兩個問題沒解決:

使用vnc client連接配接到x11vnc後大寫不能鎖定,隻能使用shift來得到大寫字母(這個問題已解決,見前面的内容)

使用vnc client連接配接到vnc4server後沒找到設定快捷鍵的地方(已解決)

本文轉自ting2junshui51CTO部落格,原文連結: http://blog.51cto.com/ting2junshui/1867879,如需轉載請自行聯系原作者

繼續閱讀