neutrinolabs / xrdp

xrdp: an open source RDP server
http://www.xrdp.org/
Apache License 2.0
5.56k stars 1.73k forks source link

Can't get XRDP build running on Debian 11 #2935

Closed itxworks closed 6 months ago

itxworks commented 6 months ago

xrdp version

0.9.80

Detailed xrdp version, build options

xrdp -v
Argument 0 - xrdp
Argument 1 - -v
xrdp 0.9.80
  A Remote Desktop Protocol Server.
  Copyright (C) 2004-2020 Jay Sorg, Neutrino Labs, and all contributors.
  See https://github.com/neutrinolabs/xrdp for more information.

  Configure options:
      --enable-fuse
      --enable-jpeg
      --enable-rfxcodec
      --enable-mp3lame
      --enable-vsock
      --enable-devel-logging

  Compiled with OpenSSL 1.1.1w  11 Sep 2023

Operating system & version

Debian 11

Installation method

other

Which backend do you use?

Xorgrdp

What desktop environment do you use?

GNOME

Environment xrdp running on

VM - Proxmox

What's your client?

Mac, Linux

Area(s) with issue?

Other

Steps to reproduce

systemctl start xrdp -> systemctl statust xrdp
Unknown command verb statust.
root@nfndeterm://lib/systemd/system# systemctl status xrdp
● xrdp.service - xrdp daemon
     Loaded: loaded (/lib/systemd/system/xrdp.service; disabled; vendor preset: enabled)
     Active: failed (Result: signal) since Mon 2024-02-05 20:41:22 CET; 20s ago
       Docs: man:xrdp(8)
             man:xrdp.ini(5)
    Process: 17908 ExecStart=/usr/local/sbin/xrdp $XRDP_OPTIONS --nodaemon (code=killed, signal=SYS)
   Main PID: 17908 (code=killed, signal=SYS)
        CPU: 6ms

journalctl -u xrdp -u xrdp-sesman -f
-- Journal begins at Thu 2024-02-01 11:53:34 CET. --
Feb 05 20:41:22 nfndeterm xrdp-sesman[17907]: [INFO ] [main(sesman.c:924)] starting xrdp-sesman with pid 17907
Feb 05 20:41:22 nfndeterm systemd[1]: Starting xrdp daemon...
Feb 05 20:41:22 nfndeterm xrdp-sesman[17907]: [INFO ] [sesman_main_loop(sesman.c:475)] Sesman now listening on /var/run/xrdp/sesman.socket
Feb 05 20:41:22 nfndeterm systemd[1]: Started xrdp daemon.
Feb 05 20:41:22 nfndeterm systemd[1]: xrdp.service: Main process exited, code=killed, status=31/SYS
Feb 05 20:41:22 nfndeterm systemd[1]: xrdp.service: Failed with result 'signal'.
Feb 05 20:41:22 nfndeterm xrdp-sesman[17907]: [INFO ] [sesman_main_loop(sesman.c:524)] sesman_main_loop: sesman asked to terminate
Feb 05 20:41:22 nfndeterm systemd[1]: Stopping xrdp session manager...
Feb 05 20:41:22 nfndeterm systemd[1]: xrdp-sesman.service: Succeeded.
Feb 05 20:41:22 nfndeterm systemd[1]: Stopped xrdp session manager.

✔️ Expected Behavior

XRDP running as systemd service

❌ Actual Behavior

does not run as service - but via "xrdp-sesman -n & xrdp -n &"

Anything else?

-- Journal begins at Thu 2024-02-01 11:53:34 CET. --
Feb 05 20:55:57 nfndeterm xrdp-sesman[17937]: [INFO ] [main(sesman.c:924)] starting xrdp-sesman with pid 17937
Feb 05 20:55:57 nfndeterm systemd[1]: Starting xrdp daemon...
Feb 05 20:55:57 nfndeterm xrdp-sesman[17937]: [INFO ] [sesman_main_loop(sesman.c:475)] Sesman now listening on /var/run/xrdp/sesman.socket
Feb 05 20:55:57 nfndeterm systemd[1]: Started xrdp daemon.
Feb 05 20:55:57 nfndeterm systemd[1]: xrdp.service: Main process exited, code=killed, status=31/SYS
Feb 05 20:55:57 nfndeterm systemd[1]: xrdp.service: Failed with result 'signal'.
Feb 05 20:55:57 nfndeterm xrdp-sesman[17937]: [INFO ] [sesman_main_loop(sesman.c:524)] sesman_main_loop: sesman asked to terminate
Feb 05 20:55:57 nfndeterm systemd[1]: Stopping xrdp session manager...
Feb 05 20:55:57 nfndeterm systemd[1]: xrdp-sesman.service: Succeeded.
Feb 05 20:55:57 nfndeterm systemd[1]: Stopped xrdp session manager.

root@nfndeterm:/etc/xrdp# tail -n 50 /var/log/xrdp.log

root@nfndeterm:/etc/xrdp# tail -n 50 /var/log/xrdp-sesman.log

[2024-02-05T20:55:57.779+0100] [INFO ] [main(sesman.c:924)] starting xrdp-sesman with pid 17937
[2024-02-05T20:55:57.783+0100] [INFO ] [sesman_main_loop(sesman.c:475)] Sesman now listening on /var/run/xrdp/sesman.socket
[2024-02-05T20:55:57.789+0100] [INFO ] [sesman_main_loop(sesman.c:524)] sesman_main_loop: sesman asked to terminate
root@nfndeterm:/etc/xrdp#
matt335672 commented 6 months ago

Copied from #2221

The 'SYS' is down to xrdp using a system call it's not allowed to. See https://github.com/neutrinolabs/xrdp/pull/2697

itxworks commented 6 months ago
commit 8af430e19777a98e85b780b19288408fe08fcef5 (HEAD -> devel, origin/devel, origin/HEAD)
Author: matt335672 <30179339+matt335672@users.noreply.github.com>
Date:   Thu Feb 1 00:06:59 2024 +0000

    Fix regression in using window message names (#2925)

    FreeRDP defines macros WM_LBUTTONUP, WM_LBUTTONDOWN, WM_RBUTTONUP
    and WM_RBUTTONDOWN. These conflict with the definitions we have in
    xrdp_constants.h. Because the FreeRDP system includes followed the local
    includes however, the compiler did not emit a diagnostic for this -
    see gcc bug #16358.

    This PR rearranges the includes for NeutrinoRDP so the macro
    redefinitions are flagged by the compiler.

Feb  5 20:28:01 nfndeterm kernel: [89751.108745] audit: type=1326 audit(1707161281.640:31): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined pid=17863 comm="xrdp" exe="/usr/local/sbin/xrdp" sig=31 arch=c000003e syscall=10 compat=0 ip=0x7f45d56a1f57 code=0x80000000
Feb  5 20:41:22 nfndeterm kernel: [90552.096521] audit: type=1326 audit(1707162082.628:32): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined pid=17908 comm="xrdp" exe="/usr/local/sbin/xrdp" sig=31 arch=c000003e syscall=10 compat=0 ip=0x7fc780f31f57 code=0x80000000
Feb  5 20:55:57 nfndeterm kernel: [91427.252573] audit: type=1326 audit(1707162957.784:33): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined pid=17938 comm="xrdp" exe="/usr/local/sbin/xrdp" sig=31 arch=c000003e syscall=10 compat=0 ip=0x7f3f4a1a8f57 code=0x80000000```
matt335672 commented 6 months ago

Try applying ccead296e615b92afc17daf67447876fb3c122e0 to /usr/lib/systemd/system/xrdp.service

itxworks commented 6 months ago

That was the fix - thank you for your great work @matt335672

[Unit]
Description=xrdp daemon
Documentation=man:xrdp(8) man:xrdp.ini(5)
Requires=xrdp-sesman.service
After=network.target xrdp-sesman.service

[Service]
Type=exec
EnvironmentFile=-/etc/sysconfig/xrdp
EnvironmentFile=-/etc/default/xrdp
ExecStart=/usr/local/sbin/xrdp $XRDP_OPTIONS --nodaemon
SystemCallArchitectures=native
#SystemCallFilter=@basic-io @file-system @io-event @ipc @network-io @process @signal ioctl madvise sysinfo uname
SystemCallFilter=@basic-io @file-system @io-event @ipc @network-io @process @signal @system-service ioctl madvise sysinfo uname
SystemCallErrorNumber=EPERM

[Install]
WantedBy=multi-user.target
● xrdp.service - xrdp daemon
     Loaded: loaded (/lib/systemd/system/xrdp.service; disabled; vendor preset: enabled)
     Active: active (running) since Tue 2024-02-06 14:29:21 CET; 3min 27s ago
       Docs: man:xrdp(8)
             man:xrdp.ini(5)
   Main PID: 20197 (xrdp)
      Tasks: 2 (limit: 4638)
     Memory: 19.4M
        CPU: 1.092s
     CGroup: /system.slice/xrdp.service
             ├─20197 /usr/local/sbin/xrdp --nodaemon
             └─20206 /usr/local/sbin/xrdp --nodaemon

Feb 06 14:30:23 nfndeterm xrdp[20206]: [INFO ] [xrdp_wm_log_msg(xrdp_wm.c:2295)] xrdp_wm_log_msg: sesman connect ok
Feb 06 14:30:23 nfndeterm xrdp[20206]: [INFO ] [xrdp_wm_log_msg(xrdp_wm.c:2295)] xrdp_wm_log_msg: Performing login request for papm
Feb 06 14:30:23 nfndeterm xrdp[20206]: [INFO ] [xrdp_wm_log_msg(xrdp_wm.c:2295)] xrdp_wm_log_msg: login was successful - creating session
Feb 06 14:30:24 nfndeterm xrdp[20206]: [INFO ] [xrdp_wm_log_msg(xrdp_wm.c:2295)] xrdp_wm_log_msg: session is available on display 10 for user papm
Feb 06 14:30:24 nfndeterm xrdp[20206]: [INFO ] [xrdp_wm_log_msg(xrdp_wm.c:2295)] xrdp_wm_log_msg: Connecting to session
Feb 06 14:30:24 nfndeterm xrdp[20206]: [INFO ] [xrdp_mm_setup_mod1(xrdp_mm.c:360)] loaded module 'libxup.so' ok, interface size 10408, version 4
Feb 06 14:30:24 nfndeterm xrdp[20206]: [INFO ] [lib_mod_connect(xup.c:180)] lib_mod_connect: connecting via UNIX socket
Feb 06 14:30:24 nfndeterm xrdp[20206]: [INFO ] [lib_mod_connect(xup.c:207)] lib_mod_connect: connected to Xserver (Xorg) sck 21
Feb 06 14:30:24 nfndeterm xrdp[20206]: [INFO ] [lib_mod_log_peer(xup.c:76)] lib_mod_log_peer: xrdp_pid=20206 connected to Xorg_pid=20213 Xorg_uid=1000 Xorg_gid=1000 client=192.168.30.59:54766
Feb 06 14:30:24 nfndeterm xrdp[20206]: [INFO ] [xrdp_wm_log_msg(xrdp_wm.c:2295)] xrdp_wm_log_msg: Connecting to chansr
itxworks commented 6 months ago

Thank you. 🙏