# Ubuntu云服安装远程卓面（支持网页连接）

**URL:** <https://forum.rainyun.com/t/topic/5702>\
**Category:** 云服务器 RCS\
**Created:** [2023 年10 月 21 日 07:11 UTC](https://forum.rainyun.com/t/topic/5702 "2023-10-21T07:11:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

作者： ![YHL12345656](https://forum.rainyun.com/letter_avatar_proxy/v4/letter/y/9d8465/32.png) [@YHL12345656](https://forum.rainyun.com/u/YHL12345656)\
发布日期： [2023 年10 月 21 日 07:11 UTC](https://forum.rainyun.com/t/topic/5702/1 "2023-10-21T07:11:40Z")

</div>

**一、安装桌面环境（可选）**  
Ubuntu系统在server镜像版本中是没有桌面环境，仅支持使用bash控制的。为了让系统能够被链接，需要安装桌面环境。  
_ **（若系统已经安装桌面环境请跳过）** _

1、打开远程连接，使用 `sudo su` 命令进入root。  
2、更新apt源站。_ **（若系统为非大陆区域请跳过）** _  
由于apt站点在国内的访问速度很慢，需要先调整apt至镜像源。此处使用清华源演示。  
在终端中使用命令：`sudo vi /etc/apt/sources.list` 打开vim编辑器，将文件内容全部清空并替换为：

```auto
# 默认注释了源码镜像以提高 apt update 速度，如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse

# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse

# 预发布软件源，不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse

```

保存。

3、同步apt包  
将apt列表同步至最新状态。

```auto
sudo apt update

```

**方法一 使用tasksel**

4、安装tasksel  
tasksel是一个常用图形化包管理器。稍后，我们将使用它安装桌面环境。

```auto
sudo apt installl tasksel -y

```

5、安装桌面环境  
首先，打开tasksel：

```auto
sudo tasksel

```

效果如图：

 ![屏幕截图 2023-10-21 134603](https://forum.rainyun.com/uploads/default/original/2X/b/b92556a79dbd1172e509693a778a506e58a5b6fe.png)  
使用上下方向键移动，找到“Ubuntu Desktop"并按下空格键选择

接着，依次按下[Tab键]和[Enter]开始安装，并等待安装完成。(此步骤需要很长时间）

**方法二 直接apt**  
直接使用  
`sudo apt install ubuntu-desktop -y`

安装。(此步骤需要很长时间）

**二、安装并启动远程桌面服务器** （必要）  
使用 `sudo apt install tigitvncserver -y` 安装vnc桌面服务器。vnc可以通过客户端连接，也可通过网页版连接。

_安装完成之后，必须使用 `sudo reboot` 重启_

重启后,使用`vncserver`命令开启远程桌面服务器。

> 首次启动将请求设定远程桌面密码。

三、连接到远程桌面

1. 安装网页版连接器  
网页版连接器名：novnc  
在[Github仓库](https://github.com/novnc/noVNC)中下载Novnc并上传至服务器。  
（也可直接使用`wget https://github.com/novnc/noVNC/archive/refs/tags/v1.4.0.tar.gz`)

> 由于github在国内访问不稳定，可以尝试使用镜像方法下载。将链接中"[github.com](http://github.com)"改为"[kkgithub.com](http://kkgithub.com)"即可。

下载完成后，输入`tar -zxf noVNC-1.1.0.tar.gz`解压即可。

> 代码中的 noVNC-1.1.0.tar.gz 请自行替换为下载的文件名。

接下来，创建安全连接，保证连接的安全性。执行如下代码，一路回车。

```auto
cd ./noVNC/utils/ 
openssl req -new -x509 -days 365 -nodes -out self.pem -keyout self.pem

```

最后，执行如下命令启动远程连接。

```auto
sudo ./novnc_proxy --vnc localhost:5901

```

网页服务器将在6080端口启动。

> 注：每次重启均需要手动开启vncserver和novnc。运行novnc前请确保已切换至./noVNC/utils/ 目录.

---

<div class="post-metadata">

作者： ![HiYaawa](https://forum.rainyun.com/user_avatar/forum.rainyun.com/hiyaawa/32/5046_2.png) [@HiYaawa](https://forum.rainyun.com/u/HiYaawa)\
发布日期： [2024 年7 月 1 日 01:51 UTC](https://forum.rainyun.com/t/topic/5702/2 "2024-07-01T01:51:03Z")

</div>

标题错了，哥  
是远程桌面吧，怎么变远程卓面了（

---

<div class="post-metadata">

作者： ![YHL12345656](https://forum.rainyun.com/letter_avatar_proxy/v4/letter/y/9d8465/32.png) [@YHL12345656](https://forum.rainyun.com/u/YHL12345656)\
发布日期： [2024 年7 月 7 日 03:33 UTC](https://forum.rainyun.com/t/topic/5702/3 "2024-07-07T03:33:00Z")

</div>

桌面  
怪微软（
