美文网首页
用VNC搭建Ubuntu VNC可视化界面

用VNC搭建Ubuntu VNC可视化界面

作者: 真是太机智了 | 来源:发表于2020-02-10 11:08 被阅读0次

    原文:https://help.aliyun.com/knowledge_detail/59330.html

    1. 创建Ubuntu服务器

    访问轻量应用服务器购买页面,选择Ubuntu镜像,并选择套餐、购买时长,确认订单支付并确认。

    084a89dc-7f1d-4b58-884b-339f8de5b39e.png

    2. 安装配置软件

    创建服务器成功后,点击服务器列表页的Ubuntu轻量应用服务器卡片的远程连接按钮

    60e6e00b-145d-4292-82a5-4b86b178cadd.png

    连接成功后开始安装软件。

    VNC的安装与配置

    安装之前先输入

    <pre class="prettyprint linenums prettyprinted" style="box-sizing: border-box; padding: 10px; margin: 0px 0px 25px; overflow: auto; font: 14px / 1.45 "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; background: rgb(247, 247, 247); overflow-wrap: break-word; white-space: pre-wrap;">

    1. apt-get update

    </pre>

    获取最新套件的信息。

    输入以下命令安装VNC,安装过程中需要输入Y来确认

    <pre class="prettyprint linenums prettyprinted" style="box-sizing: border-box; padding: 10px; margin: 0px 0px 25px; overflow: auto; font: 14px / 1.45 "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; background: rgb(247, 247, 247); overflow-wrap: break-word; white-space: pre-wrap;">

    1. apt-get install vnc4server

    </pre>

    b4473673-97dc-4f1e-bb1f-da6e7ea14a9a.png

    启动VNC

    <pre class="prettyprint linenums prettyprinted" style="box-sizing: border-box; padding: 10px; margin: 0px 0px 25px; overflow: auto; font: 14px / 1.45 "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; background: rgb(247, 247, 247); overflow-wrap: break-word; white-space: pre-wrap;">

    1. vncserver

    </pre>

    08a6f64b-ea14-46a9-9dc4-2c5fea11c3d5.png

    并设置密码

    0fa740c1-5ff9-49cd-a716-b8440cdf3f64.png

    看到 New ‘iZbp1idfrdpf1c3its2hpkZ:1 (root)’ desktop is iZbp1idfrdpf1c3its2hpkZ:1字样的时候,说明启动成功。

    76966a4f-c31a-4ba4-9a6f-aac73ac1c268.png

    gnome 桌面环境安装与配置

    安装x-windows的基础

    <pre class="prettyprint linenums prettyprinted" style="box-sizing: border-box; padding: 10px; margin: 0px 0px 25px; overflow: auto; font: 14px / 1.45 "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; background: rgb(247, 247, 247); overflow-wrap: break-word; white-space: pre-wrap;">

    1. sudo apt-get install x-window-system-core

    </pre>

    安装登录管理器

    <pre class="prettyprint linenums prettyprinted" style="box-sizing: border-box; padding: 10px; margin: 0px 0px 25px; overflow: auto; font: 14px / 1.45 "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; background: rgb(247, 247, 247); overflow-wrap: break-word; white-space: pre-wrap;">

    1. sudo apt-get install gdm

    </pre>

    安装Ubuntu的桌面

    <pre class="prettyprint linenums prettyprinted" style="box-sizing: border-box; padding: 10px; margin: 0px 0px 25px; overflow: auto; font: 14px / 1.45 "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; background: rgb(247, 247, 247); overflow-wrap: break-word; white-space: pre-wrap;">

    1. sudo apt-get install ubuntu-desktop

    </pre>

    安装gnome配套软件

    <pre class="prettyprint linenums prettyprinted" style="box-sizing: border-box; padding: 10px; margin: 0px 0px 25px; overflow: auto; font: 14px / 1.45 "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; background: rgb(247, 247, 247); overflow-wrap: break-word; white-space: pre-wrap;">

    1. sudo apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal

    </pre>

    修改VNC配置文件

    <pre class="prettyprint linenums prettyprinted" style="box-sizing: border-box; padding: 10px; margin: 0px 0px 25px; overflow: auto; font: 14px / 1.45 "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; background: rgb(247, 247, 247); overflow-wrap: break-word; white-space: pre-wrap;">

    1. vi ~/.vnc/xstartup

    </pre>

    修改为

    <pre class="prettyprint linenums prettyprinted" style="box-sizing: border-box; padding: 10px; margin: 0px 0px 25px; overflow: auto; font: 14px / 1.45 "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; background: rgb(247, 247, 247); overflow-wrap: break-word; white-space: pre-wrap;">

    1. #!/bin/sh

    2. # Uncomment the following two lines for normal desktop:

    3. export XKL_XMODMAP_DISABLE=1

    4. unset SESSION_MANAGER

    5. # exec /etc/X11/xinit/xinitrc

    6. unset DBUS_SESSION_BUS_ADDRESS

    7. gnome-panel &

    8. gnome-settings-daemon &

    9. metacity &

    10. nautilus &

    11. gnome-terminal &

    </pre>

    杀掉原桌面进程,输入命令(其中的:1是桌面号):

    <pre class="prettyprint linenums prettyprinted" style="box-sizing: border-box; padding: 10px; margin: 0px 0px 25px; overflow: auto; font: 14px / 1.45 "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; background: rgb(247, 247, 247); overflow-wrap: break-word; white-space: pre-wrap;">

    1. vncserver -kill :1

    </pre>

    输入以下命令生成新的会话:

    <pre class="prettyprint linenums prettyprinted" style="box-sizing: border-box; padding: 10px; margin: 0px 0px 25px; overflow: auto; font: 14px / 1.45 "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; background: rgb(247, 247, 247); overflow-wrap: break-word; white-space: pre-wrap;">

    1. vncserver :1

    </pre>

    开启VNC服务需要用到的5900和5901端口,具体可查看防火墙功能说明。

    8e91d9aa-3180-456a-ad97-f43c7e5fe998.png

    3. 本地使用VNC连接

    本地安装VNC后,使用ip地址:1的方式连接

    9f05c9f2-2098-4a9a-a1d8-52944a1a53a8.png

    输入之前设置的VNC密码后点击连接

    fc438f1b-42d8-4278-baeb-1a286b58451f.png

    连接成功即可看到Ubuntu桌面的界面了

    f2b82e11-5767-4652-a61c-41dffa057089.png

    相关文章

      网友评论

          本文标题:用VNC搭建Ubuntu VNC可视化界面

          本文链接:https://www.haomeiwen.com/subject/ndqaxhtx.html