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"

EndSection


Section "Screen"

        Identifier "Default Screen"

        Monitor "Configured Monitor"

        Device "Configured Video Device"

        SubSection "Display"

                   Depth 24

                   Virtual 1680 1050

        EndSubSection

EndSection


如果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

  1. 安装软件包

    $ sudo apt-get update

    $ sudo apt-get install x11vnc

  2. 创建密码

    $ sudo x11vnc -storepasswd /etc/x11vnc.pass

  3. 启动X11VNC服务

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

  4. 设置在系统启动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

  5. 重启ubuntu系统,自动启动x11vnc服务








看来还是要安装一个vnc4server

ubuntu16.04 vnc4server的安装

  1. 更新系统

    apt update

    apt upgrade -y

  2. 安装必要的桌面环境

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

  3. 安装vnc server

    apt install vnc4server -y

  4. 配置vncserver

    vncserver -geometry 1920x1080 :1

  5. 结束vncserver

    vncserver -kill :1

  6. 修改配置文件,添加下面的配置到~/.vnc/xstartup

    gnome-panel &

    gnome-settings-daemon &

    metacity &

    nautilus &

    vncconfig -nowin &

  7. 启动vncserver(第四步)

  8. 配置开机启动

    crontab -e

    添加如下行:

    @reboot /usr/bin/vncserver :1

  9. 安装完毕,使用vnc client连接使用。

安装完vnc4server后使用如下步骤取消快捷键:

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

  • Go to System menu -> Preferences -> Keyboard Shortcuts

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

  • Restart the vncserver session

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

gconftool-2 -t str -s /apps/metacity/global_keybindings/show_desktop ""



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

Exec=env SWT_GTK3=0 UBUNTU_MENUPROXY= eclipse

TargetEnvironment=Unity




在使用vnc client连接到x11vnc server后,使用eclipse时可以取消ubuntu的系统快捷键和eclipse快捷键的冲突。(设置完有可能重启后又恢复了。)

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



ubuntu 16.04 安装ibus中文输入法

  1. 安装中文语言包

    System Settings–>Language Support–>Install/Remove Languages
    选中chinese,点击Apply应用即可,等待下载安装完成。

  2. 安装ibus

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

  3. 启动ibus

    im-config -s ibus

  4. 安装pinyin

    sudo apt-get install ibus-sunpinyin

  5. 设置ibus,添加拼音输入法

    sudo ibus-setup

  6. 设置text entry,添加拼音输入法以便使用快捷键切换。这里可能需要重启电脑才能添加拼音输入法。



ubuntu 16.04 安装fcitx和拼音输入法

  1. 安装相关的包

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

  2. 系统设置 ---》 语言支持 ---》选择fcitx为默认的输入法

  3. 重启电脑配置text entry


安装fcitx输入法后会和eclipse的alt+/键冲突,没找到在哪设置这个热键。




还有两个问题没解决:

  1. 使用vnc client连接到x11vnc后大写不能锁定,只能使用shift来得到大写字母(这个问题已解决,见前面的内容)

  2. 使用vnc client连接到vnc4server后没找到设置快捷键的地方(已解决)

















本文转自ting2junshui51CTO博客,原文链接: http://blog.51cto.com/ting2junshui/1867879,如需转载请自行联系原作者






相关文章
|
22天前
|
Ubuntu NoSQL 关系型数据库
Ubuntu系统下安装常用软件
Ubuntu系统下安装常用软件
44 0
Ubuntu系统下安装常用软件
|
1月前
|
Ubuntu Linux C语言
Ubuntu下安装vscode,并解决终端打不开vscode的问题
Ubuntu下安装vscode,并解决终端打不开vscode的问题
135 0
|
1月前
|
Ubuntu Docker 容器
如何在Ubuntu上安装Docker?
【2月更文挑战第10天】
241 0
|
23天前
|
Ubuntu 关系型数据库 MySQL
Ubuntu 中apt 安装MySQL数据库
Ubuntu 中apt 安装MySQL数据库
66 0
|
2天前
|
Ubuntu 数据安全/隐私保护
在UBUNTU虚拟机上安装R软件包
在UBUNTU虚拟机上安装R软件包
|
3天前
|
存储 编解码 Ubuntu
0-零基础安装ubuntu(超详细安装步骤)
0-零基础安装ubuntu(超详细安装步骤)
|
3天前
|
Ubuntu Linux 定位技术
手把手教你优雅的安装虚拟机 Ubuntu —— 图文并茂
手把手教你优雅的安装虚拟机 Ubuntu —— 图文并茂
|
11天前
|
Java Android开发
eclipse安装windowbuilder
eclipse安装windowbuilder
|
16天前
|
Ubuntu 开发工具
Ubuntu vim配置支持鼠标
Ubuntu vim配置支持鼠标
12 0
|
17天前
|
Ubuntu Linux 虚拟化
【Linux】ubuntu安装samba服务器
【Linux】ubuntu安装samba服务器