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






目录
打赏
0
0
0
0
143
分享
相关文章
|
17天前
|
Linux中yum、rpm、apt-get、wget的区别,yum、rpm、apt-get常用命令,CentOS、Ubuntu中安装wget
通过本文,我们详细了解了 `yum`、`rpm`、`apt-get`和 `wget`的区别、常用命令以及在CentOS和Ubuntu中安装 `wget`的方法。`yum`和 `apt-get`是高层次的包管理器,分别用于RPM系和Debian系发行版,能够自动解决依赖问题;而 `rpm`是低层次的包管理工具,适合处理单个包;`wget`则是一个功能强大的下载工具,适用于各种下载任务。在实际使用中,根据系统类型和任务需求选择合适的工具,可以大大提高工作效率和系统管理的便利性。
106 25
ubuntu22 编译安装docker,和docker容器方式安装 deepseek
本脚本适用于Ubuntu 22.04,主要功能包括编译安装Docker和安装DeepSeek模型。首先通过Apt源配置安装Docker,确保网络稳定(建议使用VPN)。接着下载并配置Docker二进制文件,创建Docker用户组并设置守护进程。随后拉取Debian 12镜像,安装系统必备工具,配置Ollama模型管理器,并最终部署和运行DeepSeek模型,提供API接口进行交互测试。
341 15
OS-Copilot-ubuntu镜像版本的具体测试使用(安装方式有单独注明)
作为一名个人开发者,我主要负责云资源的运维和管理。在使用OS Copilot的过程中,我遇到了一些配置问题,特别是在ECS实例中设置AccessKey时,但最终成功解决了。通过使用OS Copilot的-t/-f/管道功能,我大大提升了效率,减少了命令编写的工作量,特别是在搭建Java运行环境时效果显著。此外,| 功能帮助我快速理解文档,整体体验非常流畅,推荐给其他开发者使用。
58 6
ubuntu 22安装lua环境&&编译lua cjson模块
通过上述步骤,可以在 Ubuntu 22.04 系统上成功安装 Lua 环境,并使用 LuaRocks 或手动编译的方式安装 lua-cjson 模块。本文详细介绍了每一步的命令和操作,确保每一步都能顺利完成,适合需要在 Ubuntu 系统上配置 Lua 开发环境的开发者参考和使用。
258 13
Ubuntu24.04安装Librenms
此指南介绍了在Linux系统上安装和配置LibreNMS网络监控系统的步骤。主要内容包括:安装所需软件包、创建用户、克隆LibreNMS仓库、设置文件权限、安装PHP依赖、配置时区、设置MariaDB数据库、调整PHP-FPM与Nginx配置、配置SNMP及防火墙、启用命令补全、设置Cron任务和日志配置,最后通过网页完成安装。整个过程确保LibreNMS能稳定运行并提供有效的网络监控功能。
Ubuntu22.04上Docker的安装
通过以上详细的安装步骤和命令,您可以在Ubuntu 22.04系统上顺利安装
1508 12
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等