原文:https://help.aliyun.com/knowledge_detail/59330.html
1. 创建Ubuntu服务器
访问轻量应用服务器购买页面,选择Ubuntu镜像,并选择套餐、购买时长,确认订单支付并确认。
084a89dc-7f1d-4b58-884b-339f8de5b39e.png2. 安装配置软件
创建服务器成功后,点击服务器列表页的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;">
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;">
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;">
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.pnggnome 桌面环境安装与配置
安装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;">
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;">
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;">
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;">
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;">
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;">
-
#!/bin/sh
-
# Uncomment the following two lines for normal desktop:
-
export XKL_XMODMAP_DISABLE=1
-
unset SESSION_MANAGER
-
# exec /etc/X11/xinit/xinitrc
-
unset DBUS_SESSION_BUS_ADDRESS
-
gnome-panel &
-
gnome-settings-daemon &
-
metacity &
-
nautilus &
-
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;">
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;">
vncserver :1
</pre>
开启VNC服务需要用到的5900和5901端口,具体可查看防火墙功能说明。
8e91d9aa-3180-456a-ad97-f43c7e5fe998.png
网友评论