# 远程桌面访问 #### **教程中将学习** - 如何在 Ubuntu 上共享桌面 - 如何打开 Windows 10 客户端 - 如何远程连接到 Ubuntu 桌面共享 [![来自 Windows 10 的 Ubuntu 20.04 远程桌面访问](https://linuxconfig.org/wp-content/uploads/2020/02/06-ubuntu-20-04-remote-desktop-access-from-windows-10.png)](https://linuxconfig.org/wp-content/uploads/2020/02/06-ubuntu-20-04-remote-desktop-access-from-windows-10.png "来自 Windows 10 的 Ubuntu 20.04 远程桌面访问")
来自 Windows 10 的 Ubuntu 20.04 远程桌面访问
## 使用的软件要求和约定
软件要求和 Linux 命令行约定
类别使用的要求、约定或软件版本
系统[安装 Ubuntu 20.04](https://linuxconfig.org/how-to-install-ubuntu-20-04-focal-fossa-desktop)或[升级 Ubuntu 20.04 Focal Fossa](https://linuxconfig.org/how-to-upgrade-ubuntu-to-20-04-lts-focal-fossa)
软件不适用
其他`sudo`以 root 身份或通过命令特权访问您的 Linux 系统。
约定**\#** – 要求给定的[linux 命令](https://linuxconfig.org/linux-commands)以 root 权限直接作为 root 用户或使用`sudo`命令执行 **$** – 要求给定的[linux 命令](https://linuxconfig.org/linux-commands)以普通非特权用户的身份执行
## Windows 10 的 Ubuntu 20.04 远程桌面分步说明 1. 第一步是`xrdp`在 Ubuntu 20.04 桌面上安装远程桌面协议 (RDP) 服务器。为此,请执行以下命令: ``` $ sudo apt install xrdp ``` 2. 重新启动后启用并运行远程桌面共享服务器`xrdp`: ``` $ sudo systemctl enable --now xrdp ``` 3. 仍然在 Ubuntu 20.04 桌面上,为传入流量 [打开防火墙端口:](https://linuxconfig.org/how-to-open-allow-incoming-firewall-port-on-ubuntu-20-04-focal-fossa) `3389```` $ sudo ufw 允许从任何到任何端口 3389 proto tcp ``` 1. 移动到 Windows 10 主机并打开远程桌面连接客户端。使用搜索框搜索`remote`关键字并单击`Open`按钮。 [![移动到 Windows 10 主机并打开远程桌面连接客户端。](https://linuxconfig.org/wp-content/uploads/2020/02/01-ubuntu-20-04-remote-desktop-access-from-windows-10.png)](https://linuxconfig.org/wp-content/uploads/2020/02/01-ubuntu-20-04-remote-desktop-access-from-windows-10.png "移动到 Windows 10 主机并打开远程桌面连接客户端。")
移动到 Windows 10 主机并打开远程桌面连接客户端。
- - - - - -
- - - - - - 2. 输入 Ubuntu 的远程桌面共享 IP 地址或主机名。或者,允许 Windows 10 保存您的凭据。 [![输入 Ubuntu 的远程桌面共享 IP 地址或主机名](https://linuxconfig.org/wp-content/uploads/2020/02/02-ubuntu-20-04-remote-desktop-access-from-windows-10.png)](https://linuxconfig.org/wp-content/uploads/2020/02/02-ubuntu-20-04-remote-desktop-access-from-windows-10.png "输入 Ubuntu 的远程桌面共享 IP 地址或主机名")
输入 Ubuntu 的远程桌面 IP 或主机名
3. `Yes`消息提示时单击: `The identity of the remote computer cannot be verified`。 [![无法验证远程计算机的身份](https://linuxconfig.org/wp-content/uploads/2020/02/03-ubuntu-20-04-remote-desktop-access-from-windows-10.png)](https://linuxconfig.org/wp-content/uploads/2020/02/03-ubuntu-20-04-remote-desktop-access-from-windows-10.png "无法验证远程计算机的身份")
您可以在此提示上单击是。
4. 输入远程 Ubuntu 用户的密码。 [![输入远程 Ubuntu 用户的密码。](https://linuxconfig.org/wp-content/uploads/2020/02/04-ubuntu-20-04-remote-desktop-access-from-windows-10.png)](https://linuxconfig.org/wp-content/uploads/2020/02/04-ubuntu-20-04-remote-desktop-access-from-windows-10.png "输入远程 Ubuntu 用户的密码。")
输入我们的 Ubuntu 密码。
5. 您现在应该从 Windows 10 计算机远程连接到 Ubuntu 桌面共享。 - - - - - -
- - - - - - [![您现在应该从 Windows 10 计算机远程连接到 Ubuntu 桌面共享。](https://linuxconfig.org/wp-content/uploads/2020/02/05-ubuntu-20-04-remote-desktop-access-from-windows-10.png)](https://linuxconfig.org/wp-content/uploads/2020/02/05-ubuntu-20-04-remote-desktop-access-from-windows-10.png "您现在应该从 Windows 10 计算机远程连接到 Ubuntu 桌面共享。")
成功连接。
## 从 Windows 到 Ubuntu 20.04 的远程桌面故障排除 ### Xrdp 黑屏 [![xrdp黑屏bug](https://linuxconfig.org/wp-content/uploads/2020/02/07-ubuntu-20-04-remote-desktop-access-from-windows-10.png)](https://linuxconfig.org/wp-content/uploads/2020/02/07-ubuntu-20-04-remote-desktop-access-from-windows-10.png "xrdp黑屏bug")
在启动与 Xrdp 远程桌面协议 (RDP) 服务器的远程连接后,我有时会收到黑屏。虽然我不确定如何完全解决这个问题,但在建立远程连接之前从 Ubuntu 桌面注销至少暂时解决了这个问题。