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

XRDP not working with Optimus Manager - permission denied on /dev/tty0 #2010

Closed
Pipodi opened this issue Oct 7, 2021 · 26 comments
Closed

XRDP not working with Optimus Manager - permission denied on /dev/tty0 #2010

Pipodi opened this issue Oct 7, 2021 · 26 comments

Comments

@Pipodi
Copy link

Pipodi commented Oct 7, 2021

I was able to connect with my Windows 10 pc to my Manjaro XFCE laptop, but after what I think to be a system update on Manjaro, it stopped working. I can reac XRDP login page, select XORG, typing my login, but when I click ok it freezes, and after a while it goes on timeout.

This is the journalctl output of the issue:

ott 07 16:12:00 PCABS xrdp-sesman[36820]: [INFO ] ++ created session (access granted): username pipodi, ip ::ffff:192.168.178.31:63741 - socket: 12
ott 07 16:12:00 PCABS xrdp-sesman[36820]: [INFO ] starting Xorg session...
ott 07 16:12:00 PCABS xrdp-sesman[36820]: [INFO ] Starting session: session_pid 37652, display :10.0, width 1920, height 1080, bpp 24, client ip ::ffff:192.168.178.31:63741 - socket: 12, user name pipodi
ott 07 16:12:00 PCABS xrdp-sesman[37652]: [INFO ] [session start] (display 10): calling auth_start_session from pid 37652
ott 07 16:12:00 PCABS xrdp-sesman[36820]: [ERROR] sesman_data_in: scp_process_msg failed
ott 07 16:12:00 PCABS xrdp[37649]: [INFO ] xrdp_wm_log_msg: login successful for display 10
ott 07 16:12:00 PCABS xrdp[37649]: [INFO ] login successful for display 10
ott 07 16:12:00 PCABS audit[37652]: CRED_ACQ pid=37652 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:setcred grantors=pam_shells,pam_faillock,pam_faillock acct="pipodi" exe="/usr/bin/xrdp-sesman" hostname=? addr=? terminal=:10 res=success'
ott 07 16:12:00 PCABS xrdp-sesman[37652]: pam_unix(xrdp-sesman:session): session opened for user pipodi(uid=1000) by (uid=0)
ott 07 16:12:00 PCABS xrdp-sesman[37652]: pam_systemd(xrdp-sesman:session): Failed to create session: No child processes
ott 07 16:12:00 PCABS xrdp-sesman[37652]: pam_env(xrdp-sesman:session): deprecated reading of user environment enabled
ott 07 16:12:00 PCABS audit[37652]: USER_START pid=37652 uid=0 auid=1000 ses=6 msg='op=PAM:session_open grantors=pam_loginuid,pam_keyinit,pam_limits,pam_unix,pam_permit,pam_mail,pam_env acct="pipodi" exe="/usr/bin/xrdp-sesman" hostname=? addr=? terminal=:10 res=success'
ott 07 16:12:00 PCABS kernel: audit: type=1103 audit(1633615920.356:385): pid=37652 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:setcred grantors=pam_shells,pam_faillock,pam_faillock acct="pipodi" exe="/usr/bin/xrdp-sesman" hostname=? addr=? terminal=:10 res=success'
ott 07 16:12:00 PCABS kernel: audit: type=1006 audit(1633615920.356:386): pid=37652 uid=0 old-auid=4294967295 auid=1000 tty=(none) old-ses=4294967295 ses=6 res=1
ott 07 16:12:00 PCABS kernel: audit: type=1105 audit(1633615920.356:387): pid=37652 uid=0 auid=1000 ses=6 msg='op=PAM:session_open grantors=pam_loginuid,pam_keyinit,pam_limits,pam_unix,pam_permit,pam_mail,pam_env acct="pipodi" exe="/usr/bin/xrdp-sesman" hostname=? addr=? terminal=:10 res=success'
ott 07 16:12:00 PCABS xrdp-sesman[36820]: [ERROR] sesman_main_loop: trans_check_wait_objs failed, removing trans
ott 07 16:12:00 PCABS xrdp[37649]: [INFO ] loaded module 'libxup.so' ok, interface size 10296, version 4
ott 07 16:12:00 PCABS xrdp-sesman[37654]: [INFO ] Starting X server on display 10: /usr/lib/Xorg :10 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log
ott 07 16:12:00 PCABS xrdp[37649]: [INFO ] started connecting
ott 07 16:12:00 PCABS xrdp[37649]: [INFO ] lib_mod_connect: connecting via UNIX socket
ott 07 16:12:00 PCABS kernel: ------------[ cut here ]------------
ott 07 16:12:00 PCABS kernel: WARNING: CPU: 6 PID: 37654 at /run/media/phil/home/phil/dev/git/manjaro/repositories/gitlab/extra/extramodules/linux510-extramodules/nvidia/src/NVIDIA-Linux-x86_64-470.63.01-no-compat32/kernel/nvidia-drm/nvidia-drm-drv.c:574 nv_drm_master_set+0x22/0x30 [nvidia_drm]
ott 07 16:12:00 PCABS kernel: Modules linked in: ccm rfcomm xt_nat veth xt_CHECKSUM nf_conntrack_netlink nfnetlink xt_MASQUERADE xt_conntrack ipt_REJECT nf_reject_ipv4 xt_addrtype uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 cmac videobuf2_common algif_hash videodev algif_skcipher af_alg bnep mc nvidia_drm(POE) nvidia_modeset(POE) br_netfilter nvidia(POE) xt_tcpudp overlay ip6table_mangle snd_hda_codec_hdmi ip6table_nat ip6table_filter ip6_tables snd_sof_pci snd_sof_intel_byt snd_sof_intel_ipc snd_hda_codec_realtek snd_sof_intel_hda_common snd_sof_xtensa_dsp snd_hda_codec_generic iptable_mangle snd_sof_intel_hda snd_sof iptable_nat nf_nat ledtrig_audio nf_conntrack snd_soc_skl nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c snd_soc_hdac_hda snd_hda_ext_core iptable_filter snd_soc_sst_ipc snd_soc_sst_dsp snd_soc_acpi_intel_match snd_soc_acpi snd_hda_intel snd_intel_dspcfg soundwire_intel soundwire_generic_allocation soundwire_cadence mousedev i915 snd_hda_codec bridge rtw88_8822be iTCO_wdt rtw88_8822b
ott 07 16:12:00 PCABS kernel:  btusb x86_pkg_temp_thermal intel_pmc_bxt ee1004 intel_powerclamp iTCO_vendor_support coretemp btrtl snd_hda_core qrtr stp btbcm btintel snd_hwdep kvm_intel rtw88_pci ns llc i2c_algo_bit mei_hdcp hid_multitouch bluetooth intel_rapl_msr joydev soundwire_bus rtw88_core drm_kms_helper kvm hp_wmi sparse_keymap wmi_bmof ecdh_generic intel_wmi_thunderbolt ecc snd_soc_core cec irqbypass crct10dif_pclmul crc32_pclmul snd_compress ghash_clmulni_intel mac80211 drm ac97_bus snd_pcm_dmaengine aesni_intel r8169 snd_pcm crypto_simd cryptd intel_gtt glue_helper intel_spi_pci snd_timer agpgart intel_spi realtek rapl cfg80211 intel_cstate syscopyarea mdio_devres spi_nor intel_uncore pcspkr sysfillrect i2c_i801 rfkill snd vfat mei_me sysimgblt processor_thermal_device intel_lpss_pci mtd intel_lpss fat i2c_smbus libarc4 intel_rapl_common libphy mei soundcore idma64 fb_sys_fops intel_soc_dts_iosf intel_pch_thermal ucsi_acpi typec_ucsi int3403_thermal typec i2c_hid video int340x_thermal_zone wmi
ott 07 16:12:00 PCABS kernel:  tpm_crb tpm_tis tpm_tis_core tpm rng_core hp_wireless hp_accel acpi_tad int3400_thermal lis3lv02d acpi_pad mac_hid acpi_thermal_rel uinput fuse crypto_user ip_tables x_tables ext4 crc32c_generic crc16 mbcache jbd2 alcor mmc_core crc32c_intel serio_raw alcor_pci xhci_pci
ott 07 16:12:00 PCABS kernel: CPU: 6 PID: 37654 Comm: Xorg Tainted: P        W  OE     5.10.68-1-MANJARO #1
ott 07 16:12:00 PCABS kernel: Hardware name: HP HP Pavilion Gaming Laptop 15-dk0xxx/85FC, BIOS F.33 07/16/2020
ott 07 16:12:00 PCABS kernel: RIP: 0010:nv_drm_master_set+0x22/0x30 [nvidia_drm]
ott 07 16:12:00 PCABS kernel: Code: 70 c3 e8 c1 8e ee d9 90 0f 1f 44 00 00 48 8b 47 48 48 8b 78 20 48 8b 05 9c 5c 00 00 48 8b 40 28 e8 33 4b 28 da 84 c0 74 01 c3 <0f> 0b c3 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 80 3d bc
ott 07 16:12:00 PCABS kernel: RSP: 0018:ffffa54284f23bc0 EFLAGS: 00010246
ott 07 16:12:00 PCABS kernel: RAX: 0000000000000000 RBX: ffff91a40459b000 RCX: 0000000000000008
ott 07 16:12:00 PCABS kernel: RDX: ffffffffc161eed8 RSI: 0000000000000292 RDI: ffffffffc161eea0
ott 07 16:12:00 PCABS kernel: RBP: ffff91a370529000 R08: 0000000000000008 R09: ffffa54284f23ba8
ott 07 16:12:00 PCABS kernel: R10: 0000000000000000 R11: 0000000000000000 R12: ffff91a4045be300
ott 07 16:12:00 PCABS kernel: R13: 0000000000000000 R14: ffff91a40459b010 R15: 0000000059b6b828
ott 07 16:12:00 PCABS kernel: FS:  00007fc092195180(0000) GS:ffff91a6ae380000(0000) knlGS:0000000000000000
ott 07 16:12:00 PCABS kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
ott 07 16:12:00 PCABS kernel: CR2: 000055d1e1ffa068 CR3: 00000001b6f9a001 CR4: 00000000003706e0
ott 07 16:12:00 PCABS kernel: Call Trace:
ott 07 16:12:00 PCABS kernel:  drm_new_set_master+0x93/0x110 [drm]
ott 07 16:12:00 PCABS kernel:  drm_master_open+0x83/0xb0 [drm]
ott 07 16:12:00 PCABS kernel:  drm_open+0xf8/0x250 [drm]
ott 07 16:12:00 PCABS kernel:  drm_stub_open+0xab/0x130 [drm]
ott 07 16:12:00 PCABS kernel:  chrdev_open+0xc3/0x250
ott 07 16:12:00 PCABS kernel:  ? cdev_device_add+0x90/0x90
ott 07 16:12:00 PCABS kernel:  do_dentry_open+0x14e/0x380
ott 07 16:12:00 PCABS kernel:  path_openat+0xb38/0xfa0
ott 07 16:12:00 PCABS kernel:  ? fsnotify+0x4f1/0x560
ott 07 16:12:00 PCABS kernel:  do_filp_open+0x91/0x130
ott 07 16:12:00 PCABS kernel:  ? getname_flags.part.0+0x2c/0x1b0
ott 07 16:12:00 PCABS kernel:  ? __check_object_size+0x136/0x150
ott 07 16:12:00 PCABS kernel:  do_sys_openat2+0x96/0x150
ott 07 16:12:00 PCABS kernel:  __x64_sys_openat+0x53/0x90
ott 07 16:12:00 PCABS kernel:  do_syscall_64+0x33/0x40
ott 07 16:12:00 PCABS kernel:  entry_SYSCALL_64_after_hwframe+0x44/0xa9
ott 07 16:12:00 PCABS kernel: RIP: 0033:0x7fc092c2a5bb
ott 07 16:12:00 PCABS kernel: Code: 25 00 00 41 00 3d 00 00 41 00 74 4b 64 8b 04 25 18 00 00 00 85 c0 75 67 44 89 e2 48 89 ee bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 0f 87 91 00 00 00 48 8b 54 24 28 64 48 2b 14 25
ott 07 16:12:00 PCABS kernel: RSP: 002b:00007fff260c3a80 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
ott 07 16:12:00 PCABS kernel: RAX: ffffffffffffffda RBX: 00000000ffffffff RCX: 00007fc092c2a5bb
ott 07 16:12:00 PCABS kernel: RDX: 0000000000080002 RSI: 000055d1e1ff8780 RDI: 00000000ffffff9c
ott 07 16:12:00 PCABS kernel: RBP: 000055d1e1ff8780 R08: 0000000000000031 R09: 0000000000000000
ott 07 16:12:00 PCABS kernel: R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000080002
ott 07 16:12:00 PCABS kernel: R13: 000055d1e1ff8780 R14: 000055d1e1ff8780 R15: 000055d1e1ff7c50
ott 07 16:12:00 PCABS kernel: ---[ end trace 17007ef8c558990d ]---
ott 07 16:12:00 PCABS xrdp-sesman[37653]: [INFO ] Found X server running at /tmp/.X11-unix/X10
ott 07 16:12:00 PCABS xrdp-sesman[37652]: [INFO ] Found X server running at /tmp/.X11-unix/X10
ott 07 16:12:00 PCABS xrdp-sesman[37653]: [INFO ] Found X server running at /tmp/.X11-unix/X10
ott 07 16:12:00 PCABS xrdp-sesman[37652]: [INFO ] Session started successfully for user pipodi on display 10
ott 07 16:12:00 PCABS xrdp-sesman[37656]: [INFO ] Starting the xrdp channel server for display 10
ott 07 16:12:00 PCABS xrdp-sesman[37653]: [INFO ] Starting the default window manager on display 10: /etc/xrdp/startwm.sh
ott 07 16:12:00 PCABS xrdp-sesman[37652]: [INFO ] Session in progress on display 10, waiting until the window manager (pid 37653) exits to end the session
ott 07 16:12:01 PCABS xrdp-sesman[37652]: [WARN ] Window manager (pid 37653, display 10) exited quickly (1 secs). This could indicate a window manager config problem
ott 07 16:12:01 PCABS xrdp-sesman[37652]: [INFO ] Calling auth_stop_session and auth_end from pid 37652
ott 07 16:12:01 PCABS xrdp-sesman[37652]: pam_unix(xrdp-sesman:session): session closed for user pipodi
ott 07 16:12:01 PCABS audit[37652]: USER_END pid=37652 uid=0 auid=1000 ses=6 msg='op=PAM:session_close grantors=pam_loginuid,pam_keyinit,pam_limits,pam_unix,pam_permit,pam_mail,pam_env acct="pipodi" exe="/usr/bin/xrdp-sesman" hostname=? addr=? terminal=:10 res=success'
ott 07 16:12:01 PCABS audit[37652]: CRED_DISP pid=37652 uid=0 auid=1000 ses=6 msg='op=PAM:setcred grantors=pam_shells,pam_faillock,pam_faillock acct="pipodi" exe="/usr/bin/xrdp-sesman" hostname=? addr=? terminal=:10 res=success'
ott 07 16:12:01 PCABS xrdp-sesman[37652]: [INFO ] Terminating X server (pid 37654) on display 10
ott 07 16:12:01 PCABS kernel: audit: type=1106 audit(1633615921.659:388): pid=37652 uid=0 auid=1000 ses=6 msg='op=PAM:session_close grantors=pam_loginuid,pam_keyinit,pam_limits,pam_unix,pam_permit,pam_mail,pam_env acct="pipodi" exe="/usr/bin/xrdp-sesman" hostname=? addr=? terminal=:10 res=success'
ott 07 16:12:01 PCABS kernel: audit: type=1104 audit(1633615921.659:389): pid=37652 uid=0 auid=1000 ses=6 msg='op=PAM:setcred grantors=pam_shells,pam_faillock,pam_faillock acct="pipodi" exe="/usr/bin/xrdp-sesman" hostname=? addr=? terminal=:10 res=success'
ott 07 16:12:01 PCABS xrdp-sesman[37652]: [INFO ] Terminating the xrdp channel server (pid 37656) on display 10
ott 07 16:12:01 PCABS xrdp-sesman[37652]: [INFO ] X server on display 10 (pid 37654) returned exit code 1 and signal number 0
ott 07 16:12:01 PCABS xrdp-sesman[37652]: [INFO ] xrdp channel server for display 10 (pid 37656) exit code 0 and signal number 0
ott 07 16:12:01 PCABS xrdp-sesman[37652]: [INFO ] cleanup_sockets:
ott 07 16:12:01 PCABS xrdp-sesman[36820]: [INFO ] ++ terminated session:  username pipodi, display :10.0, session_pid 37652, ip ::ffff:192.168.178.31:63741 - socket: 12

Both xrdp-git and xorgxrdp-git installed.

Any tip? Thanks!

@matt335672
Copy link
Member

Hi @Pipodi - thanks for bearing with me. Since this follows an update, you probably won't be the only one experiencing this issue.

The problem is seen in this line:-

ott 07 16:12:01 PCABS xrdp-sesman[37652]: [WARN ] Window manager (pid 37653, display 10) exited quickly (1 secs). This could indicate a window manager config problem

The session is probably exiting either because of a problem with it, or because the X server is failing. Your mention of an update reminds me of this reply I wrote earlier today.

Couple of things to check:-

  1. X server : Have a look in /home/pipodi/.xorgxrdp.10.log which is the X server log. In particular, look for any EE lines which may be causing the X server to exit.
  2. Session : Have a look in /home/pipodi/.xsession-errors for output from the session itself.

Can you have a look and report back?

@Pipodi
Copy link
Author

Pipodi commented Oct 7, 2021

This is what I've got.

xorgxrdp.10.log

[   564.363] (WW) Failed to open protocol names file lib/xorg/protocol.txt
[   564.364] 
X.Org X Server 1.20.13
X Protocol Version 11, Revision 0
[   564.364] Build Operating System: Linux Manjaro Linux
[   564.364] Current Operating System: Linux PCABS 5.10.68-1-MANJARO #1 SMP PREEMPT Wed Sep 22 12:29:47 UTC 2021 x86_64
[   564.364] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.10-x86_64 root=UUID=01135b6d-2afc-4866-8400-80dd222761b3 rw quiet resume=UUID=39a87f46-755b-4d74-afdb-dfa6baa111c9 udev.log_priority=3
[   564.364] Build Date: 24 August 2021  10:21:29AM
[   564.364]  
[   564.364] Current version of pixman: 0.40.0
[   564.364] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[   564.364] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   564.364] (++) Log file: ".xorgxrdp.10.log", Time: Thu Oct  7 16:12:00 2021
[   564.364] (++) Using config file: "/etc/X11/xrdp/xorg.conf"
[   564.364] (==) Using config directory: "/etc/X11/xorg.conf.d"
[   564.364] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[   564.364] (**) Option "defaultserverlayout" "X11 Server"
[   564.364] (**) ServerLayout "X11 Server"
[   564.364] (**) |-->Screen "Screen (xrdpdev)" (0)
[   564.364] (**) |   |-->Monitor "Monitor"
[   564.364] (**) |   |-->Device "Video Card (xrdpdev)"
[   564.364] (**) |   |-->GPUDevice "integrated"
[   564.364] (**) |   |-->GPUDevice "Video Card (xrdpdev)"
[   564.364] (**) |-->Input Device "xrdpMouse"
[   564.364] (**) |-->Input Device "xrdpKeyboard"
[   564.364] (**) Option "DontVTSwitch" "on"
[   564.364] (**) Option "AutoAddDevices" "off"
[   564.364] (**) Not automatically adding devices
[   564.364] (==) Automatically enabling devices
[   564.364] (==) Automatically adding GPU devices
[   564.364] (==) Automatically binding GPU devices
[   564.364] (==) Max clients allowed: 256, resource mask: 0x1fffff
[   564.364] (WW) The directory "/usr/share/fonts/OTF" does not exist.
[   564.364] 	Entry deleted from font path.
[   564.364] (WW) The directory "/usr/share/fonts/Type1" does not exist.
[   564.364] 	Entry deleted from font path.
[   564.364] (WW) The directory "/usr/share/fonts/100dpi" does not exist.
[   564.364] 	Entry deleted from font path.
[   564.364] (WW) The directory "/usr/share/fonts/75dpi" does not exist.
[   564.364] 	Entry deleted from font path.
[   564.364] (==) FontPath set to:
	/usr/share/fonts/misc,
	/usr/share/fonts/TTF
[   564.364] (**) ModulePath set to "/usr/lib/nvidia,/usr/lib32/nvidia,/usr/lib32/nvidia/xorg/modules,/usr/lib32/xorg/modules,/usr/lib64/nvidia/xorg/modules,/usr/lib64/nvidia/xorg,/usr/lib64/xorg/modules"
[   564.364] (II) Module ABI versions:
[   564.364] 	X.Org ANSI C Emulation: 0.4
[   564.364] 	X.Org Video Driver: 24.1
[   564.364] 	X.Org XInput driver : 24.1
[   564.364] 	X.Org Server Extension : 10.0
[   564.365] (EE) systemd-logind: failed to get session: PID 37654 does not belong to any known session
[   564.365] (II) xfree86: Adding drm device (/dev/dri/card1)
[   564.366] (II) xfree86: Adding drm device (/dev/dri/card0)
[   564.366] (EE) /dev/dri/card0: failed to set DRM interface version 1.4: Permission denied
[   564.367] (**) OutputClass "nvidia" ModulePath extended to "/usr/lib/nvidia/xorg,/usr/lib/xorg/modules,/usr/lib/nvidia,/usr/lib32/nvidia,/usr/lib32/nvidia/xorg/modules,/usr/lib32/xorg/modules,/usr/lib64/nvidia/xorg/modules,/usr/lib64/nvidia/xorg,/usr/lib64/xorg/modules"
[   564.367] (**) OutputClass "nvidia" ModulePath extended to "/usr/lib/nvidia/xorg,/usr/lib/xorg/modules,/usr/lib/nvidia/xorg,/usr/lib/xorg/modules,/usr/lib/nvidia,/usr/lib32/nvidia,/usr/lib32/nvidia/xorg/modules,/usr/lib32/xorg/modules,/usr/lib64/nvidia/xorg/modules,/usr/lib64/nvidia/xorg,/usr/lib64/xorg/modules"
[   565.629] (--) PCI:*(0@0:2:0) 8086:3e9b:103c:85fc rev 0, Mem @ 0xb2000000/16777216, 0x80000000/536870912, I/O @ 0x00006000/64, BIOS @ 0x????????/131072
[   565.629] (--) PCI: (1@0:0:0) 10de:1f91:103c:85fc rev 161, Mem @ 0xb3000000/16777216, 0xa0000000/268435456, 0xb0000000/33554432, I/O @ 0x00005000/128, BIOS @ 0x????????/524288
[   565.629] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[   565.629] (II) "glx" will be loaded. This was enabled by default and also specified in the config file.
[   565.629] (II) LoadModule: "dbe"
[   565.629] (II) Module "dbe" already built-in
[   565.629] (II) LoadModule: "ddc"
[   565.629] (II) Module "ddc" already built-in
[   565.629] (II) LoadModule: "extmod"
[   565.629] (II) Module "extmod" already built-in
[   565.629] (II) LoadModule: "glx"
[   565.629] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[   565.630] (II) Module glx: vendor="X.Org Foundation"
[   565.630] 	compiled for 1.20.13, module version = 1.0.0
[   565.630] 	ABI class: X.Org Server Extension, version 10.0
[   565.630] (II) LoadModule: "int10"
[   565.630] (II) Loading /usr/lib/xorg/modules/libint10.so
[   565.630] (II) Module int10: vendor="X.Org Foundation"
[   565.630] 	compiled for 1.20.13, module version = 1.0.0
[   565.630] 	ABI class: X.Org Video Driver, version 24.1
[   565.630] (II) LoadModule: "record"
[   565.630] (II) Module "record" already built-in
[   565.630] (II) LoadModule: "vbe"
[   565.630] (II) Loading /usr/lib/xorg/modules/libvbe.so
[   565.630] (II) Module vbe: vendor="X.Org Foundation"
[   565.630] 	compiled for 1.20.13, module version = 1.1.0
[   565.630] 	ABI class: X.Org Video Driver, version 24.1
[   565.630] (II) LoadModule: "xorgxrdp"
[   565.630] (II) Loading /usr/lib/xorg/modules/libxorgxrdp.so
[   565.630] (II) Module XORGXRDP: vendor="X.Org Foundation"
[   565.631] 	compiled for 1.20.13, module version = 0.2.17
[   565.631] 	ABI class: X.Org Video Driver, version 24.1
[   565.631] xorgxrdpSetup:
[   565.631] (II) LoadModule: "fb"
[   565.631] (II) Loading /usr/lib/xorg/modules/libfb.so
[   565.631] (II) Module fb: vendor="X.Org Foundation"
[   565.631] 	compiled for 1.20.13, module version = 1.0.0
[   565.631] 	ABI class: X.Org ANSI C Emulation, version 0.4
[   565.631] (II) LoadModule: "xrdpdev"
[   565.631] (II) Loading /usr/lib/xorg/modules/drivers/xrdpdev_drv.so
[   565.631] (II) Module XRDPDEV: vendor="X.Org Foundation"
[   565.631] 	compiled for 1.20.13, module version = 0.2.17
[   565.631] 	ABI class: X.Org Video Driver, version 24.1
[   565.631] xrdpdevSetup:
[   565.631] (II) LoadModule: "modesetting"
[   565.631] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[   565.631] (II) Module modesetting: vendor="X.Org Foundation"
[   565.631] 	compiled for 1.20.13, module version = 1.20.13
[   565.631] 	Module class: X.Org Video Driver
[   565.631] 	ABI class: X.Org Video Driver, version 24.1
[   565.631] (II) LoadModule: "xrdpmouse"
[   565.631] (II) Loading /usr/lib/xorg/modules/input/xrdpmouse_drv.so
[   565.631] (II) Module XRDPMOUSE: vendor="X.Org Foundation"
[   565.631] 	compiled for 1.20.13, module version = 0.2.17
[   565.631] 	Module class: X.Org XInput Driver
[   565.631] 	ABI class: X.Org XInput driver, version 24.1
[   565.631] rdpmousePlug:
[   565.631] (II) LoadModule: "xrdpkeyb"
[   565.631] (II) Loading /usr/lib/xorg/modules/input/xrdpkeyb_drv.so
[   565.631] (II) Module XRDPKEYB: vendor="X.Org Foundation"
[   565.631] 	compiled for 1.20.13, module version = 0.2.17
[   565.631] 	Module class: X.Org XInput Driver
[   565.631] 	ABI class: X.Org XInput driver, version 24.1
[   565.631] rdpkeybPlug:
[   565.632] rdpIdentify:
[   565.632] (II) XRDPDEV: driver for xrdp: XRDPDEV
[   565.632] rdpDriverFunc: op 10
[   565.632] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[   565.632] (EE) 
Fatal server error:
[   565.632] (EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)
[   565.632] (EE) 
[   565.632] (EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
[   565.632] (EE) Please also check the log file at ".xorgxrdp.10.log" for additional information.
[   565.632] (EE) 
[   565.632] (WW) xf86CloseConsole: KDSETMODE failed: Bad file descriptor
[   565.632] (WW) xf86CloseConsole: VT_GETMODE failed: Bad file descriptor
[   565.632] (EE) Server terminated with error (1). Closing log file.

And .xsession-errors:

/usr/bin/iceauth:  creating new authority file /run/user/1000/ICEauthority

(wrapper-2.0:2045): libnotify-WARNING **: 16:02:44.635: Failed to connect to proxy

** (xfce4-clipman:2077): WARNING **: 16:02:44.918: Unable to register GApplication: An object is already exported for the interface org.gtk.Application at /org/xfce/clipman

(xfce4-clipman:2077): GLib-GIO-CRITICAL **: 16:02:44.918: g_application_get_is_remote: assertion 'application->priv->is_registered' failed

(xfce4-clipman:2077): GLib-WARNING **: 16:02:44.918: g_set_application_name() called multiple times

** (xfce4-power-manager:2137): WARNING **: 16:02:44.999: Failed to get name owner: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.freedesktop.PowerManagement': no such name


** (xfce4-power-manager:2137): WARNING **: 16:02:44.999: Failed to get name owner: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.xfce.PowerManager': no such name


(xfce4-power-manager:2137): libnotify-WARNING **: 16:02:45.024: Failed to connect to proxy

(xfce4-power-manager:2137): GLib-GObject-WARNING **: 16:02:45.147: ../glib/gobject/gsignal.c:2614: signal 'Changed' is invalid for instance '0x560eb50052b0' of type 'GDBusProxy'

(xfce4-power-manager:2137): xfce4-power-manager-WARNING **: 16:02:45.163: could not map keysym 1008ffa8 to keycode


** (xfce4-power-manager:2137): WARNING **: 16:02:45.172: could not get output property

(xfce4-power-manager:2137): xfce4-power-manager-WARNING **: 16:02:45.178: It seems the kernel brightness switch handling value was not restored properly on exit last time, xfce4-power-manager will try to restore it this time.
xfce4-power-manager-Message: 16:02:45.200: Set kernel brightness switch to 0

(xfce4-power-manager:2137): xfce4-power-manager-WARNING **: 16:02:45.204: Failed to get keyboard max brightness level : GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Object does not exist at path “/org/freedesktop/UPower/KbdBacklight”

** (xfce4-power-manager:2137): WARNING **: 16:02:45.236: could not get output property

(xfce4-power-manager:2137): xfce4-power-manager-WARNING **: 16:02:45.244: ../panel-plugins/power-manager-plugin/power-manager-button.c:858: invalid property id 2 for "show-panel-label" of type 'GParamInt' in 'PowerManagerButton'

(xfce4-power-manager:2137): xfce4-power-manager-WARNING **: 16:02:45.244: ../panel-plugins/power-manager-plugin/power-manager-button.c:858: invalid property id 3 for "presentation-mode" of type 'GParamBoolean' in 'PowerManagerButton'

(xfce4-power-manager:2137): xfce4-power-manager-WARNING **: 16:02:45.244: ../panel-plugins/power-manager-plugin/power-manager-button.c:858: invalid property id 4 for "show-presentation-indicator" of type 'GParamBoolean' in 'PowerManagerButton'

(wrapper-2.0:2041): Gtk-WARNING **: 16:02:45.255: Negative content width -1 (allocation 1, extents 1x1) while allocating gadget (node button, owner GtkToggleButton)

(wrapper-2.0:2045): Gtk-WARNING **: 16:02:45.265: Negative content width -1 (allocation 1, extents 1x1) while allocating gadget (node button, owner PulseaudioButton)

(wrapper-2.0:2042): Gtk-WARNING **: 16:02:45.266: gtk_widget_size_allocate(): attempt to allocate widget with width -3 and height 32
blueman-applet 16.02.45 WARNING  PluginManager:147 __load_plugin: Not loading PPPSupport because its conflict has higher priority
[region= release=] 2021/10/07 16:02:45.320559 lib.go:21: loading tensorflow dynamically...
[region= release=] 2021/10/07 16:02:45.320646 loader_linux.go:17: Loading tensorflow libary libtensorflow.so.1.15.0
[region= release=] 2021/10/07 16:02:45.369650 lib.go:18: loading tensorflow took 49.075027ms
[region= release=] 2021/10/07 16:02:45.403605 rollbar.go:188: ROLLBAR critical http port already in use []
[region= release=] 2021/10/07 16:02:45.403666 rollbar.go:182: rollbar [critical]: http port already in use []
[region= release=] 2021/10/07 16:02:45.403689 main.go:56: http port already in use
[region= release=] 2021/10/07 16:02:45.403699 rollbar.go:188: ROLLBAR critical http port already in use []
[region= release=] 2021/10/07 16:02:45.403710 rollbar.go:182: rollbar [critical]: http port already in use []
[region= release=] 2021/10/07 16:02:45.403717 alert.go:16: alert: http port already in use
[region= release=] 2021/10/07 16:02:45.403725 main.go:33: http port already in use
blueman-applet 16.02.45 WARNING  PluginManager:147 __load_plugin: Not loading DhcpClient because its conflict has higher priority

(wrapper-2.0:2044): libsystray-CRITICAL **: 16:02:45.674: sn_item_invalidate: assertion 'item->properties_proxy != NULL' failed

(wrapper-2.0:2044): libsystray-CRITICAL **: 16:02:45.929: sn_item_invalidate: assertion 'item->properties_proxy != NULL' failed
xfsettingsd: Another instance took over. Leaving...
xfsettingsd: Another instance took over. Leaving...
** Message: 16:03:14.956: updates_checker.vala:71: check updates
** Message: 16:03:15.352: updates_checker.vala:101: 0 updates found

(xfce4-terminal:3274): Gtk-WARNING **: 16:03:19.759: TerminalWidget 0x5648891b64f0 reported min size 22 and natural size 12 in get_preferred_width(); natural size must be >= min size
xfsettingsd: Another instance took over. Leaving...
** Message: 16:04:20.846: updates_checker.vala:71: check updates
** Message: 16:04:21.063: updates_checker.vala:101: 0 updates found
** Message: 16:05:16.459: updates_checker.vala:71: check updates
** Message: 16:05:16.678: updates_checker.vala:101: 0 updates found
** Message: 16:05:34.235: updates_checker.vala:71: check updates
** Message: 16:05:34.443: updates_checker.vala:101: 0 updates found
[37134:37134:1007/161005.283157:ERROR:password_sync_bridge.cc(439)] Passwords datatype error was encountered: Failed to load entries from password store. Encryption service failure.
[37134:37163:1007/161006.188510:ERROR:chrome_browser_main_extra_parts_metrics.cc(228)] crbug.com/1216328: Checking Bluetooth availability started. Please report if there is no report that this ends.
[37134:37163:1007/161006.188521:ERROR:chrome_browser_main_extra_parts_metrics.cc(231)] crbug.com/1216328: Checking Bluetooth availability ended.
[37134:37163:1007/161006.188527:ERROR:chrome_browser_main_extra_parts_metrics.cc(234)] crbug.com/1216328: Checking default browser status started. Please report if there is no report that this ends.
[37134:37163:1007/161006.204239:ERROR:chrome_browser_main_extra_parts_metrics.cc(238)] crbug.com/1216328: Checking default browser status ended.

I think there is something on the xorgxrdp log that we can use, like this one:

[   564.365] (EE) systemd-logind: failed to get session: PID 37654 does not belong to any known session

So it tries to get an unkown session and it fails, right?

@matt335672
Copy link
Member

The systemd-logind message is related to #1684. We're working on a fix, but it's a massive job. Workarounds are linked in the PR.

Your main problem is the (EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied) message. In turn, I think that's related to these two:-

[   564.364] (**) |   |-->GPUDevice "integrated"
[   564.364] (**) |   |-->GPUDevice "Video Card (xrdpdev)"

The xorgxrdp driver appears to be trying to use your build in video card in addition to the RDP module. That's not really my area, but I suspect it's causing your problem. I don't know if this is a supportable xrdp configuration or not.

It might help if we know where these devices are coming from. What do you get from this command, run as a non-root user?

find /etc /usr/lib* -type f -exec grep -i gpudevice {} + 2>/dev/null

@Pipodi
Copy link
Author

Pipodi commented Oct 7, 2021

My laptop is an "optimus" one, so it has 2 GPUs, the discrete one (Nvidia) and the integrated one. Could it be the culprit here? I have optimus-manager installed, I tried to switch to the integrated GPU but no luck.

The command, btw, does't return any result.

@matt335672
Copy link
Member

I've had a poke around in the Xorg sources, and as far as I can tell, the driver combination that is loaded is quite important. If certain modules are loaded, the X server will try to open the console, and this will be fatal for the X server in this configuration.

I've compared your .xorgxrdp.log with one of my working ones. There are a few significant additions in yours:-

(==) Using config directory: "/etc/X11/xorg.conf.d"
 (**) OutputClass "nvidia" ModulePath extended to "/usr/lib/nvidia/xorg,/usr/lib/xorg/modules,/usr/lib/nvidia,/usr/lib32/nvidia,/usr/lib32/nvidia/xorg/modules,/usr/lib32/xorg/modules,/usr/lib64/nvidia/xorg/modules,/usr/lib64/nvidia/xorg,/usr/lib64/xorg/modules"
 (**) OutputClass "nvidia" ModulePath extended to "/usr/lib/nvidia/xorg,/usr/lib/xorg/modules,/usr/lib/nvidia/xorg,/usr/lib/xorg/modules,/usr/lib/nvidia,/usr/lib32/nvidia,/usr/lib32/nvidia/xorg/modules,/usr/lib32/xorg/modules,/usr/lib64/nvidia/xorg/modules,/usr/lib64/nvidia/xorg,/usr/lib64/xorg/modules"
 (II) LoadModule: "modesetting"
 (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
 (II) Module modesetting: vendor="X.Org Foundation"
 	compiled for 1.20.13, module version = 1.20.13
 	Module class: X.Org Video Driver
 	ABI class: X.Org Video Driver, version 24.1
 (II) modesetting: Driver for Modesetting Kernel Drivers: kms
 (EE) 
Fatal server error:
 (EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)
 (EE) 
 (EE) 

I've got a couple of things for you to look at:-

  1. Can you add this section somewhere in /etc/X11/xrdp/xorg.conf:-
    Section "Module"
            Disable     "modesetting"
    EndSection
    
    I'm hoping this will prevent the modesetting driver loading. This should be obvious from the log file, and we can then see if we've gotten past the /dev/tty0 error.
  2. Failing that, can you provide the contents of any files in /etc/X11/xorg.conf.d

Thanks

@Pipodi
Copy link
Author

Pipodi commented Oct 8, 2021

I've added my user to video and tty groups prior to your answer, so I don't know what solved that error, but I can't see the TTY error anymore:

[   261.206] (WW) Failed to open protocol names file lib/xorg/protocol.txt
[   261.206] 
X.Org X Server 1.20.13
X Protocol Version 11, Revision 0
[   261.206] Build Operating System: Linux Manjaro Linux
[   261.206] Current Operating System: Linux PCABS 5.10.70-1-MANJARO #1 SMP PREEMPT Thu Sep 30 15:29:01 UTC 2021 x86_64
[   261.206] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.10-x86_64 root=UUID=01135b6d-2afc-4866-8400-80dd222761b3 rw quiet resume=UUID=39a87f46-755b-4d74-afdb-dfa6baa111c9 udev.log_priority=3
[   261.206] Build Date: 24 August 2021  10:21:29AM
[   261.206]  
[   261.206] Current version of pixman: 0.40.0
[   261.206] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[   261.206] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   261.206] (++) Log file: ".xorgxrdp.10.log", Time: Fri Oct  8 17:26:43 2021
[   261.206] (++) Using config file: "/etc/X11/xrdp/xorg.conf"
[   261.206] (==) Using config directory: "/etc/X11/xorg.conf.d"
[   261.206] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[   261.206] (**) Option "defaultserverlayout" "X11 Server"
[   261.206] (**) ServerLayout "X11 Server"
[   261.206] (**) |-->Screen "Screen (xrdpdev)" (0)
[   261.206] (**) |   |-->Monitor "Monitor"
[   261.207] (**) |   |-->Device "Video Card (xrdpdev)"
[   261.207] (**) |   |-->GPUDevice "integrated"
[   261.207] (**) |   |-->GPUDevice "Video Card (xrdpdev)"
[   261.207] (**) |-->Input Device "xrdpMouse"
[   261.207] (**) |-->Input Device "xrdpKeyboard"
[   261.207] (**) Option "DontVTSwitch" "on"
[   261.207] (**) Option "AutoAddDevices" "off"
[   261.207] (**) Not automatically adding devices
[   261.207] (==) Automatically enabling devices
[   261.207] (==) Automatically adding GPU devices
[   261.207] (==) Automatically binding GPU devices
[   261.207] (==) Max clients allowed: 256, resource mask: 0x1fffff
[   261.207] (WW) The directory "/usr/share/fonts/OTF" does not exist.
[   261.207] 	Entry deleted from font path.
[   261.207] (WW) The directory "/usr/share/fonts/Type1" does not exist.
[   261.207] 	Entry deleted from font path.
[   261.207] (WW) The directory "/usr/share/fonts/100dpi" does not exist.
[   261.207] 	Entry deleted from font path.
[   261.207] (WW) The directory "/usr/share/fonts/75dpi" does not exist.
[   261.207] 	Entry deleted from font path.
[   261.207] (==) FontPath set to:
	/usr/share/fonts/misc,
	/usr/share/fonts/TTF
[   261.207] (**) ModulePath set to "/usr/lib/nvidia,/usr/lib32/nvidia,/usr/lib32/nvidia/xorg/modules,/usr/lib32/xorg/modules,/usr/lib64/nvidia/xorg/modules,/usr/lib64/nvidia/xorg,/usr/lib64/xorg/modules"
[   261.207] (II) Module ABI versions:
[   261.207] 	X.Org ANSI C Emulation: 0.4
[   261.207] 	X.Org Video Driver: 24.1
[   261.207] 	X.Org XInput driver : 24.1
[   261.207] 	X.Org Server Extension : 10.0
[   261.207] (--) using VT number 1

[   261.207] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[   261.208] (II) xfree86: Adding drm device (/dev/dri/card1)
[   261.208] (II) xfree86: Adding drm device (/dev/dri/card0)
[   261.208] (EE) /dev/dri/card0: failed to set DRM interface version 1.4: Permission denied
[   261.209] (**) OutputClass "nvidia" ModulePath extended to "/usr/lib/nvidia/xorg,/usr/lib/xorg/modules,/usr/lib/nvidia,/usr/lib32/nvidia,/usr/lib32/nvidia/xorg/modules,/usr/lib32/xorg/modules,/usr/lib64/nvidia/xorg/modules,/usr/lib64/nvidia/xorg,/usr/lib64/xorg/modules"
[   261.209] (**) OutputClass "nvidia" ModulePath extended to "/usr/lib/nvidia/xorg,/usr/lib/xorg/modules,/usr/lib/nvidia/xorg,/usr/lib/xorg/modules,/usr/lib/nvidia,/usr/lib32/nvidia,/usr/lib32/nvidia/xorg/modules,/usr/lib32/xorg/modules,/usr/lib64/nvidia/xorg/modules,/usr/lib64/nvidia/xorg,/usr/lib64/xorg/modules"
[   261.210] (--) PCI:*(0@0:2:0) 8086:3e9b:103c:85fc rev 0, Mem @ 0xb2000000/16777216, 0x80000000/536870912, I/O @ 0x00006000/64, BIOS @ 0x????????/131072
[   261.210] (--) PCI: (1@0:0:0) 10de:1f91:103c:85fc rev 161, Mem @ 0xb3000000/16777216, 0xa0000000/268435456, 0xb0000000/33554432, I/O @ 0x00005000/128, BIOS @ 0x????????/524288
[   261.210] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[   261.210] (WW) "modesetting" will not be loaded unless you've specified it to be loaded elsewhere.
[   261.210] (II) "glx" will be loaded by default.
[   261.210] (II) LoadModule: "glx"
[   261.210] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[   261.211] (II) Module glx: vendor="X.Org Foundation"
[   261.211] 	compiled for 1.20.13, module version = 1.0.0
[   261.211] 	ABI class: X.Org Server Extension, version 10.0
[   261.211] (II) LoadModule: "xrdpdev"
[   261.211] (II) Loading /usr/lib/xorg/modules/drivers/xrdpdev_drv.so
[   261.211] (EE) Failed to load /usr/lib/xorg/modules/drivers/xrdpdev_drv.so: /usr/lib/xorg/modules/drivers/xrdpdev_drv.so: undefined symbol: rdpRRModeDestroy
[   261.211] (EE) Failed to load module "xrdpdev" (loader failed, 0)
[   261.211] (II) LoadModule: "modesetting"
[   261.211] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[   261.211] (II) Module modesetting: vendor="X.Org Foundation"
[   261.211] 	compiled for 1.20.13, module version = 1.20.13
[   261.211] 	Module class: X.Org Video Driver
[   261.211] 	ABI class: X.Org Video Driver, version 24.1
[   261.211] (II) LoadModule: "xrdpmouse"
[   261.212] (II) Loading /usr/lib/xorg/modules/input/xrdpmouse_drv.so
[   261.212] (EE) Failed to load /usr/lib/xorg/modules/input/xrdpmouse_drv.so: /usr/lib/xorg/modules/input/xrdpmouse_drv.so: undefined symbol: rdpUnregisterInputCallback
[   261.212] (EE) Failed to load module "xrdpmouse" (loader failed, 0)
[   261.212] (II) LoadModule: "xrdpkeyb"
[   261.212] (II) Loading /usr/lib/xorg/modules/input/xrdpkeyb_drv.so
[   261.212] (EE) Failed to load /usr/lib/xorg/modules/input/xrdpkeyb_drv.so: /usr/lib/xorg/modules/input/xrdpkeyb_drv.so: undefined symbol: rdpUnregisterInputCallback
[   261.212] (EE) Failed to load module "xrdpkeyb" (loader failed, 0)
[   261.212] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[   261.212] (EE) 
Fatal server error:
[   261.212] (EE) xf86OpenConsole: Cannot open virtual console 1 (Permission denied)
[   261.212] (EE) 
[   261.212] (EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
[   261.212] (EE) Please also check the log file at ".xorgxrdp.10.log" for additional information.
[   261.212] (EE) 
[   261.212] (WW) xf86CloseConsole: KDSETMODE failed: Bad file descriptor
[   261.212] (WW) xf86CloseConsole: VT_GETMODE failed: Bad file descriptor
[   261.212] (EE) Server terminated with error (1). Closing log file.

@matt335672
Copy link
Member

matt335672 commented Oct 11, 2021

This looks like a different manifestation of the same error. The code is calling xf86OpenConsole(), and then it's game over. The error is different as you've added the user to the tty group.

I note the modesetting driver is still being loaded, so something is still triggering that.

Can you provide the contents of any files in /etc/X11/xorg.conf.d? That may well hold something interesting.

EDIT : Can you also see what's in /usr/share/X11/xorg.conf.d ?

@Pipodi
Copy link
Author

Pipodi commented Oct 11, 2021

Inside of /etc/X11/xorg.conf.d I have 2 files, 00-keyboard.conf and 10-optimus-manager.conf

00-keyboard.conf

# Read and parsed by systemd-localed. It's probably wise not to edit this file
# manually too freely.
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "us"
        Option "XkbVariant" "alt-intl"
EndSection

10-optimus-manager.conf

Section "Device"
	Identifier "integrated"
	Driver "modesetting"
	BusID "PCI:0:2:0"
	Option "DRI" "3"
EndSection

In /usr/share/X11/xorg.conf.d I have:

10-amdgpu-nvidia-drm-outputclass.conf  10-intel-nvidia-drm-outputclass.conf  40-libinput.conf
10-evdev.conf                          10-quirks.conf

10-amdgpu-nvidia-drm-outputclass.conf

Section "ServerLayout"
    Identifier "layout"
    Option "AllowNVIDIAGPUScreens"
EndSection

Section "OutputClass"
    Identifier "AMDgpu"
    MatchDriver "amdgpu"
    Driver "amdgpu"
EndSection

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    ModulePath "/usr/lib/nvidia/xorg"
    ModulePath "/usr/lib/xorg/modules"
EndSection

10-intel-nvidia-drm-outputclass.conf

Section "ServerLayout"
    Identifier "layout"
    Option "AllowNVIDIAGPUScreens"
EndSection

Section "OutputClass"
    Identifier "intel"
    MatchDriver "i915"
    Driver "modesetting"
EndSection

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    ModulePath "/usr/lib/nvidia/xorg"
    ModulePath "/usr/lib/xorg/modules"
EndSection

40-libinput.conf

# Match on all types of devices but joysticks
#
# If you want to configure your devices, do not copy this file.
# Instead, use a config snippet that contains something like this:
#
# Section "InputClass"
#   Identifier "something or other"
#   MatchDriver "libinput"
#
#   MatchIsTouchpad "on"
#   ... other Match directives ...
#   Option "someoption" "value"
# EndSection
#
# This applies the option any libinput device also matched by the other
# directives. See the xorg.conf(5) man page for more info on
# matching devices.

Section "InputClass"
        Identifier "libinput pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "libinput keyboard catchall"
        MatchIsKeyboard "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "libinput touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "libinput touchscreen catchall"
        MatchIsTouchscreen "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "libinput tablet catchall"
        MatchIsTablet "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

10-evdev.conf

#
# Catch-all evdev loader for udev-based systems
# We don't simply match on any device since that also adds accelerometers
# and other devices that we don't really want to use. The list below
# matches everything but joysticks.

Section "InputClass"
        Identifier "evdev pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection

Section "InputClass"
        Identifier "evdev keyboard catchall"
        MatchIsKeyboard "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection

Section "InputClass"
        Identifier "evdev touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection

Section "InputClass"
        Identifier "evdev tablet catchall"
        MatchIsTablet "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection

Section "InputClass"
        Identifier "evdev touchscreen catchall"
        MatchIsTouchscreen "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection

10-quirks.conf

# Collection of quirks and blacklist/whitelists for specific devices.


# Accelerometer device, posts data through ABS_X/ABS_Y, making X unusable
# http://bugs.freedesktop.org/show_bug.cgi?id=22442 
Section "InputClass"
        Identifier "ThinkPad HDAPS accelerometer blacklist"
        MatchProduct "ThinkPad HDAPS accelerometer data"
        Option "Ignore" "on"
EndSection

# https://bugzilla.redhat.com/show_bug.cgi?id=523914
# Mouse does not move in PV Xen guest
# Explicitly tell evdev to not ignore the absolute axes.
Section "InputClass"
        Identifier "Xen Virtual Pointer axis blacklist"
        MatchProduct "Xen Virtual Pointer"
        Option "IgnoreAbsoluteAxes" "off"
        Option "IgnoreRelativeAxes" "off"
EndSection

# https://bugs.freedesktop.org/show_bug.cgi?id=55867
# Bug 55867 - Doesn't know how to tag XI_TRACKBALL
Section "InputClass"
        Identifier "Tag trackballs as XI_TRACKBALL"
        MatchProduct "trackball"
        MatchDriver "evdev"
        Option "TypeName" "TRACKBALL"
EndSection

# https://bugs.freedesktop.org/show_bug.cgi?id=62831
# Bug 62831 - Mionix Naos 5000 mouse detected incorrectly
Section "InputClass"
        Identifier "Tag Mionix Naos 5000 mouse XI_MOUSE"
        MatchProduct "La-VIEW Technology Naos 5000 Mouse"
        MatchDriver "evdev"
        Option "TypeName" "MOUSE"
EndSection

@matt335672
Copy link
Member

It looks like the problem is in /etc/X11/xorg.conf.d/10-optimus-manager.conf which forces a load of the modesetting module.

Can you vertify that by (temporarily) renaming /etc/X11/xorg.conf.d/10-optimus-manager.conf to /etc/X11/xorg.conf.d/10-optimus-manager.conf_ and seeing if xorgxrdp will start? If it doesn't, please paste the resulting log file.

@Pipodi
Copy link
Author

Pipodi commented Oct 11, 2021

Renamed, rebooted, tried to connect from Windows 11, no luck. I think it's the same log, tho (I deleted the file before trying to connect):

[   127.617] (WW) Failed to open protocol names file lib/xorg/protocol.txt
[   127.617] 
X.Org X Server 1.20.13
X Protocol Version 11, Revision 0
[   127.617] Build Operating System: Linux Manjaro Linux
[   127.617] Current Operating System: Linux PCABS 5.10.70-1-MANJARO #1 SMP PREEMPT Thu Sep 30 15:29:01 UTC 2021 x86_64
[   127.617] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.10-x86_64 root=UUID=01135b6d-2afc-4866-8400-80dd222761b3 rw quiet resume=UUID=39a87f46-755b-4d74-afdb-dfa6baa111c9 udev.log_priority=3
[   127.617] Build Date: 24 August 2021  10:21:29AM
[   127.617]  
[   127.617] Current version of pixman: 0.40.0
[   127.617] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[   127.617] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   127.617] (++) Log file: ".xorgxrdp.10.log", Time: Mon Oct 11 14:04:32 2021
[   127.617] (++) Using config file: "/etc/X11/xrdp/xorg.conf"
[   127.617] (==) Using config directory: "/etc/X11/xorg.conf.d"
[   127.617] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[   127.617] (**) Option "defaultserverlayout" "X11 Server"
[   127.617] (**) ServerLayout "X11 Server"
[   127.617] (**) |-->Screen "Screen (xrdpdev)" (0)
[   127.617] (**) |   |-->Monitor "Monitor"
[   127.618] (**) |   |-->Device "Video Card (xrdpdev)"
[   127.618] (**) |   |-->GPUDevice "integrated"
[   127.618] (**) |   |-->GPUDevice "Video Card (xrdpdev)"
[   127.618] (**) |-->Input Device "xrdpMouse"
[   127.618] (**) |-->Input Device "xrdpKeyboard"
[   127.618] (**) Option "DontVTSwitch" "on"
[   127.618] (**) Option "AutoAddDevices" "off"
[   127.618] (**) Not automatically adding devices
[   127.618] (==) Automatically enabling devices
[   127.618] (==) Automatically adding GPU devices
[   127.618] (==) Automatically binding GPU devices
[   127.618] (==) Max clients allowed: 256, resource mask: 0x1fffff
[   127.618] (WW) The directory "/usr/share/fonts/OTF" does not exist.
[   127.618] 	Entry deleted from font path.
[   127.618] (WW) The directory "/usr/share/fonts/Type1" does not exist.
[   127.618] 	Entry deleted from font path.
[   127.618] (WW) The directory "/usr/share/fonts/100dpi" does not exist.
[   127.618] 	Entry deleted from font path.
[   127.618] (WW) The directory "/usr/share/fonts/75dpi" does not exist.
[   127.618] 	Entry deleted from font path.
[   127.618] (==) FontPath set to:
	/usr/share/fonts/misc,
	/usr/share/fonts/TTF
[   127.618] (**) ModulePath set to "/usr/lib/nvidia,/usr/lib32/nvidia,/usr/lib32/nvidia/xorg/modules,/usr/lib32/xorg/modules,/usr/lib64/nvidia/xorg/modules,/usr/lib64/nvidia/xorg,/usr/lib64/xorg/modules"
[   127.618] (II) Module ABI versions:
[   127.618] 	X.Org ANSI C Emulation: 0.4
[   127.618] 	X.Org Video Driver: 24.1
[   127.618] 	X.Org XInput driver : 24.1
[   127.618] 	X.Org Server Extension : 10.0
[   127.618] (--) using VT number 1

[   127.618] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[   127.618] (II) xfree86: Adding drm device (/dev/dri/card1)
[   127.619] (II) xfree86: Adding drm device (/dev/dri/card0)
[   127.619] (EE) /dev/dri/card0: failed to set DRM interface version 1.4: Permission denied
[   127.619] (**) OutputClass "nvidia" ModulePath extended to "/usr/lib/nvidia/xorg,/usr/lib/xorg/modules,/usr/lib/nvidia,/usr/lib32/nvidia,/usr/lib32/nvidia/xorg/modules,/usr/lib32/xorg/modules,/usr/lib64/nvidia/xorg/modules,/usr/lib64/nvidia/xorg,/usr/lib64/xorg/modules"
[   127.619] (**) OutputClass "nvidia" ModulePath extended to "/usr/lib/nvidia/xorg,/usr/lib/xorg/modules,/usr/lib/nvidia/xorg,/usr/lib/xorg/modules,/usr/lib/nvidia,/usr/lib32/nvidia,/usr/lib32/nvidia/xorg/modules,/usr/lib32/xorg/modules,/usr/lib64/nvidia/xorg/modules,/usr/lib64/nvidia/xorg,/usr/lib64/xorg/modules"
[   127.620] (--) PCI:*(0@0:2:0) 8086:3e9b:103c:85fc rev 0, Mem @ 0xb2000000/16777216, 0x80000000/536870912, I/O @ 0x00006000/64, BIOS @ 0x????????/131072
[   127.620] (--) PCI: (1@0:0:0) 10de:1f91:103c:85fc rev 161, Mem @ 0xb3000000/16777216, 0xa0000000/268435456, 0xb0000000/33554432, I/O @ 0x00005000/128, BIOS @ 0x????????/524288
[   127.620] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[   127.620] (WW) "modesetting" will not be loaded unless you've specified it to be loaded elsewhere.
[   127.620] (II) "glx" will be loaded by default.
[   127.620] (II) LoadModule: "glx"
[   127.620] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[   127.621] (II) Module glx: vendor="X.Org Foundation"
[   127.621] 	compiled for 1.20.13, module version = 1.0.0
[   127.621] 	ABI class: X.Org Server Extension, version 10.0
[   127.621] (II) LoadModule: "xrdpdev"
[   127.621] (II) Loading /usr/lib/xorg/modules/drivers/xrdpdev_drv.so
[   127.621] (EE) Failed to load /usr/lib/xorg/modules/drivers/xrdpdev_drv.so: /usr/lib/xorg/modules/drivers/xrdpdev_drv.so: undefined symbol: rdpRRModeDestroy
[   127.621] (EE) Failed to load module "xrdpdev" (loader failed, 0)
[   127.621] (II) LoadModule: "modesetting"
[   127.621] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[   127.621] (II) Module modesetting: vendor="X.Org Foundation"
[   127.621] 	compiled for 1.20.13, module version = 1.20.13
[   127.621] 	Module class: X.Org Video Driver
[   127.621] 	ABI class: X.Org Video Driver, version 24.1
[   127.621] (II) LoadModule: "xrdpmouse"
[   127.621] (II) Loading /usr/lib/xorg/modules/input/xrdpmouse_drv.so
[   127.621] (EE) Failed to load /usr/lib/xorg/modules/input/xrdpmouse_drv.so: /usr/lib/xorg/modules/input/xrdpmouse_drv.so: undefined symbol: rdpUnregisterInputCallback
[   127.621] (EE) Failed to load module "xrdpmouse" (loader failed, 0)
[   127.621] (II) LoadModule: "xrdpkeyb"
[   127.622] (II) Loading /usr/lib/xorg/modules/input/xrdpkeyb_drv.so
[   127.622] (EE) Failed to load /usr/lib/xorg/modules/input/xrdpkeyb_drv.so: /usr/lib/xorg/modules/input/xrdpkeyb_drv.so: undefined symbol: rdpUnregisterInputCallback
[   127.622] (EE) Failed to load module "xrdpkeyb" (loader failed, 0)
[   127.622] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[   127.622] (EE) 
Fatal server error:
[   127.622] (EE) xf86OpenConsole: Cannot open virtual console 1 (Permission denied)
[   127.622] (EE) 
[   127.622] (EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
[   127.622] (EE) Please also check the log file at ".xorgxrdp.10.log" for additional information.
[   127.622] (EE) 
[   127.622] (WW) xf86CloseConsole: KDSETMODE failed: Bad file descriptor
[   127.622] (WW) xf86CloseConsole: VT_GETMODE failed: Bad file descriptor
[   127.622] (EE) Server terminated with error (1). Closing log file.

@matt335672
Copy link
Member

Same problem - modesetting module is being loaded.

It's possible you've connected to a different DISPLAY. Try ls -a ~ and see of there are any other .xorgxrdp.*.log files which are newer.

The bottom line is we need to get to the bottom of why the modesetting driver is being loaded.

According to my reading of the manpages, renaming a .conf file in /etc/X11/xorg.conf.d/ to .conf_ should prevent it being scanned. Maybe it isn't. You could try temporarily renaming /etc/X11/xorg.conf.d/ to /etc/X11/xorg.conf.d_/ to see what happens.

Another option is to investigate loading the Xvnc backend in place of the Xorg backend. This may be the only solution that will work with the Optimus manager, but it's possibly a bit early to say that for sure.

@Pipodi
Copy link
Author

Pipodi commented Oct 11, 2021

Nope, there is only one xorgxrdp log file in my home.

Another thing I've just seen is that even if I renamed the .conf file with .conf_, the file will be recreated after rebooting the machine.

I also renamed the file adding a .bak, but the file will be recreated. I suspect Optimus Manager does something at every boot.

@Pipodi
Copy link
Author

Pipodi commented Oct 11, 2021

I misunderstood the renaming part, I thought you told me to rename the files inside the folder, not the folder itself. I've now renamed the folder with the trailing _ and I think nothing changed (I also switched the mode from Nvidia mode to hybrid mode, because I tried to use the integrated GPU only but I've got an "no screen found" error):

[   134.885] (WW) Failed to open protocol names file lib/xorg/protocol.txt
[   134.885] 
X.Org X Server 1.20.13
X Protocol Version 11, Revision 0
[   134.885] Build Operating System: Linux Manjaro Linux
[   134.885] Current Operating System: Linux PCABS 5.10.70-1-MANJARO #1 SMP PREEMPT Thu Sep 30 15:29:01 UTC 2021 x86_64
[   134.885] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.10-x86_64 root=UUID=01135b6d-2afc-4866-8400-80dd222761b3 rw quiet resume=UUID=39a87f46-755b-4d74-afdb-dfa6baa111c9 udev.log_priority=3
[   134.885] Build Date: 24 August 2021  10:21:29AM
[   134.885]  
[   134.885] Current version of pixman: 0.40.0
[   134.885] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[   134.885] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   134.885] (++) Log file: ".xorgxrdp.10.log", Time: Mon Oct 11 23:24:01 2021
[   134.886] (++) Using config file: "/etc/X11/xrdp/xorg.conf"
[   134.886] (==) Using config directory: "/etc/X11/xorg.conf.d"
[   134.886] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[   134.886] (**) Option "defaultserverlayout" "X11 Server"
[   134.886] (**) ServerLayout "X11 Server"
[   134.886] (**) |-->Screen "Screen (xrdpdev)" (0)
[   134.886] (**) |   |-->Monitor "Monitor"
[   134.886] (**) |   |-->Device "Video Card (xrdpdev)"
[   134.886] (**) |   |-->GPUDevice "nvidia"
[   134.886] (**) |   |-->GPUDevice "Video Card (xrdpdev)"
[   134.886] (**) |-->Input Device "xrdpMouse"
[   134.886] (**) |-->Input Device "xrdpKeyboard"
[   134.886] (**) Option "DontVTSwitch" "on"
[   134.886] (**) Option "AutoAddDevices" "off"
[   134.886] (**) Not automatically adding devices
[   134.886] (==) Automatically enabling devices
[   134.886] (==) Automatically adding GPU devices
[   134.886] (==) Automatically binding GPU devices
[   134.886] (==) Max clients allowed: 256, resource mask: 0x1fffff
[   134.886] (WW) The directory "/usr/share/fonts/OTF" does not exist.
[   134.886] 	Entry deleted from font path.
[   134.886] (WW) The directory "/usr/share/fonts/Type1" does not exist.
[   134.886] 	Entry deleted from font path.
[   134.886] (WW) The directory "/usr/share/fonts/100dpi" does not exist.
[   134.886] 	Entry deleted from font path.
[   134.886] (WW) The directory "/usr/share/fonts/75dpi" does not exist.
[   134.886] 	Entry deleted from font path.
[   134.886] (==) FontPath set to:
	/usr/share/fonts/misc,
	/usr/share/fonts/TTF
[   134.886] (**) ModulePath set to "/usr/lib/nvidia,/usr/lib32/nvidia,/usr/lib32/nvidia/xorg/modules,/usr/lib32/xorg/modules,/usr/lib64/nvidia/xorg/modules,/usr/lib64/nvidia/xorg,/usr/lib64/xorg/modules"
[   134.886] (II) Module ABI versions:
[   134.886] 	X.Org ANSI C Emulation: 0.4
[   134.886] 	X.Org Video Driver: 24.1
[   134.886] 	X.Org XInput driver : 24.1
[   134.886] 	X.Org Server Extension : 10.0
[   134.887] (--) using VT number 1

[   134.887] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[   134.887] (II) xfree86: Adding drm device (/dev/dri/card1)
[   134.887] (II) xfree86: Adding drm device (/dev/dri/card0)
[   134.887] (EE) /dev/dri/card0: failed to set DRM interface version 1.4: Permission denied
[   134.888] (**) OutputClass "nvidia" ModulePath extended to "/usr/lib/nvidia/xorg,/usr/lib/xorg/modules,/usr/lib/nvidia,/usr/lib32/nvidia,/usr/lib32/nvidia/xorg/modules,/usr/lib32/xorg/modules,/usr/lib64/nvidia/xorg/modules,/usr/lib64/nvidia/xorg,/usr/lib64/xorg/modules"
[   134.888] (**) OutputClass "nvidia" ModulePath extended to "/usr/lib/nvidia/xorg,/usr/lib/xorg/modules,/usr/lib/nvidia/xorg,/usr/lib/xorg/modules,/usr/lib/nvidia,/usr/lib32/nvidia,/usr/lib32/nvidia/xorg/modules,/usr/lib32/xorg/modules,/usr/lib64/nvidia/xorg/modules,/usr/lib64/nvidia/xorg,/usr/lib64/xorg/modules"
[   134.889] (--) PCI:*(0@0:2:0) 8086:3e9b:103c:85fc rev 0, Mem @ 0xb2000000/16777216, 0x80000000/536870912, I/O @ 0x00006000/64, BIOS @ 0x????????/131072
[   134.889] (--) PCI: (1@0:0:0) 10de:1f91:103c:85fc rev 161, Mem @ 0xb3000000/16777216, 0xa0000000/268435456, 0xb0000000/33554432, I/O @ 0x00005000/128, BIOS @ 0x????????/524288
[   134.889] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[   134.889] (WW) "modesetting" will not be loaded unless you've specified it to be loaded elsewhere.
[   134.889] (II) "glx" will be loaded by default.
[   134.889] (II) LoadModule: "glx"
[   134.889] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[   134.890] (II) Module glx: vendor="X.Org Foundation"
[   134.890] 	compiled for 1.20.13, module version = 1.0.0
[   134.890] 	ABI class: X.Org Server Extension, version 10.0
[   134.890] (II) LoadModule: "xrdpdev"
[   134.890] (II) Loading /usr/lib/xorg/modules/drivers/xrdpdev_drv.so
[   134.890] (EE) Failed to load /usr/lib/xorg/modules/drivers/xrdpdev_drv.so: /usr/lib/xorg/modules/drivers/xrdpdev_drv.so: undefined symbol: rdpRRModeDestroy
[   134.890] (EE) Failed to load module "xrdpdev" (loader failed, 0)
[   134.890] (II) LoadModule: "nvidia"
[   134.890] (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so
[   134.890] (II) Module nvidia: vendor="NVIDIA Corporation"
[   134.890] 	compiled for 1.6.99.901, module version = 1.0.0
[   134.890] 	Module class: X.Org Video Driver
[   134.890] (II) LoadModule: "xrdpmouse"
[   134.890] (II) Loading /usr/lib/xorg/modules/input/xrdpmouse_drv.so
[   134.890] (EE) Failed to load /usr/lib/xorg/modules/input/xrdpmouse_drv.so: /usr/lib/xorg/modules/input/xrdpmouse_drv.so: undefined symbol: rdpUnregisterInputCallback
[   134.890] (EE) Failed to load module "xrdpmouse" (loader failed, 0)
[   134.890] (II) LoadModule: "xrdpkeyb"
[   134.890] (II) Loading /usr/lib/xorg/modules/input/xrdpkeyb_drv.so
[   134.890] (EE) Failed to load /usr/lib/xorg/modules/input/xrdpkeyb_drv.so: /usr/lib/xorg/modules/input/xrdpkeyb_drv.so: undefined symbol: rdpUnregisterInputCallback
[   134.890] (EE) Failed to load module "xrdpkeyb" (loader failed, 0)
[   134.890] (II) NVIDIA dlloader X Driver  470.63.01  Tue Aug  3 20:37:27 UTC 2021
[   134.890] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[   134.890] (EE) 
Fatal server error:
[   134.890] (EE) xf86OpenConsole: Cannot open virtual console 1 (Permission denied)
[   134.890] (EE) 
[   134.890] (EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
[   134.890] (EE) Please also check the log file at ".xorgxrdp.10.log" for additional information.
[   134.890] (EE) 
[   134.890] (WW) xf86CloseConsole: KDSETMODE failed: Bad file descriptor
[   134.890] (WW) xf86CloseConsole: VT_GETMODE failed: Bad file descriptor
[   134.890] (EE) Server terminated with error (1). Closing log file.

@matt335672
Copy link
Member

From what I can see from the xserver sources, that log file isn't consistent with the directory being renamed. You've still got this line present:-

Using config directory: "/etc/X11/xorg.conf.d"

On a test CentOS 7 VM I've got, that line disappears if the directory isn't present:-

$ /tmp/Xorg :10

X.Org X Server 1.20.4
X Protocol Version 11, Revision 0
Build Operating System:  3.10.0-957.1.3.el7.x86_64 
Current Operating System: Linux centos7.lan 3.10.0-1160.36.2.el7.x86_64 #1 SMP Wed Jul 21 11:57:15 UTC 2021 x86_64
Kernel command line: BOOT_IMAGE=/vmlinuz-3.10.0-1160.36.2.el7.x86_64 root=/dev/mapper/centos_centos7-root ro crashkernel=auto rd.lvm.lv=centos_centos7/root rd.lvm.lv=centos_centos7/swap rhgb quiet LANG=en_GB.UTF-8
. . .
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE) 
Fatal server error:
(EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)
(EE) 
. . .
$ sudo mv /etc/X11/xorg.conf.d /etc/X11/xorg.conf.d_
$ /tmp/Xorg :10

X.Org X Server 1.20.4
X Protocol Version 11, Revision 0
Build Operating System:  3.10.0-957.1.3.el7.x86_64 
Current Operating System: Linux centos7.lan 3.10.0-1160.36.2.el7.x86_64 #1 SMP Wed Jul 21 11:57:15 UTC 2021 x86_64
Kernel command line: BOOT_IMAGE=/vmlinuz-3.10.0-1160.36.2.el7.x86_64 root=/dev/mapper/centos_centos7-root ro crashkernel=auto rd.lvm.lv=centos_centos7/root rd.lvm.lv=centos_centos7/swap rhgb quiet LANG=en_GB.UTF-8
. . .
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE) 
Fatal server error:
(EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)
(EE) 

Can you investigate that on your system? Keeping track of file dates may be a useful thing to do.

@Pipodi
Copy link
Author

Pipodi commented Oct 12, 2021

It seems that the folder is recreated at boot too. In fact, with ls /etc/X11/ I can see both folders, xorg.conf.d and the one with the trailing underscore. Inside the first folder, there is the 10-optimus-manager.conf, so I suspect Optimus Manager does something at boot here. Should I disable it?

@matt335672
Copy link
Member

Try that for starters.

Any extra info is useful at this stage. I'm hopeful we can find a way to get these two to play together nicely.

@Pipodi
Copy link
Author

Pipodi commented Oct 12, 2021

Disabled the service, this is the log after rebooting the machine:

[    55.779] (WW) Failed to open protocol names file lib/xorg/protocol.txt
[    55.779] 
X.Org X Server 1.20.13
X Protocol Version 11, Revision 0
[    55.779] Build Operating System: Linux Manjaro Linux
[    55.779] Current Operating System: Linux PCABS 5.10.70-1-MANJARO #1 SMP PREEMPT Thu Sep 30 15:29:01 UTC 2021 x86_64
[    55.779] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.10-x86_64 root=UUID=01135b6d-2afc-4866-8400-80dd222761b3 rw quiet resume=UUID=39a87f46-755b-4d74-afdb-dfa6baa111c9 udev.log_priority=3
[    55.779] Build Date: 24 August 2021  10:21:29AM
[    55.779]  
[    55.779] Current version of pixman: 0.40.0
[    55.779] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[    55.779] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    55.779] (++) Log file: ".xorgxrdp.10.log", Time: Tue Oct 12 17:03:39 2021
[    55.780] (++) Using config file: "/etc/X11/xrdp/xorg.conf"
[    55.780] (==) Using config directory: "/etc/X11/xorg.conf.d"
[    55.780] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[    55.780] (**) Option "defaultserverlayout" "X11 Server"
[    55.780] (**) ServerLayout "X11 Server"
[    55.780] (**) |-->Screen "Screen (xrdpdev)" (0)
[    55.780] (**) |   |-->Monitor "Monitor"
[    55.780] (**) |   |-->Device "Video Card (xrdpdev)"
[    55.780] (**) |   |-->GPUDevice "nvidia"
[    55.780] (**) |   |-->GPUDevice "Video Card (xrdpdev)"
[    55.780] (**) |-->Input Device "xrdpMouse"
[    55.780] (**) |-->Input Device "xrdpKeyboard"
[    55.780] (**) Option "DontVTSwitch" "on"
[    55.780] (**) Option "AutoAddDevices" "off"
[    55.780] (**) Not automatically adding devices
[    55.780] (==) Automatically enabling devices
[    55.780] (==) Automatically adding GPU devices
[    55.780] (==) Automatically binding GPU devices
[    55.780] (==) Max clients allowed: 256, resource mask: 0x1fffff
[    55.780] (WW) The directory "/usr/share/fonts/OTF" does not exist.
[    55.780] 	Entry deleted from font path.
[    55.780] (WW) The directory "/usr/share/fonts/Type1" does not exist.
[    55.780] 	Entry deleted from font path.
[    55.780] (WW) The directory "/usr/share/fonts/100dpi" does not exist.
[    55.780] 	Entry deleted from font path.
[    55.780] (WW) The directory "/usr/share/fonts/75dpi" does not exist.
[    55.780] 	Entry deleted from font path.
[    55.780] (==) FontPath set to:
	/usr/share/fonts/misc,
	/usr/share/fonts/TTF
[    55.780] (**) ModulePath set to "/usr/lib/nvidia,/usr/lib32/nvidia,/usr/lib32/nvidia/xorg/modules,/usr/lib32/xorg/modules,/usr/lib64/nvidia/xorg/modules,/usr/lib64/nvidia/xorg,/usr/lib64/xorg/modules"
[    55.780] (II) Module ABI versions:
[    55.780] 	X.Org ANSI C Emulation: 0.4
[    55.780] 	X.Org Video Driver: 24.1
[    55.780] 	X.Org XInput driver : 24.1
[    55.780] 	X.Org Server Extension : 10.0
[    55.781] (--) using VT number 1

[    55.781] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[    55.781] (II) xfree86: Adding drm device (/dev/dri/card0)
[    55.781] (EE) /dev/dri/card0: failed to set DRM interface version 1.4: Permission denied
[    55.783] (--) PCI:*(0@0:2:0) 8086:3e9b:103c:85fc rev 0, Mem @ 0xb2000000/16777216, 0x80000000/536870912, I/O @ 0x00006000/64, BIOS @ 0x????????/131072
[    55.783] (--) PCI: (1@0:0:0) 10de:1f91:103c:85fc rev 161, Mem @ 0xb3000000/16777216, 0xa0000000/268435456, 0xb0000000/33554432, I/O @ 0x00005000/128, BIOS @ 0x????????/524288
[    55.783] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[    55.783] (WW) "modesetting" will not be loaded unless you've specified it to be loaded elsewhere.
[    55.783] (II) "glx" will be loaded by default.
[    55.783] (II) LoadModule: "glx"
[    55.783] (II) Loading /usr/lib64/xorg/modules/extensions/libglx.so
[    55.784] (II) Module glx: vendor="X.Org Foundation"
[    55.784] 	compiled for 1.20.13, module version = 1.0.0
[    55.784] 	ABI class: X.Org Server Extension, version 10.0
[    55.784] (II) LoadModule: "xrdpdev"
[    55.784] (II) Loading /usr/lib64/xorg/modules/drivers/xrdpdev_drv.so
[    55.784] (EE) Failed to load /usr/lib64/xorg/modules/drivers/xrdpdev_drv.so: /usr/lib64/xorg/modules/drivers/xrdpdev_drv.so: undefined symbol: rdpRRModeDestroy
[    55.784] (EE) Failed to load module "xrdpdev" (loader failed, 0)
[    55.784] (II) LoadModule: "nvidia"
[    55.784] (II) Loading /usr/lib64/xorg/modules/drivers/nvidia_drv.so
[    55.785] (II) Module nvidia: vendor="NVIDIA Corporation"
[    55.785] 	compiled for 1.6.99.901, module version = 1.0.0
[    55.785] 	Module class: X.Org Video Driver
[    55.785] (II) LoadModule: "xrdpmouse"
[    55.785] (II) Loading /usr/lib64/xorg/modules/input/xrdpmouse_drv.so
[    55.785] (EE) Failed to load /usr/lib64/xorg/modules/input/xrdpmouse_drv.so: /usr/lib64/xorg/modules/input/xrdpmouse_drv.so: undefined symbol: rdpUnregisterInputCallback
[    55.785] (EE) Failed to load module "xrdpmouse" (loader failed, 0)
[    55.785] (II) LoadModule: "xrdpkeyb"
[    55.785] (II) Loading /usr/lib64/xorg/modules/input/xrdpkeyb_drv.so
[    55.785] (EE) Failed to load /usr/lib64/xorg/modules/input/xrdpkeyb_drv.so: /usr/lib64/xorg/modules/input/xrdpkeyb_drv.so: undefined symbol: rdpUnregisterInputCallback
[    55.785] (EE) Failed to load module "xrdpkeyb" (loader failed, 0)
[    55.785] (II) NVIDIA dlloader X Driver  470.63.01  Tue Aug  3 20:37:27 UTC 2021
[    55.785] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[    55.785] (EE) 
Fatal server error:
[    55.785] (EE) xf86OpenConsole: Cannot open virtual console 1 (Permission denied)
[    55.785] (EE) 
[    55.785] (EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
[    55.785] (EE) Please also check the log file at ".xorgxrdp.10.log" for additional information.
[    55.785] (EE) 
[    55.785] (WW) xf86CloseConsole: KDSETMODE failed: Bad file descriptor
[    55.785] (WW) xf86CloseConsole: VT_GETMODE failed: Bad file descriptor
[    55.785] (EE) Server terminated with error (1). Closing log file.

@Pipodi
Copy link
Author

Pipodi commented Oct 12, 2021

Ok, seems now that we are with another error. I forgot to delete the "new" xorg.conf.d folder generated by Optimus Manager, now I'm with a no screen error:

[    39.874] (WW) Failed to open protocol names file lib/xorg/protocol.txt
[    39.874] 
X.Org X Server 1.20.13
X Protocol Version 11, Revision 0
[    39.874] Build Operating System: Linux Manjaro Linux
[    39.874] Current Operating System: Linux PCABS 5.10.70-1-MANJARO #1 SMP PREEMPT Thu Sep 30 15:29:01 UTC 2021 x86_64
[    39.874] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.10-x86_64 root=UUID=01135b6d-2afc-4866-8400-80dd222761b3 rw quiet resume=UUID=39a87f46-755b-4d74-afdb-dfa6baa111c9 udev.log_priority=3
[    39.875] Build Date: 24 August 2021  10:21:29AM
[    39.875]  
[    39.875] Current version of pixman: 0.40.0
[    39.875] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[    39.875] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    39.875] (++) Log file: ".xorgxrdp.10.log", Time: Tue Oct 12 18:09:49 2021
[    39.875] (++) Using config file: "/etc/X11/xrdp/xorg.conf"
[    39.875] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[    39.875] (**) Option "defaultserverlayout" "X11 Server"
[    39.875] (**) ServerLayout "X11 Server"
[    39.875] (**) |-->Screen "Screen (xrdpdev)" (0)
[    39.875] (**) |   |-->Monitor "Monitor"
[    39.875] (**) |   |-->Device "Video Card (xrdpdev)"
[    39.875] (**) |-->Input Device "xrdpMouse"
[    39.875] (**) |-->Input Device "xrdpKeyboard"
[    39.875] (**) Option "DontVTSwitch" "on"
[    39.875] (**) Option "AutoAddDevices" "off"
[    39.875] (**) Not automatically adding devices
[    39.875] (==) Automatically enabling devices
[    39.875] (==) Automatically adding GPU devices
[    39.875] (==) Automatically binding GPU devices
[    39.875] (==) Max clients allowed: 256, resource mask: 0x1fffff
[    39.875] (WW) The directory "/usr/share/fonts/OTF" does not exist.
[    39.875] 	Entry deleted from font path.
[    39.876] (WW) The directory "/usr/share/fonts/Type1" does not exist.
[    39.876] 	Entry deleted from font path.
[    39.876] (WW) The directory "/usr/share/fonts/100dpi" does not exist.
[    39.876] 	Entry deleted from font path.
[    39.876] (WW) The directory "/usr/share/fonts/75dpi" does not exist.
[    39.876] 	Entry deleted from font path.
[    39.876] (==) FontPath set to:
	/usr/share/fonts/misc,
	/usr/share/fonts/TTF
[    39.876] (==) ModulePath set to "/usr/lib/xorg/modules"
[    39.876] (II) Module ABI versions:
[    39.876] 	X.Org ANSI C Emulation: 0.4
[    39.876] 	X.Org Video Driver: 24.1
[    39.876] 	X.Org XInput driver : 24.1
[    39.876] 	X.Org Server Extension : 10.0
[    39.876] (--) using VT number 1

[    39.876] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[    39.876] (II) xfree86: Adding drm device (/dev/dri/card0)
[    39.876] (EE) /dev/dri/card0: failed to set DRM interface version 1.4: Permission denied
[    39.878] (--) PCI:*(0@0:2:0) 8086:3e9b:103c:85fc rev 0, Mem @ 0xb2000000/16777216, 0x80000000/536870912, I/O @ 0x00006000/64, BIOS @ 0x????????/131072
[    39.878] (--) PCI: (1@0:0:0) 10de:1f91:103c:85fc rev 161, Mem @ 0xb3000000/16777216, 0xa0000000/268435456, 0xb0000000/33554432, I/O @ 0x00005000/128, BIOS @ 0x????????/524288
[    39.878] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[    39.878] (WW) "modesetting" will not be loaded unless you've specified it to be loaded elsewhere.
[    39.878] (II) "glx" will be loaded by default.
[    39.878] (II) LoadModule: "glx"
[    39.878] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[    39.879] (II) Module glx: vendor="X.Org Foundation"
[    39.879] 	compiled for 1.20.13, module version = 1.0.0
[    39.879] 	ABI class: X.Org Server Extension, version 10.0
[    39.879] (II) LoadModule: "xrdpdev"
[    39.879] (II) Loading /usr/lib/xorg/modules/drivers/xrdpdev_drv.so
[    39.879] (EE) Failed to load /usr/lib/xorg/modules/drivers/xrdpdev_drv.so: /usr/lib/xorg/modules/drivers/xrdpdev_drv.so: undefined symbol: rdpRRModeDestroy
[    39.879] (EE) Failed to load module "xrdpdev" (loader failed, 0)
[    39.879] (II) LoadModule: "xrdpmouse"
[    39.879] (II) Loading /usr/lib/xorg/modules/input/xrdpmouse_drv.so
[    39.880] (EE) Failed to load /usr/lib/xorg/modules/input/xrdpmouse_drv.so: /usr/lib/xorg/modules/input/xrdpmouse_drv.so: undefined symbol: rdpUnregisterInputCallback
[    39.880] (EE) Failed to load module "xrdpmouse" (loader failed, 0)
[    39.880] (II) LoadModule: "xrdpkeyb"
[    39.880] (II) Loading /usr/lib/xorg/modules/input/xrdpkeyb_drv.so
[    39.880] (EE) Failed to load /usr/lib/xorg/modules/input/xrdpkeyb_drv.so: /usr/lib/xorg/modules/input/xrdpkeyb_drv.so: undefined symbol: rdpUnregisterInputCallback
[    39.880] (EE) Failed to load module "xrdpkeyb" (loader failed, 0)
[    39.880] (EE) No drivers available.
[    39.880] (EE) 
Fatal server error:
[    39.880] (EE) no screens found(EE) 
[    39.880] (EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
[    39.880] (EE) Please also check the log file at ".xorgxrdp.10.log" for additional information.
[    39.880] (EE) 
[    39.880] (EE) Server terminated with error (1). Closing log file.

@Pipodi
Copy link
Author

Pipodi commented Oct 12, 2021

Ok, disabling Optimus Manager and forcing the Nvidia card as the only working GPU (https://wiki.archlinux.org/title/NVIDIA_Optimus#Use_NVIDIA_graphics_only) makes me log in with Remote Desktop on Windows 11.

But I want to use Optimus Manager, because when I'm not home I won't be using the Nvidia GPU, so I need to switch back to the Intel GPU.

@matt335672
Copy link
Member

I understand that, and I suspect this is a common enough configuration that it's worth spending some time trying to find a solution.

Here's something else to try. Can you re-install the Optimus Manager and get back to where we've got these lines in the log as per your post here :-

[   564.364] (**) ServerLayout "X11 Server"
[   564.364] (**) |-->Screen "Screen (xrdpdev)" (0)
[   564.364] (**) |   |-->Monitor "Monitor"
[   564.364] (**) |   |-->Device "Video Card (xrdpdev)"
[   564.364] (**) |   |-->GPUDevice "integrated"
[   564.364] (**) |   |-->GPUDevice "Video Card (xrdpdev)"
[   564.364] (**) |-->Input Device "xrdpMouse"
[   564.364] (**) |-->Input Device "xrdpKeyboard"

There shouldn't be any mention of nvidia in the above.

Once you're there, edit /etc/xrdp/sesman.ini and find the [Xorg] stanza. Add these two lines:-

param=-configdir
param=/

I'm hopeful this will stop the X server looking in /etc/X11/xorg.conf.d for config files, and hence loading the modesetting driver.

I can't see any way to prevent the X server looking in /usr/share/X11/xorg.conf.d.

If that doesn't work, I think we're going to be looking at using the Xvnc backend. Let's see what happens with this config first however.

@Pipodi
Copy link
Author

Pipodi commented Oct 13, 2021

I have re-enabled optimus-manager.service and re-flagged "Launch at startup" inside the Optimus Manager GUI. Now I can see its icon in the tray.

Seeing the log you posted me, I thought it was from when I switched to the Intel GPU with Optimus Manager, so I did that, but now it suggested me to install xf86-video-intel drivers, otherwise it would have used the "modesetting" driver. So I installed them, rebooted, switched to integrated GPU and RDP is still working fine.

But I still have the edits I made yesterday following the guide for Nvidia GPU only, which are:

/etc/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf

Section "OutputClass"
    Identifier "intel"
    MatchDriver "i915"
    Driver "modesetting"
EndSection

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    Option "PrimaryGPU" "yes"
    ModulePath "/usr/lib/nvidia/xorg"
    ModulePath "/usr/lib/xorg/modules"
EndSection

And I've added this to my ~/.xinitrc:

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

Later I will try to remove this edits, now I'm currently working with this laptop and I tested this when I was on pause from working. :P

@matt335672
Copy link
Member

Great - thanks for the update!

@Pipodi
Copy link
Author

Pipodi commented Oct 13, 2021

It seems that those drivers did the trick. I rolled back those edits and RDP is still working. It takes a little longer to load, I don't know why, but in the end I still have what I want, working RDP and Optimus Manager installed and working. I tried connecting with RDP with all the GPU modes and it seems fine.

I will keep an eye on the situation, I think you can close this issue if you want! Thanks for all the help.

@matt335672
Copy link
Member

Thanks for the update, and for helping me to get to the bottom of this.

This has become quite a long thread. To summarise what I think the situation is for other readers:-

  • At present (xrdp v0.9.17) NVidia hardware isn't directly supported although this is being worked on (see using xrdp with NVidia drivers #1697)
  • Loading some drivers will force Xorg to try to open the console. This won't work as Xorg is being run without privilege. One such driver is the modesetting driver.
  • For the Optimus Manager, the load of the modesetting driver is done via a file in /etc/X11/xorg.conf.d
  • We can prevent Xorg from looking in this directory at all by adding these lines to the '[Xorg]' stanza in `/etc/xrdp/sysman.ini':-
    param=-configdir
    param=/
    

I'll close this now and change the title to be a bit more descriptive.

@matt335672 matt335672 changed the title XRDP not working after system update - Manjaro XFCE XRDP not working with Optimus Manager - permission denied on /dev/tty0 Oct 13, 2021
@Seas0
Copy link

Seas0 commented Feb 14, 2023

FYI:
I'm running xrdp with xorgxrdp on manjaro (should apply to arch users also), over a configuration of Optimus-enabled laptop, and just change the [Xorg] section of /etc/xrdp/sesman.ini from:

param=-config
param=xrdp/xorg.conf

to:

param=-configdir
param=xrdp/

would do the trick, as it prevent any system related X11 configurations in /etc/X11/xorg.conf.d/ from loading, including the modesetting/intel/nvidia display driver set by optimus-manager and/or keyboard/mouse related stuffs which could possibly conflict with xrdp's xrdpkeyb or xrdpmouse, and your X11 program shall only load display & input drivers from xrdp, fixing issues like Cannot open virtual console, xrdpkeyb segment violation and Cannot run in framebuffer mode. Please specify busIDs which I encountered before.

Side note: 3D rendering & optimus offloading should be fine, at least my current use case didn't yield any error.

@matt335672
Copy link
Member

matt335672 commented Feb 17, 2023

@Seas0 - that's a great comment, worthy of more discussion I think. I'll start a topic.

Started #2556

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

3 participants