我正在尝试通过 xRDP 从 Win10 连接到我最近安装的 Bodhi Linux。我可以从这个客户端连接到许多其他 Ubuntu 服务器。这是我第一次接触Bodhi,但一切看起来都很熟悉。
我该如何解决这个问题,或者至少诊断?
下面我就贴出相关信息。
来自日志
$ tail -30 /var/log/xrdp.log
...
[20220405-08:12:37] [INFO ] TLS connection established from ::ffff:192.168.0.71 port 60854: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384
[20220405-08:12:37] [DEBUG] xrdp_000007ad_wm_login_mode_event_00000001
[20220405-08:12:37] [INFO ] Loading keymap file /etc/xrdp/km-0000080a.ini
[20220405-08:12:37] [WARN ] local keymap file for 0x0000080a found and doesn't match built in keymap, using local keymap file
[20220405-08:12:42] [DEBUG] xrdp_wm_log_msg: connecting to sesman ip 127.0.0.1 port 3350
[20220405-08:12:42] [INFO ] xrdp_wm_log_msg: sesman connect ok
[20220405-08:12:42] [DEBUG] xrdp_wm_log_msg: sending login info to session manager, please wait...
[20220405-08:12:42] [DEBUG] return value from xrdp_mm_connect 0
[20220405-08:12:43] [INFO ] xrdp_wm_log_msg: login successful for display 13
[20220405-08:12:43] [DEBUG] xrdp_wm_log_msg: started connecting
[20220405-08:12:44] [INFO ] lib_mod_log_peer: xrdp_pid=1965 connected to X11rdp_pid=1973 X11rdp_uid=1000 X11rdp_gid=1000 client_ip=::ffff:192.168.0.71 client_port=60854
[20220405-08:12:44] [DEBUG] xrdp_wm_log_msg: connected ok
[20220405-08:12:44] [DEBUG] xrdp_mm_connect_chansrv: chansrv connect successful
[20220405-08:12:44] [DEBUG] Closed socket 18 (AF_INET6 ::1 port 32828)
[20220405-08:12:45] [DEBUG] Closed socket 12 (AF_INET6 ::ffff:192.168.0.176 port 3389)
[20220405-08:12:45] [DEBUG] xrdp_mm_module_cleanup
[20220405-08:12:45] [DEBUG] Closed socket 19 (AF_UNIX)
[20220405-08:12:45] [DEBUG] Closed socket 20 (AF_UNIX)
$ tail -30 /var/log/xrdp-sesman.log
...
[20220405-08:12:42] [INFO ] A connection received from ::1 port 32828
[20220405-08:12:42] [INFO ] ++ created session (access granted): username user1, ip ::ffff:192.168.0.71:60854 - socket: 12
[20220405-08:12:43] [INFO ] starting Xorg session...
[20220405-08:12:43] [DEBUG] Closed socket 9 (AF_INET6 :: port 5910)
[20220405-08:12:43] [ERROR] g_tcp_bind(9, 6010) failed bind IPv6 (errno=98) and IPv4 (errno=22).
[20220405-08:12:43] [DEBUG] Closed socket 9 (AF_INET6 :: port 0)
[20220405-08:12:43] [DEBUG] Closed socket 9 (AF_INET6 :: port 5911)
[20220405-08:12:43] [DEBUG] Closed socket 9 (AF_INET6 :: port 6011)
[20220405-08:12:43] [DEBUG] Closed socket 9 (AF_INET6 :: port 6211)
[20220405-08:12:43] [DEBUG] Closed socket 9 (AF_INET6 :: port 5912)
[20220405-08:12:43] [DEBUG] Closed socket 9 (AF_INET6 :: port 6012)
[20220405-08:12:43] [DEBUG] Closed socket 9 (AF_INET6 :: port 6212)
[20220405-08:12:43] [DEBUG] Closed socket 9 (AF_INET6 :: port 5913)
[20220405-08:12:43] [DEBUG] Closed socket 9 (AF_INET6 :: port 6013)
[20220405-08:12:43] [DEBUG] Closed socket 9 (AF_INET6 :: port 6213)
[20220405-08:12:43] [DEBUG] Closed socket 8 (AF_INET6 ::1 port 3350)
[20220405-08:12:43] [INFO ] calling auth_start_session from pid 1966
[20220405-08:12:43] [DEBUG] Closed socket 7 (AF_INET6 ::1 port 3350)
[20220405-08:12:43] [DEBUG] Closed socket 8 (AF_INET6 ::1 port 3350)
[20220405-08:12:43] [INFO ] /usr/lib/xorg/Xorg :13 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log
[20220405-08:12:43] [CORE ] waiting for window manager (pid 1972) to exit
[20220405-08:12:45] [CORE ] window manager (pid 1972) did exit, cleaning up session
[20220405-08:12:45] [INFO ] calling auth_stop_session and auth_end from pid 1966
[20220405-08:12:45] [DEBUG] cleanup_sockets:
[20220405-08:12:45] [DEBUG] cleanup_sockets: deleting /run/xrdp/sockdir/xrdp_chansrv_audio_out_socket_13
[20220405-08:12:45] [DEBUG] cleanup_sockets: deleting /run/xrdp/sockdir/xrdp_chansrv_audio_in_socket_13
[20220405-08:12:45] [DEBUG] cleanup_sockets: deleting /run/xrdp/sockdir/xrdpapi_13[20220405-08:12:45] [INFO ] ++ terminated session: username user1, display :13.0, session_pid 1966, ip ::ffff:192.168.0.71:60854 - socket: 12
$ cat .xorgxrdp.13.log.old
[ 2936.394]
X.Org X Server 1.20.13
X Protocol Version 11, Revision 0
...
[ 2936.397] (++) Log file: ".xorgxrdp.13.log", Time: Tue Apr 5 08:12:43 2022
[ 2936.398] (++) Using config file: "/etc/X11/xrdp/xorg.conf"
[ 2936.398] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[ 2936.399] (==) ServerLayout "X11 Server"
[ 2936.399] (**) |-->Screen "Screen (xrdpdev)" (0)
[ 2936.399] (**) | |-->Monitor "Monitor"
[ 2936.400] (**) | |-->Device "Video Card (xrdpdev)"
[ 2936.400] (**) |-->Input Device "xrdpMouse"
[ 2936.400] (**) |-->Input Device "xrdpKeyboard"
[ 2936.400] (**) Option "DontVTSwitch" "on"
[ 2936.400] (**) Option "AutoAddDevices" "off"
...
防火墙状态。后来添加了规则3和规则5,但并没有解决问题。
$ sudo ufw status
Status: active
To Action From
-- ------ ----
22/tcp ALLOW Anywhere
3389 ALLOW 192.168.0.0/24
3389 ALLOW Anywhere
22/tcp (v6) ALLOW Anywhere (v6)
3389 (v6) ALLOW Anywhere (v6)
答案1
对我来说,它有效(Ubuntu-20.40)将会话管理器更改为xfce4这样:
$ update-alternatives --config x-session-manager
There are 3 choices for the alternative x-session-manager (providing /usr/bin/x-session-manager).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/gnome-session 50 auto mode
1 /usr/bin/gnome-session 50 manual mode
2 /usr/bin/startxfce4 50 manual mode
3 /usr/bin/xfce4-session 40 manual mode
Press <enter> to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/bin/startxfce4 to provide /usr/bin/x-session-manager (x-session-manager) in manual mode
再次运行命令(只是为了检查)
$ sudo update-alternatives --config x-session-manager
There are 3 choices for the alternative x-session-manager (providing /usr/bin/x-session-manager).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/bin/startxfce4 50 auto mode
1 /usr/bin/gnome-session 50 manual mode
* 2 /usr/bin/startxfce4 50 manual mode
3 /usr/bin/xfce4-session 40 manual mode
Press <enter> to keep the current choice[*], or type selection number: