You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 22.04服务器无法通过RDP连接的问题求助

Ubuntu 22.04服务器无法通过RDP连接的问题求助

大家好,我最近碰到个头疼的问题——没法通过RDP连接我的Ubuntu服务器,折腾了好一阵都没搞定,想请各位大佬帮忙看看。

远程桌面连接返回的错误信息

[Window Title]
Remote Desktop Connection

[Content]
Remote Desktop can't connect to the remote computer for one of these reasons:

Remote access to the server is not enabled
The remote computer is turned off
The remote computer is not available on the network

Make sure the remote computer is turned on and connected to the network, and that remote access is enabled.

[Expanded Information]
Error code: 0x204
Extended error code: 0x0

我安装xrdp的步骤

我参考了好几个不同的安装指南,就怕漏装依赖包,还特意装了net-tools用来排查网络问题,具体命令如下:

sudo apt-get update
sudo apt install xfce4 xfce4-goodies xrdp net-tools xorg dbus-x11 x11-xserver-utils

后续的配置操作:

sudo systemctl status xrdp  # 检查xrdp服务是否运行
sudo adduser xrdp ssl-cert
sudo systemctl restart xrdp
sudo ufw allow from any to any port 3389
sudo ufw allow 3389

我已经尝试过的解决方案

  • 用netstat确认xrdp正在监听3389端口
  • 确认3389端口已经在UFW防火墙中开放
  • 确认VM托管服务商那边已经开放了对应的端口
  • 检查xrdp.ini配置文件,确保没有错误设置
  • 确认配置里的use_vsocket=false
  • 关闭了系统的自动登录功能
  • 先登出Ubuntu账户再尝试RDP连接,结果还是报错
  • 重启过服务器好几次
  • 用journalctl -u xrdp查看xrdp日志,发现日志里完全没有连接请求的记录

可能有用的补充信息

  • 我尝试连接用的是VM初始化时创建的默认用户「ubuntu」,这个用户拥有sudo权限
  • 我是Linux新手,对很多系统配置细节还不太熟悉

备注:内容来源于stack exchange,提问作者gunter

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.22 08:19:38