Contents

在我们使用xrdp远程连接linux系统时,可能会遇到输入账号密码的时候,长时间蓝屏显示,随后显示错误:

1
2
connection problem,giving up
some problem

1.在查看日志后,似乎xRDP的xorgxrdp组件未按预期工作。在执行xRDP软件包的安装的时候,我们注意到控制台中显示的信息中提到需要xorgxrdp软件包:

1
2
3
4
5
6
7
8
9
10
11
root@ubuntu_server18_04:/home/medical_information# sudo apt-get install xrdp
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
guacamole xrdp-pulseaudio-installer
Recommended packages:
xorgxrdp //这里建议安装xorgxrdp组件
The following NEW packages will be installed:
xrdp
0 upgraded, 1 newly installed, 0 to remove and 37 not upgraded.

2.于是我们再安装xorgxrdp, 这时会提示需要安装两个依赖包:

1
2
xorgxrdp : Depends: xorg-video-abi-24
Depends: xserver-xorg-core-hwe-18.04 (>= 2:1.18.99.901) but it is not going to be installed

3.需要我们手动安装:

1
2
sudo apt-get install xorg-video-abi-24
sudo apt-get install xserver-xorg-core-hwe-18.04

4.继续安装xorgxrdp:

1
sudo apt-get install xorgxrdp

5.重启xrdp即可解决连接蓝屏问题:

1
sudo service xrdp restart

另一个问题,在我卸载xrdp后重新安装时无法启动,因为安装xrdp时会自动启动,所以在安装时就显示了错误如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
● xrdp.service - xrdp daemon
Loaded: loaded (/lib/systemd/system/xrdp.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2020-08-04 01:16:40 UTC; 12min ago
Docs: man:xrdp(8)
man:xrdp.ini(5)
Main PID: 2134 (code=exited, status=0/SUCCESS)

Aug 04 01:16:40 ubuntu_server18_04 systemd[1]: Starting xrdp daemon...
Aug 04 01:16:40 ubuntu_server18_04 xrdp[17448]: (17448)(140181056251712)[DEBUG] Testing if xrdp can listen on 0.0.0.0 port 3389.
Aug 04 01:16:40 ubuntu_server18_04 xrdp[17448]: (17448)(140181056251712)[ERROR] g_tcp_bind(7, 3389) failed bind IPv6 (errno=98) and IPv4 (errno=22).
Aug 04 01:16:40 ubuntu_server18_04 xrdp[17448]: (17448)(140181056251712)[DEBUG] Closed socket 7 (AF_INET6 :: port 0)
Aug 04 01:16:40 ubuntu_server18_04 xrdp[17448]: (17448)(140181056251712)[ERROR] Failed to start xrdp daemon, possibly address already in use.
Aug 04 01:16:40 ubuntu_server18_04 systemd[1]: xrdp.service: Control process exited, code=exited status=1
Aug 04 01:16:40 ubuntu_server18_04 systemd[1]: xrdp.service: Failed with result 'exit-code'.
Aug 04 01:16:40 ubuntu_server18_04 systemd[1]: Stopped xrdp daemon.

问题显示,xrdp-sesman绑定端口3389错误,xrdp监听错误,端口可能正在使用中。百度没有查到解决方案,google检索发现是因为禁用ipv6导致的,但是我没有做过此类操作,查看配置文件也是没有更改ipv6属性的。
于是我在卸载xrdp之后查看进程情况:

1
2
sudo apt-get autoremove xrdp
lsof -i

发现xrdp进程依旧存在并占用了3389端口:

1
xrdp      28081                xrdp   11u  IPv6 811797      0t0  TCP *:3389 (LISTEN)

于是我kill掉了相关进程:

1
kill 28081

再安装xrdp,成功启动。

Contents