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






相关文章
|
9天前
|
Ubuntu NoSQL JavaScript
在Ubuntu上安装MEAN Stack的4个步骤
本指南介绍了在Ubuntu上安装MEAN Stack的四个步骤。MEAN Stack是一种基于JavaScript的开发堆栈,包含MongoDB、ExpressJS、AngularJS和NodeJS。步骤包括:1. 更新系统并准备安装MEAN;2. 从官方源安装最新版MongoDB;3. 安装NodeJS、Git和NPM;4. 克隆mean.io仓库并使用NPM安装剩余依赖项。通过这些步骤,您可以快速搭建基于MEAN Stack的应用开发环境。
24 2
|
1天前
|
Ubuntu 安全 调度
在Ubuntu下安装Debian包:dpkg与apt命令的深度解构。
安装Debian包的知识,就像掌握了海上的航行技术,虽然起初会让人感到陌生甚至困惑,但只要你积累熟练,就能在Ubuntu的世界里畅游无阻。就像每一位成功的航海家,掌握好这些工具,去探索属于你的Ubuntu新世界吧!
44 21
|
7天前
|
Ubuntu Linux Shell
Ubuntu gnome WhiteSur-gtk-theme类mac主题正确安装和卸载方式
通过这个过程,用户不仅可以定制自己的桌面外观,还可以学习到更多关于 Linux 系统管理的知识,从而更好地掌握系统配置和主题管理的技巧。
39 12
|
1月前
|
缓存 Ubuntu Linux
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`则是一个功能强大的下载工具,适用于各种下载任务。在实际使用中,根据系统类型和任务需求选择合适的工具,可以大大提高工作效率和系统管理的便利性。
153 25
|
15天前
|
NoSQL Ubuntu 网络安全
在 Ubuntu 20.04 上安装和配置 Redis
在 Ubuntu 20.04 上安装和配置 Redis 的步骤如下:首先更新系统包,然后通过 `apt` 安装 Redis。安装后,启用并启动 Redis 服务,检查其运行状态。可选配置包括修改绑定 IP、端口等,并确保防火墙设置允许外部访问。最后,使用 `redis-cli` 测试 Redis 功能,如设置和获取键值对。
29 1
|
21天前
|
Ubuntu TensorFlow 算法框架/工具
如何在Ubuntu上安装TensorFlow 24.04
如何在Ubuntu上安装TensorFlow 24.04
41 1
|
15天前
|
Ubuntu Linux Docker
如何在Ubuntu 20.04系统中安装Docker
安装 Docker 引擎的步骤如下:首先更新系统包索引 (`sudo apt update`),安装必要依赖包 (`apt-transport-https` 等),添加 Docker 官方 GPG 密钥及 APT 仓库。接着再次更新包索引并安装 Docker 引擎及相关工具 (`docker-ce` 等)。最后启动 Docker 服务并设置开机自启,通过 `docker --version` 和运行测试容器 (`sudo docker run hello-world`) 验证安装是否成功。
120 0
|
Java Android开发
在Eclipse中安装e(fx)lipse (JavaFX工具)
从Java8开始,JDK(Java开发工具包)包括了JavaFX库。 因此,要运行JavaFX应用程序,您只需要在系统中安装Java8或更高版本。
1895 0
|
Java 开发工具 Android开发
Eclipse下安装JavaFX
Eclipse下安装JavaFX JavaFX Script 插件 在Eclipse3.2下的安装 1)先决条件 (1)Eclipse SDK 3.2.2 (2)J2SE JDK 5.
1056 0
|
Java 开发工具 Android开发
Eclipse下安装JavaFX
版权声明:本文为博主chszs的原创文章,未经博主允许不得转载。 https://blog.csdn.net/chszs/article/details/1758753 Eclipse下安装JavaFX JavaFX Script 插件 在Eclipse3.
1695 0