最近在做windows RDP远程连接 linux桌面,期初使用CentOS 桌面版本,测试过程中发现CentOS的好多依赖包比较老,就转而测试Ubuntu了,目前最新的LTS是18.04.x,这里使用虚拟机进行测试版本版本是18.04.2,为了方便首先制作了一个镜像模版,后续测试都是通过镜像模版创建的虚拟机测试的。
什么是xRDP?
xrdp is a daemon that supports Microsoft's Remote Desktop Protocol (RDP). It uses Xvnc, X11rdp or xorgxrdp as a backend.
与VNC Server什么关系?
After starting xrdp you can point any RDP client to localhost (on standard RDP port 3389) xrdp will give a small message window.
When you choose sessman-Xvnc you can give a username and password for any account on your host and xrdp will start another Xvnc instance for you. Opening a window manager out of a SESSION list provided in /etc/xrdp/startwm.sh
.
xrdp 需要 vnc 支持才能完成远程。其实这要是在测试了众多方案后的醒悟T_T.
网上大多数方案都是类似https://www.laozuo.org/12122.html 中安装另外的桌面xubuntu-desktop,而非Ubuntu自带桌面;既然选择了Ubuntu就希望用“原生”的桌面,后来测试了https://www.cnblogs.com/xuliangxing/p/7560723.html,还是无法RDP远程,又求助于Google找到了http://c-nergy.be/blog/?p=13663,然并卵从3.0到2.4,再到1.9都不行。
无意间搜到https://blog.csdn.net/star2523/article/details/81152890,其中选用的协议vnc-any 很关键,简化配置如下:
配置RDP远程需要 xrdp,vnc支持
在Ubuntu 18.04 开启 VNCServer 更多细节请参考https://blog.csdn.net/yidichaxiang/article/details/100533237
目前开启 VNC 可以有三个方式,Ubuntu sharing,x11vnc , RealVNC
RealVNC对VNC协议有些修改,用开源的vnc Client 无法连接
测试 Ubuntu sharing
sudo apt install vino
sudo apt install dconf-editor
开启 Sharing
配置访问权限,使用dconf-editor 关闭/org/gnome/desktop/remote-access/ 中的 require-encryption
sudo apt install xrdp
sudo systemctl enable xrdp.service
测试 Windows 远程连接 Ubuntu
至此可以远程Linux了。