Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xorgxrdp sometimes requires Xorg.wrap to start on FreeBSD/DragonFlyBSD #2477

Closed
CaptKentish opened this issue Dec 18, 2022 · 24 comments
Closed

Comments

@CaptKentish
Copy link

CaptKentish commented Dec 18, 2022

Hi, I'm using Dragonflybsd.
xrdp 0.9.20,1 - xorgxrdp 0.9.19

When I try to connect on my local network from windows using rdp, I can enter my user informations but after a while I've got an error and the login screen reappear.

xrdp.log :

[20221218-15:41:53] [INFO ] Socket 14: AF_INET connection received from 192.168.1.12 port 63971
[20221218-15:41:53] [INFO ] Using default X.509 certificate: /usr/local/etc/xrdp/cert.pem
[20221218-15:41:53] [INFO ] Using default X.509 key file: /usr/local/etc/xrdp/key.pem
[20221218-15:41:53] [INFO ] Security protocol: configured [SSL|RDP], requested [SSL|HYBRID|HYBRID_EX|RDP], selected [SSL[20221218-15:41:53] [ERROR] SSL_read: I/O error
[20221218-15:41:53] [ERROR] libxrdp_force_read: header read error
[20221218-15:41:53] [ERROR] Processing [ITU-T T.125] Connect-Initial failed
[20221218-15:41:53] [ERROR] [MCS Connection Sequence] receive connection request failed
[20221218-15:41:53] [ERROR] xrdp_sec_incoming: xrdp_mcs_incoming failed
[20221218-15:41:53] [ERROR] xrdp_rdp_incoming: xrdp_sec_incoming failed
[20221218-15:41:53] [ERROR] xrdp_process_main_loop: libxrdp_process_incoming failed
[20221218-15:41:53] [ERROR] xrdp_iso_send: trans_write_copy_s failed
[20221218-15:41:53] [WARN ] getsockname() failed on socket 14: Connection reset by peer
[20221218-15:41:53] [ERROR] Sending [ITU T.125] DisconnectProviderUltimatum failed
[20221218-15:41:53] [INFO ] Socket 14: AF_INET connection received from 192.168.1.12 port 63972
[20221218-15:41:53] [INFO ] Using default X.509 certificate: /usr/local/etc/xrdp/cert.pem
[20221218-15:41:53] [INFO ] Using default X.509 key file: /usr/local/etc/xrdp/key.pem
[20221218-15:41:53] [INFO ] Security protocol: configured [SSL|RDP], requested [SSL|HYBRID|HYBRID_EX|RDP], selected [SSL[20221218-15:41:53] [INFO ] Connected client computer name: LAPTOP-5H7102E9
[20221218-15:41:53] [WARN ] Received [MS-RDPBCGR] TS_UD_HEADER type 0xc006 is unknown (ignored)
[20221218-15:41:53] [WARN ] Received [MS-RDPBCGR] TS_UD_HEADER type 0xc00a is unknown (ignored)
[20221218-15:41:53] [INFO ] xrdp_load_keyboard_layout: Keyboard information sent by the RDP client, keyboard_type:[0x04][20221218-15:41:53] [INFO ] xrdp_load_keyboard_layout: model [] variant [] layout [fr] options []
[20221218-15:41:53] [INFO ] TLS connection established from 192.168.1.12 port 63972: TLSv1.2 with cipher ECDHE-RSA-AES25[20221218-15:41:53] [INFO ] xrdp_caps_process_pointer: client supports new(color) cursor
[20221218-15:41:53] [INFO ] xrdp_process_offscreen_bmpcache: support level 1 cache size 10485760 MB cache entries 100
[20221218-15:41:53] [INFO ] xrdp_caps_process_codecs: nscodec, codec id 1, properties len 3
[20221218-15:41:53] [WARN ] xrdp_caps_process_codecs: unknown codec id 5
[20221218-15:41:53] [INFO ] xrdp_caps_process_codecs: RemoteFX, codec id 3, properties len 49
[20221218-15:41:53] [INFO ] Loading keymap file /usr/local/etc/xrdp/km-0000040c.ini
[20221218-15:41:53] [WARN ] local keymap file for 0x0000040c found and doesn't match built in keymap, using local keymap[20221218-15:42:05] [INFO ] connecting to sesman on 127.0.0.1:3350
[20221218-15:42:05] [INFO ] xrdp_wm_log_msg: sesman connect ok
[20221218-15:42:05] [INFO ] sesman connect ok
[20221218-15:42:05] [INFO ] sending login info to session manager. Please wait...
[20221218-15:42:05] [INFO ] xrdp_wm_log_msg: login successful for user damien on display 10
[20221218-15:42:05] [INFO ] login successful for user damien on display 10
[20221218-15:42:05] [INFO ] loaded module 'libxup.so' ok, interface size 10296, version 4
[20221218-15:42:05] [INFO ] started connecting
[20221218-15:42:05] [INFO ] lib_mod_connect: connecting via UNIX socket
[20221218-15:45:35] [INFO ] connection problem, giving up
[20221218-15:45:35] [INFO ] some problem
[20221218-15:45:35] [ERROR] xrdp_wm_log_msg: Error connecting to user session
[20221218-15:45:35] [INFO ] Error connecting to user session

xrdp-sesman.log :
`[20221218-15:42:05] [INFO ] Socket 12: AF_INET6 connection received from ::1 port 2464
[20221218-15:42:05] [INFO ] Terminal Server Users group is disabled, allowing authentication
[20221218-15:42:05] [INFO ] ++ created session (access granted): username damien, ip 192.168.1.12:63972 - socket: 14
[20221218-15:42:05] [INFO ] starting Xorg session...
[20221218-15:42:05] [INFO ] Starting session: session_pid 2067, display :10.0, width 1364, height 768, bpp 24, client ip[20221218-15:42:05] [ERROR] sesman_data_in: scp_process_msg failed
[20221218-15:42:05] [ERROR] sesman_main_loop: trans_check_wait_objs failed, removing trans
[20221218-15:42:05] [INFO ] [session start] (display 10): calling auth_start_session from pid 2067
[20221218-15:42:05] [INFO ] PAM: Last login: Sun Dec 18 14:44:57 2022 from 192.168.1.12 on pts/0

[20221218-15:42:05] [INFO ] Starting X server on display 10: /usr/local/libexec/Xorg :10 -auth .Xauthority -config xrdp/[20221218-15:42:15] [WARN ] Timed out waiting for X server on display 10 to startup
[20221218-15:42:15] [INFO ] Session started successfully for user damien on display 10
[20221218-15:42:15] [INFO ] Session in progress on display 10, waiting until the window manager (pid 2069) exits to end
[20221218-15:42:15] [INFO ] Starting the xrdp channel server for display 10
[20221218-15:42:15] [WARN ] Timed out waiting for X server on display 10 to startup
[20221218-15:42:15] [ERROR] There is no X server active on display 10
[20221218-15:42:15] [ERROR] A fatal error has occurred attempting to start the window manager on display 10, aborting co[20221218-15:42:15] [WARN ] Window manager (pid 2069, display 10) exited quickly (0 secs). This could indicate a window
[20221218-15:42:15] [INFO ] Calling auth_stop_session and auth_end from pid 2068
[20221218-15:42:15] [INFO ] Terminating X server (pid 2070) on display 10
[20221218-15:42:15] [INFO ] Terminating the xrdp channel server (pid 2072) on display 10
[20221218-15:42:15] [INFO ] X server on display 10 (pid 2070) returned exit code 1 and signal number 0
[20221218-15:42:15] [INFO ] xrdp channel server for display 10 (pid 2072) exit code 0 and signal number 0
[20221218-15:42:15] [INFO ] cleanup_sockets:
[20221218-15:42:15] [INFO ] Process 2067 has exited
[20221218-15:42:15] [INFO ] ++ terminated session: username damien, display :10.0, session_pid 2067, ip 192.168.1.12:63`

@J-W-C
Copy link

J-W-C commented Dec 19, 2022

Seems like it's not succeeding in starting an X server. Maybe check you have an Xorg executable at the path called out in:

20221218-15:42:05] [INFO ] Starting X server on display 10: /usr/local/libexec/Xorg :10 -auth .Xauthority -config

Also need to see what's in log file .xorgxrdp.10.log (if it exists)

@CaptKentish
Copy link
Author

I've got Xorg and Xorg.wrap in /usr/local/libexec
No .xorgxrdp.10.log

@matt335672
Copy link
Member

The xrdp-sesman.log appears to be incomplete above.

Search the log for this line:-

Starting X server on display 10: /usr/local/libexec/Xorg :10 -auth .Xauthority -config <whatever>

and then try running the complete command on the command line when logged is as damien. With a bit of luck you'll get more info about the actual error.

@CaptKentish
Copy link
Author

CaptKentish commented Dec 22, 2022

Runnig the command give me :

(++) Using config file: "/etc/X11/xrdp/xorg.conf"
(==) Using config directory: "/usr/local/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/local/share/X11/xorg.conf.d"
xorgxrdpSetup:
xrdpdevSetup:
rdpmousePlug:
rdpkeybPlug:
rdpIdentify:
rdpDriverFunc: op 10
(EE)
Fatal server error:
(EE) xf86OpenConsole: Server must be suid root(EE)
(EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
(EE) Please also check the log file at "/home/damien/.local/share/xorg/Xorg.10.log" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.

The log file in the home directory doesn't have more error line.

@mr44er
Copy link

mr44er commented Dec 24, 2022

Exact same error on FreeBSD:


X.Org X Server 1.21.1.4
X Protocol Version 11, Revision 0
Current Operating System: FreeBSD leech0 13.1-RELEASE-p3 FreeBSD 13.1-RELEASE-p3 GENERIC amd64
 
Current version of pixman: 0.42.2
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/home/mr44er/.local/share/xorg/Xorg.10.log", Time: Sun Dec 25 00:47:19 2022
(++) Using config file: "/etc/X11/xrdp/xorg.conf"
(==) Using config directory: "/usr/local/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/local/share/X11/xorg.conf.d"
xorgxrdpSetup:
xrdpdevSetup:
rdpmousePlug:
rdpkeybPlug:
rdpIdentify:
rdpDriverFunc: op 10
(EE) 
Fatal server error:
(EE) xf86OpenConsole: Server must be suid root(EE) 
(EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
(EE) Please also check the log file at "/home/mr44er/.local/share/xorg/Xorg.10.log" for additional information.
(EE) 
(EE) Server terminated with error (1). Closing log file.

According to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265728#c11 I haven't understood the wrapper thing.
In sesman.ini I already have the fixed and correct param=/usr/local/libexec/Xorg

ls -l /usr/local/libexec/X*
-rwxr-xr-x  1 root  wheel  2400296 Dec 17 09:13 /usr/local/libexec/Xorg
-r-sr-xr-x  1 root  wheel     8928 Dec 17 09:13 /usr/local/libexec/Xorg.wrap

@mr44er
Copy link

mr44er commented Dec 25, 2022

Found a 'fix', but don't know if its the correct way.
Missing puzzle was the great idea from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265728#c8

Change in sesman.ini
param=/usr/local/libexec/Xorg
to
param=/usr/local/libexec/Xorg.wrap
+
echo "allowed_users = anybody" | sudo tee -a /usr/local/etc/X11/Xwrapper.config
+
rebooted to restart everything sure and it works

@CaptKentish
Copy link
Author

CaptKentish commented Dec 25, 2022

I had the correct param too. Changing it to Xorg.wrap and creating a Xwrapper.config file with allowed_users = anybody seems to fix the permission issue but I have another error :

     Current version of pixman: 0.40.0

    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
   Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
    (==) Log file: "/var/log/Xorg.10.log", Time: Sun Dec 25 14:48:29 2022
    (++) Using config file: "/etc/X11/xrdp/xorg.conf"
    (==) Using config directory: "/usr/local/etc/X11/xorg.conf.d"
    (==) Using system config directory "/usr/local/share/X11/xorg.conf.d"
    xorgxrdpSetup:
   xrdpdevSetup:
   rdpmousePlug:
  rdpkeybPlug:
  rdpIdentify:
  rdpDriverFunc: op 10
  rdpProbe:
 (II) [KMS] Kernel modesetting enabled.
 (EE)
 Fatal server error:
 (EE) Cannot run in framebuffer mode. Please specify busIDs        for all                  framebuffer devices
 (EE)
 (EE)
 Please consult the The X.Org Foundation support
     at http://wiki.x.org
 for help.
(EE) Please also check the log file at "/var/log/Xorg.10.log" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.

@mr44er
Copy link

mr44er commented Dec 25, 2022

Try pciconf -lv to get the busID of the vga device.

Create /usr/local/etc/X11/xorg.conf.d/myvideo.conf with content according to your driver and busID

Section "Device"
        Identifier  "Card0"
        Driver      "scfb"
        BusID       "PCI:0:1:0"
EndSection

@CaptKentish
Copy link
Author

After addind BusID in config file, the connexion with window's remote desktop is still the same (hanging for a while and print error).
Starting the command line /usr/local/libexec/Xorg.wrap directly print :
xorgxrdpSetup:
xrdpdevSetup:
rdpmousePlug:
rdpkeybPlug:
rdpIdentify:
rdpDriverFunc: op 10
rdpProbe:
rdpPreInit:
rdpScreenInit: virtualX 800 virtualY 600 rgbBits 8 depth 24
rdpScreenInit: pfbMemory bytes 1920000
rdpScreenInit: pfbMemory 0x8024d0000
rdpSimdInit: assigning yuv functions
rdpSimdInit: cpuid ax 1 cx 0 return ax 0x00100f23 bx 0x03040800 cx 0x00802009 dx 0x178bfbff
rdpSimdInit: sse2 amd64 yuv functions assigned
rdpClientConInit: disconnect idle session after [0] sec
rdpClientConInit: kill disconnected [0] timeout [0] sec
rdpClientConInit: do_touchpad_scroll_hack [0]
rdpXvInit: depth 24
rdpScreenInit: out
rdpCreateScreenResources:
rdpmousePreInit: drv 0x801b30540 info 0x8023484f0, flags 0x0
rdpmouseControl: what 0
rdpmouseDeviceInit:
rdpmouseCtrl:
rdpRegisterInputCallback: type 1 proc 0x80085bb80
rdpmouseControl: what 1
rdpmouseDeviceOn:
rdpkeybPreInit: drv 0x801b304c0 info 0x8023483d0, flags 0x0
rdpkeybControl: what 0
rdpkeybDeviceInit:
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat on
rdpRegisterInputCallback: type 0 proc 0x801a8c480
rdpkeybControl: what 1
rdpkeybDeviceOn:
rdpDeferredRandR:
rdpResizeSession: width 1024 height 768
calling RRScreenSizeSet
rdpRRScreenSetSize: width 1024 height 768 mmWidth 271 mmHeight 203
rdpRRGetInfo:
screen resized to 1024x768
RRScreenSizeSet ok 1
rdpInDeferredRepeatCallback:
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat off

and hang.

@mr44er
Copy link

mr44er commented Dec 25, 2022

Mhm ok then I'm out of ideas with the playtogether of framebuffers.
Also I'm using remmina to connect between virtual machines, so no real windows/mstsc.exe involved.

@CaptKentish
Copy link
Author

Ok, nevermind. After a reboot, it's working.
Thank you mr44er.

Strange that the freebsd's fix doesn't fix the permission issue.
Anyway, I'm closing since it's working.

@metalefty
Copy link
Member

Hmm, that's very interesting /usr/local/libexec/Xorg didn't work.

Years of my experience, specifying param=/path/to/non-suid/Xorg-binary will work and actually working on my FreeBSD environment. Using Xorg.wrap is a little bit tricky and affects system-wide. That's why I recommend that way rather than using Xorg.wrap.

@mr44er If you could still spend some time for this, can you show me the output of this?

/usr/local/libexec/Xorg :15 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile
 .xorgxrdp.%s.log

@metalefty
Copy link
Member

If it is working, the output will be like this (details may vary):

$ /usr/local/libexec/Xorg :15 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log

X.Org X Server 1.21.1.4
X Protocol Version 11, Revision 0
Current Operating System: FreeBSD example.vmeta.jp 13.1-STABLE FreeBSD 13.1-STABLE #13 stable/13-n253276-293ff98462a: Mon Dec 12 15:04:27 JST 2022     root@example.vmeta.jp:/ssd/obj/usr/src/amd64.amd64/sys/GENERIC amd64

Current version of pixman: 0.42.2
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(++) Log file: ".xorgxrdp.15.log", Time: Mon Dec 26 10:20:56 2022
(++) Using config file: "/etc/X11/xrdp/xorg.conf"
(==) Using system config directory "/usr/local/share/X11/xorg.conf.d"
xorgxrdpSetup:
xrdpdevSetup:
rdpmousePlug:
rdpkeybPlug:
rdpIdentify:
rdpDriverFunc: op 10
rdpProbe:
rdpProbe: found DRMDevice xorg.conf value [/dev/dri/renderD128]
rdpProbe: found DRI3 xorg.conf value [1]
rdpPreInit:
rdpPreInit: /dev/dri/renderD128 open failed
rdpScreenInit: virtualX 800 virtualY 600 rgbBits 8 depth 24
rdpScreenInit: pfbMemory bytes 1920000
rdpScreenInit: pfbMemory 0x8385cf140
rdpSimdInit: assigning yuv functions
rdpSimdInit: cpuid ax 1 cx 0 return ax 0x00a50f00 bx 0x07100800 cx 0x7ed8320b dx 0x178bfbff
rdpSimdInit: sse2 amd64 yuv functions assigned
rdpClientConInit: disconnect idle session after [0] sec
rdpClientConInit: kill disconnected [0] timeout [0] sec
rdpXvInit: depth 24
rdpScreenInit: out
rdpCreateScreenResources:
rdpmousePreInit: drv 0x82d5e3300 info 0x84dbdf920, flags 0x0
rdpmouseControl: what 0
rdpmouseDeviceInit:
rdpmouseCtrl:
rdpRegisterInputCallback: type 1 proc 0x837dc63d0
rdpmouseControl: what 1
rdpmouseDeviceOn:
rdpkeybPreInit: drv 0x82d5e3380 info 0x84dbdfa60, flags 0x0
rdpkeybControl: what 0
rdpkeybDeviceInit:
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat on
rdpRegisterInputCallback: type 0 proc 0x837836ba0
rdpkeybControl: what 1
rdpkeybDeviceOn:
rdpDeferredRandR:
rdpResizeSession: width 1024 height 768
  calling RRScreenSizeSet
rdpRRScreenSetSize: width 1024 height 768 mmWidth 271 mmHeight 203
rdpRRGetInfo:
  screen resized to 1024x768
  RRScreenSizeSet ok 1
rdpInDeferredRepeatCallback:
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat off

Also, can you show me the output of pkg info -f xorg-server?

@metalefty metalefty reopened this Dec 26, 2022
@metalefty
Copy link
Member

Let me reopen this because this is very interesting. I'll try a fresh DragonFlyBSD install and investigate why it is not working without Xorg.wrapper.

@mr44er
Copy link

mr44er commented Dec 26, 2022

mr44er@leech0:~ $ /usr/local/libexec/Xorg :15 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log

X.Org X Server 1.21.1.4
X Protocol Version 11, Revision 0
Current Operating System: FreeBSD leech0 13.1-RELEASE-p3 FreeBSD 13.1-RELEASE-p3 GENERIC amd64
 
Current version of pixman: 0.42.2
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(++) Log file: ".xorgxrdp.15.log", Time: Mon Dec 26 02:33:59 2022
(++) Using config file: "/etc/X11/xrdp/xorg.conf"
(==) Using config directory: "/usr/local/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/local/share/X11/xorg.conf.d"
xorgxrdpSetup:
xrdpdevSetup:
rdpmousePlug:
rdpkeybPlug:
rdpIdentify:
rdpDriverFunc: op 10
(EE) 
Fatal server error:
(EE) xf86OpenConsole: Server must be suid root(EE) 
(EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
(EE) Please also check the log file at ".xorgxrdp.15.log" for additional information.
(EE) 
(EE) Server terminated with error (1). Closing log file.

.xorgxrdp.15.log:

[   156.103]
X.Org X Server 1.21.1.4
X Protocol Version 11, Revision 0
[   156.103] Current Operating System: FreeBSD leech0 13.1-RELEASE-p3 FreeBSD 13.1-RELEASE-p3 GENERIC amd64
[   156.103]
[   156.103] Current version of pixman: 0.42.2
[   156.103]    Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
[   156.103] Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   156.103] (++) Log file: ".xorgxrdp.15.log", Time: Mon Dec 26 02:33:59 2022
[   156.254] (++) Using config file: "/etc/X11/xrdp/xorg.conf"
[   156.254] (==) Using config directory: "/usr/local/etc/X11/xorg.conf.d"
[   156.254] (==) Using system config directory "/usr/local/share/X11/xorg.conf.d"
[   156.325] (**) Option "defaultserverlayout" "X11 Server"
[   156.325] (**) ServerLayout "X11 Server"
[   156.325] (**) |-->Screen "Screen (xrdpdev)" (0)
[   156.325] (**) |   |-->Monitor "Monitor"
[   156.333] (**) |   |-->Device "Video Card (xrdpdev)"
[   156.333] (**) |   |-->GPUDevice "Card0"
[   156.333] (**) |-->Input Device "xrdpMouse"
[   156.333] (**) |-->Input Device "xrdpKeyboard"
[   156.333] (**) Option "DontVTSwitch" "on"
[   156.333] (**) Option "AutoAddDevices" "off"
[   156.333] (**) Not automatically adding devices
[   156.333] (==) Automatically enabling devices
[   156.333] (==) Not automatically adding GPU devices
[   156.333] (==) Automatically binding GPU devices
[   156.333] (==) Max clients allowed: 256, resource mask: 0x1fffff
[   156.515] (==) FontPath set to:
        /usr/local/share/fonts/misc/,
        /usr/local/share/fonts/TTF/,
        /usr/local/share/fonts/OTF/,
        /usr/local/share/fonts/Type1/,
        /usr/local/share/fonts/100dpi/,
        /usr/local/share/fonts/75dpi/,
        catalogue:/usr/local/etc/X11/fontpath.d
[   156.515] (==) ModulePath set to "/usr/local/lib/xorg/modules"
[   156.526] (II) Module ABI versions:
[   156.526]    X.Org ANSI C Emulation: 0.4
[   156.526]    X.Org Video Driver: 25.2
[   156.526]    X.Org XInput driver : 24.4
[   156.526]    X.Org Server Extension : 10.0
[   156.526] (WW) checkDevMem: failed to open /dev/mem (Permission denied)
[   156.526] (II) "glx" will be loaded. This was enabled by default and also specified in the config file.
[   156.526] (II) LoadModule: "dbe"
[   156.526] (II) Module "dbe" already built-in
[   156.526] (II) LoadModule: "ddc"
[   156.526] (II) Module "ddc" already built-in
[   156.526] (II) LoadModule: "extmod"
[   156.526] (II) Module "extmod" already built-in
[   156.526] (II) LoadModule: "glx"
[   156.553] (II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
[   156.942] (II) Module glx: vendor="X.Org Foundation"
[   156.942]    compiled for 1.21.1.4, module version = 1.0.0
[   156.942]    ABI class: X.Org Server Extension, version 10.0
[   156.942] (II) LoadModule: "int10"
[   156.979] (II) Loading /usr/local/lib/xorg/modules/libint10.so
[   156.992] (II) Module int10: vendor="X.Org Foundation"
[   156.992]    compiled for 1.21.1.4, module version = 1.0.0
[   156.992]    ABI class: X.Org Video Driver, version 25.2
[   156.992] (II) LoadModule: "record"
[   156.992] (II) Module "record" already built-in
[   156.992] (II) LoadModule: "vbe"
[   156.992] (II) Loading /usr/local/lib/xorg/modules/libint10.so
[   156.992] (II) Module int10: vendor="X.Org Foundation"
[   156.992]    compiled for 1.21.1.4, module version = 1.0.0
[   156.992]    ABI class: X.Org Video Driver, version 25.2
[   156.992] (II) LoadModule: "xorgxrdp"
[   156.992] (II) Loading /usr/local/lib/xorg/modules/libxorgxrdp.so
[   157.037] (II) Module XORGXRDP: vendor="X.Org Foundation"
[   157.037]    compiled for 1.21.1.4, module version = 0.9.19
[   157.037]    ABI class: X.Org Video Driver, version 25.2
[   157.037] xorgxrdpSetup:
[   157.037] (II) LoadModule: "fb"
[   157.037] (II) Module "fb" already built-in
[   157.037] (II) LoadModule: "xrdpdev"
[   157.037] (II) Loading /usr/local/lib/xorg/modules/drivers/xrdpdev_drv.so
[   157.050] (II) Module XRDPDEV: vendor="X.Org Foundation"
[   157.050]    compiled for 1.21.1.4, module version = 0.9.19
[   157.050]    ABI class: X.Org Video Driver, version 25.2
[   157.050] xrdpdevSetup:
[   157.050] (II) LoadModule: "scfb"
[   157.050] (II) Loading /usr/local/lib/xorg/modules/drivers/scfb_drv.so
[   157.063] (II) Module scfb: vendor="X.Org Foundation"
[   157.063]    compiled for 1.21.1.4, module version = 0.0.5
[   157.063]    ABI class: X.Org Video Driver, version 25.2
[   157.063] (II) LoadModule: "xrdpmouse"
[   157.063] (II) Loading /usr/local/lib/xorg/modules/input/xrdpmouse_drv.so
[   157.073] (II) Module XRDPMOUSE: vendor="X.Org Foundation"
[   157.073]    compiled for 1.21.1.4, module version = 0.9.19
[   157.073]    Module class: X.Org XInput Driver
[   157.073]    ABI class: X.Org XInput driver, version 24.4
[   157.073] rdpmousePlug:
[   157.073] (II) LoadModule: "xrdpkeyb"
[   157.073] (II) Loading /usr/local/lib/xorg/modules/input/xrdpkeyb_drv.so
[   157.073] (II) Module XRDPKEYB: vendor="X.Org Foundation"
[   157.073]    compiled for 1.21.1.4, module version = 0.9.19
[   157.073]    Module class: X.Org XInput Driver
[   157.073]    ABI class: X.Org XInput driver, version 24.4
[   157.073] rdpkeybPlug:
[   157.073] rdpIdentify:
[   157.073] (II) XRDPDEV: driver for xrdp: XRDPDEV
[   157.073] rdpDriverFunc: op 10
[   157.073] (II) scfb: driver for wsdisplay framebuffer: scfb
[   157.073] (EE)
Fatal server error:
[   157.073] (EE) xf86OpenConsole: Server must be suid root(EE)
[   157.073] (EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org for help.
[   157.073] (EE) Please also check the log file at ".xorgxrdp.15.log" for additional information.
[   157.073] (EE)
[   157.073] (EE) Server terminated with error (1). Closing log file.

pkg info -f xorg-server:

xorg-server-21.1.4_1,1
Name           : xorg-server
Version        : 21.1.4_1,1
Installed on   : Wed Dec 21 20:07:59 2022 CET
Origin         : x11-servers/xorg-server
Architecture   : FreeBSD:13:amd64
Prefix         : /usr/local
Categories     : x11-servers
Licenses       : MIT
Maintainer     : x11@FreeBSD.org
WWW            : https://www.freedesktop.org/Software/xorg
Comment        : X.Org X server and related programs
Shared Libs required:
	libxshmfence.so.1
	libxcvt.so.0
	libudev.so.0
	libpixman-1.so.0
	libpciaccess.so.0
	libgbm.so.1
	libepoxy.so.0
	libdrm.so.2
	libXfont2.so.2
	libXdmcp.so.6
	libXau.so.6
	libGL.so.1
Annotations    :
	FreeBSD_version: 1301000
	cpe            : cpe:2.3:a:x.org:xorg-server:21.1.4:::::freebsd13:x64:1
	flavor         : xorg
	repo_type      : binary
	repository     : FreeBSD
Flat size      : 4.60MiB
Description    :
This package contains the X.Org X server and some associated programs.

See also: https://www.x.org/

WWW: https://www.freedesktop.org/Software/xorg

The machine is a qemu-vm on proxmox, where I'm using UEFI-boot with scfb. The only change I made was /usr/local/etc/X11/xorg.conf.d/98-qemu-video.conf with content:

Section "Device"
        Identifier  "Card0"
        Driver      "scfb"
        BusID       "PCI:0:1:0"
EndSection

But AFAIK this session runs on :9, but only if I start it.
I'm going to sleep now, will deliver more tomorrow when needed. :)

@metalefty metalefty changed the title Cannot login in Dragonflybsd xorgxrdp sometimes requires Xorg.wrap to start on FreeBSD/DragonFlyBSD Dec 27, 2022
@matt335672
Copy link
Member

I'm wondering if this is another manifestation of neutrinolabs/xorgxrdp#241.

@mr44er - can you make sure you've got the changes in commit b7002eee in your /etc/X11/xrdp/xorg.conf?

@mr44er
Copy link

mr44er commented Dec 27, 2022

I will fire up another vm to have a clean start and to be 100% sure and report back then.

The fresh vm was 13.1-RELEASE-p5, no qemu-guest-agent this time and no editing for scfb.
Just pkg install mate xorg xrdp, entry for mate in startwm.sh, restarting services and I was able to connect.

commit b7002eee in your /etc/X11/xrdp/xorg.conf?

Old and fresh vm did not have this commit.

Second test with added qemu-guest-agent works too. This narrows it down to my manual edit in /usr/local/etc/X11/xorg.conf.d/98-qemu-video.conf

I don't really need running scfb on the qemu main console, when I can have the better experience over rdp. But anyway, was this configuring wrong? Should I try the commit + scfb? And it doesn't explain the workaround for @CaptKentish

@CaptKentish
Copy link
Author

So, I didn't have the commit in /etc/X11/xrdp/xorg.conf
If I revert all the previous modifications and adding the commit, it's working.

I have a file in /usr/local/etc/X11/xorg.conf.d/ which loads the radeon driver. I didn't touch it.

@mr44er
Copy link

mr44er commented Dec 29, 2022

Can you share the content of this file in /usr/local/etc/X11/xorg.conf.d/?
This would be interesting, because on FreeBSD we have graphics/drm-kmod and since then the recommendation for best results is no manual config at all to let xorg do its automagic.
Never tried Dragonfly, so I don't know the status there about graphic drivers.

@CaptKentish
Copy link
Author

CaptKentish commented Dec 29, 2022

Section "Device"
Identifier "Card0"
Driver "radeon"
BusID "PCI:0:1:0"
EndSection

The BusID line was added for xrdp.
I've got this file for a long time now and I think amdgpu was ported to DragonFly but since my card is support by radeon and everything is fine, I didn't change anything. Maybe I don't need it anymore.

@mr44er
Copy link

mr44er commented Dec 29, 2022

Thanks, this is just the same config setting as I had for scfb and yes, maybe this blocked xrdp initially for you, too.

I did some more testing, it just was the missing commit.
Now everything works smooth (mouse input with scfb in noVNC-console) and xrdp on top. Thx guys! :)

@matt335672
Copy link
Member

Glad you've got it working.

Happy to close this one now?

@mr44er
Copy link

mr44er commented Dec 30, 2022

Yeah, you can close it 👍

@matt335672
Copy link
Member

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants