4

配置Linux 的xrdp和VNC,让服务器支持GUI | damaoooo's blog

 9 months ago
source link: https://damaoooo.github.io/2023/09/26/%E9%85%8D%E7%BD%AELinux%20%E7%9A%84xrdp%E5%92%8CVNC%EF%BC%8C%E8%AE%A9%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%94%AF%E6%8C%81GUI/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

damaoooo's blog

配置Linux 的xrdp和VNC,让服务器支持GUI
发表于2023-09-26|更新于2023-09-26
阅读量:12

众所周知,由于X11设计上的原因,在网络条件不佳的情况下,其质量巨差,但是有时候在linux中又会不可避免的用到GUI,这个时候xrdp似乎成了一个更好的选择,本文将讲述如何使用xrdp在linux-server上进行远程桌面连接

1. XRDP

就像是windows的rdp一样的好用,但是xrdp是基于x11的,GUI的响应速度之比x11要好一些

1. 安装xrdp和xfce4

sudo apt install xfce4
sudo update-alternatives --config x-session-manager
# 选xfce4-sesion 回车
sudo apt install xrdp
sudo systemctl restart xrdp
# 开机自启,看情况开启
sudo systemctl enable xrdp

一般来说,这样就可以直接连接了,但是,如果遇到了问题,就继续下面的步骤

2. 配置key权限

sudo adduser xrdp ssl-cert  

3. 关闭主显示器的GUI

这一步你主显示器的GUI就没了

sudo systemctl start multi-user.target 
sudo systemctl set-default multi-user.target

要切换回来就得

sudo systemctl set-default graphical.target
sudo systemctl start graphical.target

重启!

4. 用root先登陆一次(奇怪的问题)

如果还是不管用,先用root登陆一次,然后再用普通用户来登录

2. 换用VNC

既然已经有xrdp了,默认你的xrdp已经通了,但是由于xrdp还是慢,换用VNC可能会好一些。
中途可能你还会遇到无数的💩。Linux Remote GUI还是太恼火了,还是老老实实本地虚拟机吧,或者是teamviewer这号的一键工具。

gsettings set org.gnome.Vino require-encryption false

然后设置-屏幕共享

打开屏幕共享就是VNC了


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK