xrdp 连接黑屏修复
引言
今天发现 xrdp 的日志太大了直接挤满了硬盘,而删除了之后因为 xrdp 仍在使用无法释放空间,所以需要关闭应用并重启。但是重启之后无法登录 (黑屏) 了,所以只好修复一下。
查阅后发现是因为在没有注销的情况下进行了重启1, 因此针对性解决并优化。
系统版本:Ubuntu 22.04.3 LTS
效果展示
过程
安装并启动 dbus-x11
最重要的事情是安装 dbus-x11 并在 /etc/xrdp/startwm.sh 中加入相关代码2.
## 安装并启动 dbus-x11
sudo apt install dbus-x11
dbus-launch修改 startwm.sh
代码语言:bash复制sudo vim /etc/xrdp/startwm.shInside the script, add the following line:
在脚本内部,添加以下行:
代码语言:bash复制export $(dbus-launch)Ensure that the line is added before the following lines:
在以下行之前确保添加该行:
代码语言:bash复制test -x /etc/X11/Xsession && exec /etc/X11/Xsession
exec /bin/sh /etc/X11/XsessionSave the changes and exit the editor.
保存更改并退出编辑器。
重启 xrdp 服务生效:
代码语言:bash复制sudo systemctl restart xrdp优化
之后是优化 xrdp 的体验,减少卡顿3.
调整 Xrdp 配置参数:
编辑 /etc/xrdp/xrdp.ini
tcp_send_buffer_bytes=4194304
tcp_recv_buffer_bytes=6291456tcp_send_buffer_bytes, tcp_recv_buffer_bytes 两个参数默认被注释了,注释默认值(32768),根据实际情况进行调整。
调整系统参数:
临时生效:
代码语言:bash复制sudo sysctl -w net.core.rmem_max=12582912
sudo sysctl -w net.core.wmem_max=8388608重启后保留:
将以下内容写入配置文件 /etc/sysctl.conf:
net.core.rmem_max = 12582912
net.core.wmem_max = 8388608然后执行:
代码语言:bash复制sudo sysctl -p重启 xrdp 服务生效:
代码语言:bash复制sudo systemctl restart xrdp结论
引用
- 完美方案——解决 XRDP 连接黑屏,以及桌面优化!
- Remote Desktop from Windows onto Ubuntu 22.04 takes me to a XRDP login then a blank screen - Ask Ubuntu
- Xrdp 体验优化 减少/解决画面卡顿


发布评论