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,如需转载请自行联系原作者






相关文章
|
10月前
|
人工智能 Ubuntu 前端开发
Dify部署全栈指南:AI从Ubuntu配置到HTTPS自动化的10倍秘籍
本文档介绍如何部署Dify后端服务及前端界面,涵盖系统环境要求、依赖安装、代码拉取、环境变量配置、服务启动、数据库管理及常见问题解决方案,适用于开发与生产环境部署。
1824 1
|
9月前
|
Ubuntu 安全 iOS开发
Nessus Professional 10.10 Auto Installer for Ubuntu 24.04 - Nessus 自动化安装程序
Nessus Professional 10.10 Auto Installer for Ubuntu 24.04 - Nessus 自动化安装程序
1247 5
|
9月前
|
NoSQL Ubuntu MongoDB
在Ubuntu 22.04上安装MongoDB 6.0的步骤
这些步骤应该可以在Ubuntu 22.04系统上安装MongoDB 6.0。安装过程中,如果遇到任何问题,可以查阅MongoDB的官方文档或者Ubuntu的相关帮助文档,这些资源通常提供了解决特定问题的详细指导。
925 18
|
10月前
|
Ubuntu 安全 应用服务中间件
详细指南:配置Nginx服务器在Ubuntu平台上
以上步骤涵盖了基本流程:从软件包管理器获取 Ngnix, 设置系统服务, 调整UFW规则, 创建并激活服务器块(也称作虚拟主机), 并进行了初步优化与加固措施。这些操作都是建立在命令行界面上,并假设用户具有必要权限(通常是root用户)来执行这些命令。每个操作都有其特定原因:例如,设置开机启动确保了即使重启后也能自动运行 Ngnix;而编辑server block则定义了如何处理进入特定域名请求等等。
526 18
|
10月前
|
Ubuntu 安全 关系型数据库
安装MariaDB服务器流程介绍在Ubuntu 22.04系统上
至此, 您已经在 Ubuntu 22.04 系统上成功地完成了 MariadB 的标准部署流程,并且对其进行基础但重要地初步配置加固工作。通过以上简洁明快且实用性强大地操作流程, 您现在拥有一个待定制与使用地强大 SQL 数据库管理系统。
488 18
|
10月前
|
Ubuntu 安全 应用服务中间件
详细指南:配置Nginx服务器在Ubuntu平台上
以上步骤涵盖了基本流程:从软件包管理器获取 Ngnix, 设置系统服务, 调整UFW规则, 创建并激活服务器块(也称作虚拟主机), 并进行了初步优化与加固措施。这些操作都是建立在命令行界面上,并假设用户具有必要权限(通常是root用户)来执行这些命令。每个操作都有其特定原因:例如,设置开机启动确保了即使重启后也能自动运行 Ngnix;而编辑server block则定义了如何处理进入特定域名请求等等。
892 17
|
10月前
|
Ubuntu 安全 关系型数据库
安装MariaDB服务器流程介绍在Ubuntu 22.04系统上
至此, 您已经在 Ubuntu 22.04 系统上成功地完成了 MariadB 的标准部署流程,并且对其进行基础但重要地初步配置加固工作。通过以上简洁明快且实用性强大地操作流程, 您现在拥有一个待定制与使用地强大 SQL 数据库管理系统。
675 15
|
10月前
|
存储 Ubuntu iOS开发
在Ubuntu 22.04系统上安装libimobiledevice的步骤
为了获取更多功能或者解决可能出现问题,请参考官方文档或者社区提供支持。
982 14
|
10月前
|
Ubuntu 安全 关系型数据库
安装与配置MySQL 8 on Ubuntu,包括权限授予、数据库备份及远程连接指南
以上步骤提供了在Ubuntu上从头开始设置、配置、授权、备份及恢复一个基础但完整的MySQL环境所需知识点。
1121 7
|
存储 缓存 NoSQL
如何解决Ubuntu server 下 Redis安装报错:“You need tcl 8.5 or newer in order to run the Redis test”.
如何解决Ubuntu server 下 Redis安装报错:“You need tcl 8.5 or newer in order to run the Redis test”.
933 0