neutrinolabs / xrdp

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

Manjaro Linux - cannot connect to server - Closed socket 19 (AF_UNIX) #1554

Closed corax205 closed 3 years ago

corax205 commented 4 years ago

Hi, I try to connect to a local xrdp server running Majaro, KDE. All what I get is the xorg login screen, after login I only see a black box.

Here are the log and config files:

xrdp.log

[20200405-15:54:22] [DEBUG] Closed socket 11 (AF_INET 0.0.0.0:3389)
[20200405-15:54:22] [INFO ] address [0.0.0.0] port [3389] mode 1
[20200405-15:54:22] [INFO ] listening to port 3389 on 0.0.0.0
[20200405-15:54:22] [INFO ] xrdp_listen_pp done
[20200405-15:54:22] [DEBUG] Closed socket 7 (AF_INET 0.0.0.0:3389)
[20200405-15:54:23] [INFO ] address [0.0.0.0] port [3389] mode 1
[20200405-15:54:23] [INFO ] listening to port 3389 on 0.0.0.0
[20200405-15:54:23] [INFO ] xrdp_listen_pp done
[20200405-15:54:23] [DEBUG] Closed socket 7 (AF_INET 0.0.0.0:3389)
[20200405-15:54:25] [INFO ] starting xrdp with pid 1886
[20200405-15:54:25] [INFO ] address [0.0.0.0] port [3389] mode 1
[20200405-15:54:25] [INFO ] listening to port 3389 on 0.0.0.0
[20200405-15:54:25] [INFO ] xrdp_listen_pp done
[20200405-15:54:31] [INFO ] Socket 12: AF_INET connection received from 192.168.1.40 port 58238
[20200405-15:54:31] [DEBUG] Closed socket 12 (AF_INET 192.168.1.30:3389)
[20200405-15:54:31] [DEBUG] Closed socket 11 (AF_INET 0.0.0.0:3389)
[20200405-15:54:31] [INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
[20200405-15:54:31] [INFO ] Using default X.509 key file: /etc/xrdp/key.pem
[20200405-15:54:31] [DEBUG] TLSv1.3 enabled
[20200405-15:54:31] [DEBUG] TLSv1.2 enabled
[20200405-15:54:31] [DEBUG] Security layer: requested 3, selected 1
[20200405-15:54:31] [INFO ] connected client computer name: thorsten-pc
[20200405-15:54:31] [INFO ] adding channel item name cliprdr chan_id 1004 flags 0x0000a0c0
[20200405-15:54:31] [INFO ] adding channel item name rdpsnd chan_id 1005 flags 0x000000c0
[20200405-15:54:31] [INFO ] adding channel item name snddbg chan_id 1006 flags 0x000000c0
[20200405-15:54:31] [INFO ] adding channel item name rdpdr chan_id 1007 flags 0x00008080
[20200405-15:54:31] [INFO ] adding channel item name drdynvc chan_id 1008 flags 0x000000c0
[20200405-15:54:31] [INFO ] TLS connection established from 192.168.1.40 port 58238: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384
[20200405-15:54:31] [DEBUG] xrdp_00000762_wm_login_mode_event_00000001
[20200405-15:54:31] [INFO ] Loading keymap file /etc/xrdp/km-00000407.ini
[20200405-15:54:31] [WARN ] local keymap file for 0x00000407 found and doesn't match built in keymap, using local keymap file
[20200405-15:54:31] [DEBUG] xrdp_wm_log_msg: connecting to sesman ip 127.0.0.1 port 3350
[20200405-15:54:31] [INFO ] xrdp_wm_log_msg: sesman connect ok
[20200405-15:54:31] [DEBUG] xrdp_wm_log_msg: sending login info to session manager, please wait...
[20200405-15:54:31] [DEBUG] return value from xrdp_mm_connect 0
[20200405-15:54:31] [INFO ] xrdp_wm_log_msg: login successful for display 20
[20200405-15:54:31] [DEBUG] xrdp_wm_log_msg: started connecting
[20200405-15:54:35] [DEBUG] Closed socket 19 (AF_UNIX)
[20200405-15:54:38] [DEBUG] Closed socket 19 (AF_UNIX)
[20200405-15:54:42] [DEBUG] Closed socket 19 (AF_UNIX)
[20200405-15:54:45] [DEBUG] Closed socket 19 (AF_UNIX)
[20200405-15:54:49] [DEBUG] Closed socket 19 (AF_UNIX)
[20200405-15:54:52] [DEBUG] Closed socket 19 (AF_UNIX)
[20200405-15:54:56] [DEBUG] Closed socket 19 (AF_UNIX)
[20200405-15:54:59] [DEBUG] Closed socket 19 (AF_UNIX)
[20200405-15:55:03] [DEBUG] Closed socket 19 (AF_UNIX)
[20200405-15:55:06] [DEBUG] Closed socket 19 (AF_UNIX)
[20200405-15:55:10] [DEBUG] Closed socket 19 (AF_UNIX)
[20200405-15:55:13] [DEBUG] Closed socket 19 (AF_UNIX)

xrdp-sesman.log

[20200405-15:54:22] [INFO ] shutting down sesman 1
[20200405-15:54:22] [DEBUG] Closed socket 7 (AF_INET 127.0.0.1:3350)
[20200405-15:54:22] [DEBUG] libscp initialized
[20200405-15:54:22] [DEBUG] Testing if xrdp-sesman can listen on 127.0.0.1 port 3350.
[20200405-15:54:22] [DEBUG] Closed socket 5 (AF_INET 127.0.0.1:3350)
[20200405-15:54:22] [INFO ] starting xrdp-sesman with pid 1869
[20200405-15:54:22] [INFO ] listening to port 3350 on 127.0.0.1
[20200405-15:54:23] [INFO ] shutting down sesman 1
[20200405-15:54:23] [INFO ] shutting down sesman 1
[20200405-15:54:23] [DEBUG] Closed socket 7 (AF_INET 127.0.0.1:3350)
[20200405-15:54:23] [DEBUG] libscp initialized
[20200405-15:54:23] [DEBUG] Testing if xrdp-sesman can listen on 127.0.0.1 port 3350.
[20200405-15:54:23] [DEBUG] Closed socket 5 (AF_INET 127.0.0.1:3350)
[20200405-15:54:23] [INFO ] starting xrdp-sesman with pid 1880
[20200405-15:54:23] [INFO ] listening to port 3350 on 127.0.0.1
[20200405-15:54:31] [INFO ] A connection received from 127.0.0.1 port 51700
[20200405-15:54:31] [INFO ] ++ created session (access granted): username thorsten, ip 192.168.1.40:58238 - socket: 12
[20200405-15:54:31] [INFO ] starting Xorg session...
[20200405-15:54:31] [DEBUG] Closed socket 9 (AF_INET 0.0.0.0:5920)
[20200405-15:54:31] [DEBUG] Closed socket 9 (AF_INET 0.0.0.0:6020)
[20200405-15:54:31] [DEBUG] Closed socket 9 (AF_INET 0.0.0.0:6220)
[20200405-15:54:31] [DEBUG] Closed socket 8 (AF_INET 127.0.0.1:3350)
[20200405-15:54:31] [INFO ] calling auth_start_session from pid 1891
[20200405-15:54:31] [DEBUG] Closed socket 7 (AF_INET 127.0.0.1:3350)
[20200405-15:54:31] [DEBUG] Closed socket 8 (AF_INET 127.0.0.1:3350)
[20200405-15:54:31] [INFO ] /usr/lib/xorg-server/Xorg :20 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log  
[20200405-15:54:31] [CORE ] error starting X server - user thorsten - pid 1893
[20200405-15:54:31] [DEBUG] errno: 2, description: No such file or directory
[20200405-15:54:31] [DEBUG] execve parameter list size: 12
[20200405-15:54:31] [DEBUG]         argv[0] = /usr/lib/xorg-server/Xorg
[20200405-15:54:31] [DEBUG]         argv[1] = :20
[20200405-15:54:31] [DEBUG]         argv[2] = -auth
[20200405-15:54:31] [DEBUG]         argv[3] = .Xauthority
[20200405-15:54:31] [DEBUG]         argv[4] = -config
[20200405-15:54:31] [DEBUG]         argv[5] = xrdp/xorg.conf
[20200405-15:54:31] [DEBUG]         argv[6] = -noreset
[20200405-15:54:31] [DEBUG]         argv[7] = -nolisten
[20200405-15:54:31] [DEBUG]         argv[8] = tcp
[20200405-15:54:31] [DEBUG]         argv[9] = -logfile
[20200405-15:54:31] [DEBUG]         argv[10] = .xorgxrdp.%s.log
[20200405-15:54:31] [DEBUG]         argv[11] = (null)
[20200405-15:54:41] [ERROR] X server for display 20 startup timeout
[20200405-15:54:41] [CORE ] waiting for window manager (pid 1892) to exit
[20200405-15:54:41] [ERROR] X server for display 20 startup timeout
[20200405-15:54:41] [ERROR] another Xserver might already be active on display 20 - see log
[20200405-15:54:41] [DEBUG] aborting connection...
[20200405-15:54:41] [CORE ] window manager (pid 1892) did exit, cleaning up session
[20200405-15:54:41] [INFO ] calling auth_stop_session and auth_end from pid 1891
[20200405-15:54:41] [DEBUG] cleanup_sockets:
[20200405-15:54:41] [DEBUG] cleanup_sockets: deleting /tmp/.xrdp/xrdp_chansrv_socket_20
[20200405-15:54:41] [DEBUG] cleanup_sockets: deleting /tmp/.xrdp/xrdpapi_20
[20200405-15:54:41] [INFO ] ++ terminated session:  username thorsten, display :20.0, session_pid 1891, ip 192.168.1.40:58238 - socket: 12

sesman.ini

ListenAddress=127.0.0.1
ListenPort=3350
EnableUserWindowManager=true
; Give in relative path to user's home directory
UserWindowManager=startwm.sh
; Give in full path or relative path to /etc/xrdp
DefaultWindowManager=startwm.sh
; Give in full path or relative path to /etc/xrdp
ReconnectScript=reconnectwm.sh

[Security]
AllowRootLogin=true
MaxLoginRetry=4
TerminalServerUsers=tsusers
TerminalServerAdmins=tsadmins
; When AlwaysGroupCheck=false access will be permitted
; if the group TerminalServerUsers is not defined.
AlwaysGroupCheck=false
; When RestrictOutboundClipboard=true clipboard from the
; server is not pushed to the client.
RestrictOutboundClipboard=false

[Sessions]
;; X11DisplayOffset - x11 display number offset
; Type: integer
; Default: 10
X11DisplayOffset=20

;; MaxSessions - maximum number of connections to an xrdp server
; Type: integer
; Default: 0
MaxSessions=50

;; KillDisconnected - kill disconnected sessions
; Type: boolean
; Default: false
; if 1, true, or yes, kill session after 60 seconds
KillDisconnected=false

;; DisconnectedTimeLimit - when to kill idle sessions
; Type: integer
; Default: 0
; if not zero, the seconds before a disconnected session is killed
; min 60 seconds
DisconnectedTimeLimit=0

;; IdleTimeLimit (specify in second) - wait before disconnect idle sessions
; Type: integer
; Default: 0
; Set to 0 to disable idle disconnection.
IdleTimeLimit=0

;; Policy - session allocation policy
; Type: enum [ "Default" | "UBD" | "UBI" | "UBC" | "UBDI" | "UBDC" ]
; Default: Xrdp:<User,BitPerPixel> and Xvnc:<User,BitPerPixel,DisplaySize>
; "UBD" session per <User,BitPerPixel,DisplaySize>
; "UBI" session per <User,BitPerPixel,IPAddr>
; "UBC" session per <User,BitPerPixel,Connection>
; "UBDI" session per <User,BitPerPixel,DisplaySize,IPAddr>
; "UBDC" session per <User,BitPerPixel,DisplaySize,Connection>
Policy=Default

[Logging]
LogFile=xrdp-sesman.log
LogLevel=DEBUG
EnableSyslog=1
SyslogLevel=DEBUG

;
; Session definitions - startup command-line parameters for each session type
;

[Xorg]
; Specify the path of non-suid Xorg executable. It might differ depending
; on your distribution and version. The typical path is shown as follows:
;
; Fedora 26 or later    :  param=/usr/libexec/Xorg
; Debian 9 or later     :  param=/usr/lib/xorg/Xorg
; Ubuntu 16.04 or later :  param=/usr/lib/xorg/Xorg
; Arch Linux            :  param=/usr/lib/xorg-server/Xorg
; CentOS 7              :  param=/usr/bin/Xorg or param=Xorg
;
param=/usr/lib/xorg-server/Xorg
; Leave the rest paramaters as-is unless you understand what will happen.
param=-config
param=xrdp/xorg.conf
param=-noreset
param=-nolisten
param=tcp
param=-logfile
param=.xorgxrdp.%s.log

[Xvnc]
param=Xvnc
param=-bs
param=-nolisten
param=tcp
param=-localhost
param=-dpi
param=96

[Chansrv]
; drive redirection, defaults to xrdp_client if not set
FuseMountName=thinclient_drives
; this value allows only the user to acess their own mapped drives.
; Make this more permissive (e.g. 022) if required.
FileUmask=077

[SessionVariables]
PULSE_SCRIPT=/etc/xrdp/pulse/default.pa

xrdp.ini

[Globals]
; xrdp.ini file version number
ini_version=1

; fork a new process for each incoming connection
fork=true

; ports to listen on, number alone means listen on all interfaces
; 0.0.0.0 or :: if ipv6 is configured
; space between multiple occurrences
;
; Examples:
;   port=3389
;   port=unix://./tmp/xrdp.socket
;   port=tcp://.:3389                           127.0.0.1:3389
;   port=tcp://:3389                            *:3389
;   port=tcp://<any ipv4 format addr>:3389      192.168.1.1:3389
;   port=tcp6://.:3389                          ::1:3389
;   port=tcp6://:3389                           *:3389
;   port=tcp6://{<any ipv6 format addr>}:3389   {FC00:0:0:0:0:0:0:1}:3389
;   port=vsock://<cid>:<port>
port=3389

; 'port' above should be connected to with vsock instead of tcp
; use this only with number alone in port above
; prefer use vsock://<cid>:<port> above
use_vsock=false

; regulate if the listening socket use socket option tcp_nodelay
; no buffering will be performed in the TCP stack
tcp_nodelay=true

; regulate if the listening socket use socket option keepalive
; if the network connection disappear without close messages the connection will be closed
tcp_keepalive=true

; set tcp send/recv buffer (for experts)
#tcp_send_buffer_bytes=32768
#tcp_recv_buffer_bytes=32768

; security layer can be 'tls', 'rdp' or 'negotiate'
; for client compatible layer
security_layer=negotiate

; minimum security level allowed for client for classic RDP encryption
; use tls_ciphers to configure TLS encryption
; can be 'none', 'low', 'medium', 'high', 'fips'
crypt_level=high

; X.509 certificate and private key
; openssl req -x509 -newkey rsa:2048 -nodes -keyout key.pem -out cert.pem -days 365
certificate=
key_file=

; set SSL protocols
; can be comma separated list of 'SSLv3', 'TLSv1', 'TLSv1.1', 'TLSv1.2', 'TLSv1.3'
ssl_protocols=TLSv1.2, TLSv1.3
; set TLS cipher suites
#tls_ciphers=HIGH

; Section name to use for automatic login if the client sends username
; and password. If empty, the domain name sent by the client is used.
; If empty and no domain name is given, the first suitable section in
; this file will be used.
autorun=

allow_channels=true
allow_multimon=true
bitmap_cache=true
bitmap_compression=true
bulk_compression=true
#hidelogwindow=true
max_bpp=32
new_cursors=true
; fastpath - can be 'input', 'output', 'both', 'none'
use_fastpath=both
; when true, userid/password *must* be passed on cmd line
#require_credentials=true
; You can set the PAM error text in a gateway setup (MAX 256 chars)
#pamerrortxt=change your password according to policy at http://url

;
; colors used by windows in RGB format
;
blue=009cb5
grey=dedede
#black=000000
#dark_grey=808080
#blue=08246b
#dark_blue=08246b
#white=ffffff
#red=ff0000
#green=00ff00
#background=626c72

;
; configure login screen
;

; Login Screen Window Title
#ls_title=My Login Title

; top level window background color in RGB format
ls_top_window_bg_color=009cb5

; width and height of login screen
ls_width=350
ls_height=430

; login screen background color in RGB format
ls_bg_color=dedede

; optional background image filename (bmp format).
#ls_background_image=

; logo
; full path to bmp-file or file in shared folder
ls_logo_filename=
ls_logo_x_pos=55
ls_logo_y_pos=50

; for positioning labels such as username, password etc
ls_label_x_pos=30
ls_label_width=65

; for positioning text and combo boxes next to above labels
ls_input_x_pos=110
ls_input_width=210

; y pos for first label and combo box
ls_input_y_pos=220

; OK button
ls_btn_ok_x_pos=142
ls_btn_ok_y_pos=370
ls_btn_ok_width=85
ls_btn_ok_height=30

; Cancel button
ls_btn_cancel_x_pos=237
ls_btn_cancel_y_pos=370
ls_btn_cancel_width=85
ls_btn_cancel_height=30

[Logging]
LogFile=xrdp.log
LogLevel=DEBUG
EnableSyslog=true
SyslogLevel=DEBUG
; LogLevel and SysLogLevel could by any of: core, error, warning, info or debug

[Channels]
; Channel names not listed here will be blocked by XRDP.
; You can block any channel by setting its value to false.
; IMPORTANT! All channels are not supported in all use
; cases even if you set all values to true.
; You can override these settings on each session type
; These settings are only used if allow_channels=true
rdpdr=true
rdpsnd=true
drdynvc=true
cliprdr=true
rail=true
xrdpvr=true
tcutils=true

; for debugging xrdp, in section xrdp1, change port=-1 to this:
#port=/tmp/.xrdp/xrdp_display_10

; for debugging xrdp, add following line to section xrdp1
#chansrvport=/tmp/.xrdp/xrdp_chansrv_socket_7210

;
; Session types
;

; Some session types such as Xorg, X11rdp and Xvnc start a display server.
; Startup command-line parameters for the display server are configured
; in sesman.ini. See and configure also sesman.ini.
[Xorg]
name=Xorg
lib=libxup.so
username=ask
password=ask
ip=127.0.0.1
port=-1
code=20

[Xvnc]
name=Xvnc
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=-1
#xserverbpp=24
#delay_ms=2000

[vnc-any]
name=vnc-any
lib=libvnc.so
ip=ask
port=ask5900
username=na
password=ask
#pamusername=asksame
#pampassword=asksame
#pamsessionmng=127.0.0.1
#delay_ms=2000

[neutrinordp-any]
name=neutrinordp-any
lib=libxrdpneutrinordp.so
ip=ask
port=ask3389
username=ask
password=ask

; You can override the common channel settings for each session type
#channel.rdpdr=true
#channel.rdpsnd=true
#channel.drdynvc=true
#channel.cliprdr=true
#channel.rail=true
#channel.xrdpvr=true

startwm.sh

#!/usr/bin/env bash
#
# This script is an example. You might need to edit this script
# depending on your distro if it doesn't work for you.
#
# Uncomment the following line for debug:
# exec xterm

# Execution sequence for interactive login shell - pseudocode
#
# IF /etc/profile is readable THEN
#     execute ~/.bash_profile
# END IF
# IF ~/.bash_profile is readable THEN
#     execute ~/.bash_profile
# ELSE
#     IF ~/.bash_login is readable THEN
#         execute ~/.bash_login
#     ELSE
#         IF ~/.profile is readable THEN
#             execute ~/.profile
#         END IF
#     END IF
# END IF
pre_start()
{
  if [ -r /etc/profile ]; then
    . /etc/profile
  fi
  if [ -r ~/.bash_profile ]; then
    . ~/.bash_profile
  else
    if [ -r ~/.bash_login ]; then
      . ~/.bash_login
    else
      if [ -r ~/.profile ]; then
        . ~/.profile
      fi
    fi
  fi
  return 0
}

# When loging out from the interactive shell, the execution sequence is:
#
# IF ~/.bash_logout exists THEN
#     execute ~/.bash_logout
# END IF
post_start()
{
  if [ -r ~/.bash_logout ]; then
    . ~/.bash_logout
  fi
  return 0
}

#start the window manager
wm_start()
{
#  if [ -r /etc/locale.conf ]; then
#    . /etc/locale.conf
#    export LANG LANGUAGE
#  fi

  # arch user
  if [ -r ~/.xinitrc ]; then
    . ~/.xinitrc
    exit 0
  fi
  # arch
#  if [ -r /etc/X11/xinit/xinitrc ]; then
#    . /etc/X11/xinit/xinitrc
#    exit 0
#  fi

  # debian
#  if [ -r /etc/X11/Xsession ]; then
#    pre_start
#    . /etc/X11/Xsession
#    post_start
#    exit 0
#  fi

  # el
#  if [ -r /etc/X11/xinit/Xsession ]; then
#    pre_start
#    . /etc/X11/xinit/Xsession
#    post_start
#    exit 0
#  fi

  # suse
#  if [ -r /etc/X11/xdm/Xsession ]; then
    # since the following script run a user login shell,
    # do not execute the pseudo login shell scripts
#    . /etc/X11/xdm/Xsession
#    exit 0
#  fi

  pre_start
  xterm
  post_start
}

#. /etc/environment
#export PATH=$PATH
#export LANG=$LANG

# change PATH to be what your environment needs usually what is in
# /etc/environment
#PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
#export PATH=$PATH

# for PATH and LANG from /etc/environment
# pam will auto process the environment file if /etc/pam.d/xrdp-sesman
# includes
# auth       required     pam_env.so readenv=1

wm_start

exit 1

I postet this in the Manjro forums before 2 weeks but get no response. I hope you can help me find out whats wrong.

Regads

metalefty commented 4 years ago

Here it is.

[20200405-15:54:31] [INFO ] /usr/lib/xorg-server/Xorg :20 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log  
[20200405-15:54:31] [CORE ] error starting X server - user thorsten - pid 1893
[20200405-15:54:31] [DEBUG] errno: 2, description: No such file or directory
[20200405-15:54:31] [DEBUG] execve parameter list size: 12
[20200405-15:54:31] [DEBUG]         argv[0] = /usr/lib/xorg-server/Xorg
[20200405-15:54:31] [DEBUG]         argv[1] = :20
[20200405-15:54:31] [DEBUG]         argv[2] = -auth
[20200405-15:54:31] [DEBUG]         argv[3] = .Xauthority
[20200405-15:54:31] [DEBUG]         argv[4] = -config
[20200405-15:54:31] [DEBUG]         argv[5] = xrdp/xorg.conf
[20200405-15:54:31] [DEBUG]         argv[6] = -noreset
[20200405-15:54:31] [DEBUG]         argv[7] = -nolisten
[20200405-15:54:31] [DEBUG]         argv[8] = tcp
[20200405-15:54:31] [DEBUG]         argv[9] = -logfile
[20200405-15:54:31] [DEBUG]         argv[10] = .xorgxrdp.%s.log
[20200405-15:54:31] [DEBUG]         argv[11] = (null)
[20200405-15:54:41] [ERROR] X server for display 20 startup timeout

See: https://github.com/neutrinolabs/xrdp/issues/1448

corax205 commented 4 years ago

Many thanks, that was one step in the right direction. Now sesmanlog tells me there is another Xserver active.

sesman.log

[20200421-14:35:31] [INFO ] starting Xorg session...
[20200421-14:35:31] [DEBUG] Closed socket 9 (AF_INET 0.0.0.0:5920)
[20200421-14:35:31] [DEBUG] Closed socket 9 (AF_INET 0.0.0.0:6020)
[20200421-14:35:31] [DEBUG] Closed socket 9 (AF_INET 0.0.0.0:6220)
[20200421-14:35:31] [INFO ] calling auth_start_session from pid 21683
[20200421-14:35:31] [DEBUG] Closed socket 8 (AF_INET 127.0.0.1:3350)
[20200421-14:35:31] [DEBUG] Closed socket 7 (AF_INET 127.0.0.1:3350)
[20200421-14:35:31] [DEBUG] Closed socket 8 (AF_INET 127.0.0.1:3350)
[20200421-14:35:31] [INFO ] /usr/lib/Xorg :20 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log  
[20200421-14:35:41] [ERROR] X server for display 20 startup timeout
[20200421-14:35:41] [CORE ] waiting for window manager (pid 21684) to exit
[20200421-14:35:41] [ERROR] X server for display 20 startup timeout
[20200421-14:35:41] [ERROR] another Xserver might already be active on display 20 - see log
[20200421-14:35:41] [DEBUG] aborting connection...
[20200421-14:35:41] [CORE ] window manager (pid 21684) did exit, cleaning up session
[20200421-14:35:41] [INFO ] calling auth_stop_session and auth_end from pid 21683
[20200421-14:35:41] [DEBUG] cleanup_sockets:
[20200421-14:35:41] [DEBUG] cleanup_sockets: deleting /tmp/.xrdp/xrdp_chansrv_socket_20
[20200421-14:35:41] [DEBUG] cleanup_sockets: deleting /tmp/.xrdp/xrdpapi_20
[20200421-14:35:41] [INFO ] ++ terminated session:  username thorsten, display :20.0, session_pid 21683, ip 192.168.1.40:55770 - socket: 12

xrdp.log

[20200421-14:34:43] [INFO ] xrdp_listen_pp done
[20200421-14:35:31] [INFO ] Socket 12: AF_INET connection received from 192.168.1.40 port 55770
[20200421-14:35:31] [DEBUG] Closed socket 12 (AF_INET 192.168.1.30:3389)
[20200421-14:35:31] [DEBUG] Closed socket 11 (AF_INET 0.0.0.0:3389)
[20200421-14:35:31] [INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
[20200421-14:35:31] [INFO ] Using default X.509 key file: /etc/xrdp/key.pem
[20200421-14:35:31] [DEBUG] TLSv1.3 enabled
[20200421-14:35:31] [DEBUG] TLSv1.2 enabled
[20200421-14:35:31] [DEBUG] Security layer: requested 3, selected 1
[20200421-14:35:31] [INFO ] connected client computer name: thorsten-pc
[20200421-14:35:31] [INFO ] adding channel item name cliprdr chan_id 1004 flags 0x0000a0c0
[20200421-14:35:31] [INFO ] adding channel item name rdpsnd chan_id 1005 flags 0x000000c0
[20200421-14:35:31] [INFO ] adding channel item name snddbg chan_id 1006 flags 0x000000c0
[20200421-14:35:31] [INFO ] adding channel item name rdpdr chan_id 1007 flags 0x00008080
[20200421-14:35:31] [INFO ] adding channel item name drdynvc chan_id 1008 flags 0x000000c0
[20200421-14:35:31] [INFO ] TLS connection established from 192.168.1.40 port 55770: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384
[20200421-14:35:31] [DEBUG] xrdp_000054b2_wm_login_mode_event_00000001
[20200421-14:35:31] [INFO ] Loading keymap file /etc/xrdp/km-00000407.ini
[20200421-14:35:31] [WARN ] local keymap file for 0x00000407 found and doesn't match built in keymap, using local keymap file
[20200421-14:35:31] [DEBUG] xrdp_wm_log_msg: connecting to sesman ip 127.0.0.1 port 3350
[20200421-14:35:31] [INFO ] xrdp_wm_log_msg: sesman connect ok
[20200421-14:35:31] [DEBUG] xrdp_wm_log_msg: sending login info to session manager, please wait...
[20200421-14:35:31] [DEBUG] return value from xrdp_mm_connect 0
[20200421-14:35:31] [INFO ] xrdp_wm_log_msg: login successful for display 20
[20200421-14:35:31] [DEBUG] xrdp_wm_log_msg: started connecting
[20200421-14:35:35] [DEBUG] Closed socket 19 (AF_UNIX)
metalefty commented 4 years ago

Let's see out put of

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

via SSH. Try some display number, :21, :22...

corax205 commented 4 years ago

Same problem with different display numbers. Login as root fails too. xorgxrdp is present.

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

X.Org X Server 1.20.8
X Protocol Version 11, Revision 0
Build Operating System: Linux Manjaro Linux
Current Operating System: Linux Manjaro-Wohnzimmer 4.19.116-1-MANJARO #1 SMP Fri Apr 17 18:13:53 UTC 2020 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.19-x86_64 root=UUID=005c9c87-29c8-4934-a4d8-800a8f272234 rw quiet resume=UUID=36328906-fd6d-45b3-babd-e888a502a72a
Build Date: 30 March 2020  06:33:12AM

Current version of pixman: 0.38.4
        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.21.log", Time: Wed Apr 22 17:51:16 2020
(++) Using config file: "/etc/X11/xrdp/xorg.conf"
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
xorgxrdpSetup:
xrdpdevSetup:
rdpIdentify:
rdpDriverFunc: op 10
(EE) 
Fatal server error:
(EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)
(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.21.log" for additional information.
(EE) 
(EE) Server terminated with error (1). Closing log file.
cat .xorgxrdp.21.log
[  1061.586] (WW) Failed to open protocol names file lib/xorg/protocol.txt
[  1061.587] 
X.Org X Server 1.20.8
X Protocol Version 11, Revision 0
[  1061.587] Build Operating System: Linux Manjaro Linux
[  1061.587] Current Operating System: Linux Manjaro-Wohnzimmer 4.19.116-1-MANJARO #1 SMP Fri Apr 17 18:13:53 UTC 2020 x86_64
[  1061.587] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.19-x86_64 root=UUID=005c9c87-29c8-4934-a4d8-800a8f272234 rw quiet resume=UUID=36328906-fd6d-45b3-babd-e888a502a72a
[  1061.587] Build Date: 30 March 2020  06:33:12AM
[  1061.587]  
[  1061.587] Current version of pixman: 0.38.4
[  1061.587]    Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
[  1061.587] Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[  1061.587] (++) Log file: ".xorgxrdp.21.log", Time: Wed Apr 22 17:51:16 2020
[  1061.587] (++) Using config file: "/etc/X11/xrdp/xorg.conf"
[  1061.587] (==) Using config directory: "/etc/X11/xorg.conf.d"
[  1061.587] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[  1061.587] (==) ServerLayout "Layout0"
[  1061.587] (**) |-->Screen "Screen0" (0)
[  1061.587] (**) |   |-->Monitor "Monitor0"
[  1061.588] (**) |   |-->Device "Device0"
[  1061.588] (**) |   |-->GPUDevice "Video Card (xrdpdev)"
[  1061.588] (**) |-->Input Device "Keyboard0"
[  1061.588] (**) |-->Input Device "Mouse0"
[  1061.588] (**) Option "DontVTSwitch" "on"
[  1061.588] (**) Option "AutoAddDevices" "off"
[  1061.588] (**) Not automatically adding devices
[  1061.588] (==) Automatically enabling devices
[  1061.588] (==) Automatically adding GPU devices
[  1061.588] (==) Automatically binding GPU devices
[  1061.588] (==) Max clients allowed: 256, resource mask: 0x1fffff
[  1061.588] (WW) The directory "/usr/share/fonts/OTF" does not exist.
[  1061.588]    Entry deleted from font path.
[  1061.588] (WW) The directory "/usr/share/fonts/Type1" does not exist.
[  1061.588]    Entry deleted from font path.
[  1061.588] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/100dpi".
[  1061.588]    Entry deleted from font path.
[  1061.588]    (Run 'mkfontdir' on "/usr/share/fonts/100dpi").
[  1061.588] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/75dpi".
[  1061.588]    Entry deleted from font path.
[  1061.588]    (Run 'mkfontdir' on "/usr/share/fonts/75dpi").
[  1061.588] (==) FontPath set to:
        /usr/share/fonts/misc,
        /usr/share/fonts/TTF
[  1061.588] (==) ModulePath set to "/usr/lib/xorg/modules"
[  1061.588] (**) Extension "Composite" is enabled
[  1061.588] (II) Module ABI versions:
[  1061.588]    X.Org ANSI C Emulation: 0.4
[  1061.588]    X.Org Video Driver: 24.1
[  1061.588]    X.Org XInput driver : 24.1
[  1061.588]    X.Org Server Extension : 10.0
[  1061.590] (II) systemd-logind: took control of session /org/freedesktop/login1/session/_33
[  1061.591] (II) xfree86: Adding drm device (/dev/dri/card0)
[  1061.592] (EE) systemd-logind: failed to take device /dev/dri/card0: Operation not permitted
[  1061.592] (**) OutputClass "nvidia" ModulePath extended to "/usr/lib/nvidia/xorg,/usr/lib/xorg/modules,/usr/lib/xorg/modules"
[  1061.592] (**) OutputClass "nvidia" setting /dev/dri/card0 as PrimaryGPU
[  1061.593] (--) PCI:*(1@0:0:0) 10de:1c82:10de:11bf rev 161, Mem @ 0xf6000000/16777216, 0xe0000000/268435456, 0xf0000000/33554432, I/O @ 0x0000e000/128, BIOS @ 0x????????/131072
[  1061.593] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[  1061.593] (II) "glx" will be loaded. This was enabled by default and also specified in the config file.
[  1061.593] (II) LoadModule: "dbe"
[  1061.593] (II) Module "dbe" already built-in
[  1061.593] (II) LoadModule: "ddc"
[  1061.593] (II) Module "ddc" already built-in
[  1061.593] (II) LoadModule: "extmod"
[  1061.593] (II) Module "extmod" already built-in
[  1061.593] (II) LoadModule: "glx"
[  1061.593] (II) Loading /usr/lib/nvidia/xorg/libglx.so
[  1061.597] (II) Module glx: vendor="NVIDIA Corporation"
[  1061.597]    compiled for 4.0.2, module version = 1.0.0
[  1061.597]    Module class: X.Org Server Extension
[  1061.597] (II) NVIDIA GLX Module  390.132  Fri Nov  1 04:00:46 PDT 2019
[  1061.597] (II) LoadModule: "int10"
[  1061.597] (II) Loading /usr/lib/xorg/modules/libint10.so
[  1061.597] (II) Module int10: vendor="X.Org Foundation"
[  1061.597]    compiled for 1.20.8, module version = 1.0.0
[  1061.597]    ABI class: X.Org Video Driver, version 24.1
[  1061.597] (II) LoadModule: "record"
[  1061.597] (II) Module "record" already built-in
[  1061.597] (II) LoadModule: "vbe"
[  1061.597] (II) Loading /usr/lib/xorg/modules/libvbe.so
[  1061.597] (II) Module vbe: vendor="X.Org Foundation"
[  1061.597]    compiled for 1.20.8, module version = 1.1.0
[  1061.597]    ABI class: X.Org Video Driver, version 24.1
[  1061.597] (II) LoadModule: "xorgxrdp"
[  1061.597] (II) Loading /usr/lib/xorg/modules/libxorgxrdp.so
[  1061.597] (II) Module XORGXRDP: vendor="X.Org Foundation"
[  1061.597]    compiled for 1.20.8, module version = 0.2.13
[  1061.597]    ABI class: X.Org Video Driver, version 24.1
[  1061.597] xorgxrdpSetup:
[  1061.597] (II) LoadModule: "fb"
[  1061.597] (II) Loading /usr/lib/xorg/modules/libfb.so
[  1061.598] (II) Module fb: vendor="X.Org Foundation"
[  1061.598]    compiled for 1.20.8, module version = 1.0.0
[  1061.598]    ABI class: X.Org ANSI C Emulation, version 0.4
[  1061.598] (II) LoadModule: "nvidia"
[  1061.598] (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so
[  1061.598] (II) Module nvidia: vendor="NVIDIA Corporation"
[  1061.598]    compiled for 4.0.2, module version = 1.0.0
[  1061.598]    Module class: X.Org Video Driver
[  1061.598] (II) LoadModule: "xrdpdev"
[  1061.598] (II) Loading /usr/lib/xorg/modules/drivers/xrdpdev_drv.so
[  1061.598] (II) Module XRDPDEV: vendor="X.Org Foundation"
[  1061.598]    compiled for 1.20.8, module version = 0.2.13
[  1061.598]    ABI class: X.Org Video Driver, version 24.1
[  1061.598] xrdpdevSetup:
[  1061.598] (II) LoadModule: "kbd"
[  1061.598] (II) Loading /usr/lib/xorg/modules/input/kbd_drv.so
[  1061.598] (II) Module kbd: vendor="X.Org Foundation"
[  1061.598]    compiled for 1.20.3, module version = 1.9.0
[  1061.598]    Module class: X.Org XInput Driver
[  1061.598]    ABI class: X.Org XInput driver, version 24.1
[  1061.598] (II) LoadModule: "mouse"
[  1061.598] (II) Loading /usr/lib/xorg/modules/input/mouse_drv.so
[  1061.598] (II) Module mouse: vendor="X.Org Foundation"
[  1061.599]    compiled for 1.20.0, module version = 1.9.3
[  1061.599]    Module class: X.Org XInput Driver
[  1061.599]    ABI class: X.Org XInput driver, version 24.1
[  1061.599] (II) NVIDIA dlloader X Driver  390.132  Fri Nov  1 03:36:28 PDT 2019
[  1061.599] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[  1061.599] rdpIdentify:
[  1061.599] (II) XRDPDEV: driver for xrdp: XRDPDEV
[  1061.599] rdpDriverFunc: op 10
[  1061.599] (EE) 
Fatal server error:
[  1061.599] (EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)
[  1061.599] (EE) 
[  1061.599] (EE) 
Please consult the The X.Org Foundation support 
         at http://wiki.x.org
 for help. 
[  1061.599] (EE) Please also check the log file at ".xorgxrdp.21.log" for additional information.
[  1061.599] (EE) 
[  1061.599] (WW) xf86CloseConsole: KDSETMODE failed: Bad file descriptor
[  1061.599] (WW) xf86CloseConsole: VT_GETMODE failed: Bad file descriptor
[  1061.599] (EE) Server terminated with error (1). Closing log file.
metalefty commented 4 years ago

Thanks, Xorg doesn't start for some reasons.

[ 1061.599] (EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)

I ever see this however I haven't figure out how to solve it.

metalefty commented 4 years ago

Probably #1550 is the similar issue.

woods987 commented 4 years ago

try this once

~/.xinitrc

#DEFAULT_SESSION=startkde
DEFAULT_SESSION=/usr/lib/sddm/sddm-helper startplasma-x11

this is manjaro KDE only

corax205 commented 4 years ago

Still the same.

metalefty commented 4 years ago

Because

#DEFAULT_SESSION=startkde
DEFAULT_SESSION=/usr/lib/sddm/sddm-helper startplasma-x11

doesn't affect the following error.

[ 1061.599] (EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)

@woods987 's issue and the original @corax205 's issue are different.

sanvyruz commented 4 years ago

@corax205 I had the same "(EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)" issue on Manjaro/KDE+plasma and nearly went mad trying to figure this out.

Problem for me was Xorg unable to figure out the correct Layout section from xorg.conf, though the man page for Xorg says:

  -layout layout-name
           Use the xorg.conf(5) file Layout section called layout-name.  By default the first Layout section is used.

So I added the "-layout X11 Server" param to Xorg section in sesman.ini (you can verify the layout name from xorg.conf to be safe):

[Xorg]
; Specify the path of non-suid Xorg executable. It might differ depending
; on your distribution and version. The typical path is shown as follows:
;
; Fedora 26 or later    :  param=/usr/libexec/Xorg
; Debian 9 or later     :  param=/usr/lib/xorg/Xorg
; Ubuntu 16.04 or later :  param=/usr/lib/xorg/Xorg
; Arch Linux            :  param=/usr/lib/xorg-server/Xorg
; CentOS 7              :  param=/usr/bin/Xorg or param=Xorg
;
param=Xorg
; Leave the rest paramaters as-is unless you understand what will happen.
param=-config
param=xrdp/xorg.conf
param=-noreset
param=-nolisten
param=tcp
param=-logfile
param=.xorgxrdp.%s.log
param=-layout
param=X11 Server

And after restart of xrdp and xrdp-sesman I was able to get the remote desktop connection working.

EDIT: Also had to add the following lines in startwm.sh in the wm_start() function to get a functional plasma desktop:

  # arch user
  if [ -r ~/.xinitrc ]; then
    eval $(dbus-launch --sh-syntax)
    startplasma-x11
    #. ~/.xinitrc
    exit 0
  fi
Shatur commented 4 years ago

@sanvyruz, I have the same issue but adding -layout X11 Server in sesman.ini as you described did not help. Could you describe a bit more how you get X11 Server name?

yara-gardaria commented 4 years ago

@sanvyruz, I had the same problem and your solution worked, thanks!

sanvyruz commented 4 years ago

@Shatur95 You can get the layout name from Identifier of ServerLayout in the file xorg.conf under /etc/X11/xrdp. Mine was as follows:

Section "ServerLayout"
    Identifier "X11 Server"
    Screen "Screen (xrdpdev)"
    InputDevice "xrdpMouse" "CorePointer"
    InputDevice "xrdpKeyboard" "CoreKeyboard"
EndSection

But since this is a config brought in by xrdp, I expect the layout name will be same across installations.

You might want to check /etc/X11/Xwrapper.config (if not present probably create it). I have the following content:

allowed_users=anybody

Without that line, only console users can start Xorg by default.

EDIT: Saw you mention in another issue stating you already have this xwrapper config, but leaving this for reference of others.

Shatur commented 4 years ago

Thank you a lot, this solved my issue!

basncy commented 3 years ago

@corax205 I had the same "(EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)" issue on Manjaro/KDE+plasma and nearly went mad trying to figure this out.

Problem for me was Xorg unable to figure out the correct Layout section from xorg.conf, though the man page for Xorg says:

  -layout layout-name
           Use the xorg.conf(5) file Layout section called layout-name.  By default the first Layout section is used.

So I added the "-layout X11 Server" param to Xorg section in sesman.ini (you can verify the layout name from xorg.conf to be safe):

[Xorg]
; Specify the path of non-suid Xorg executable. It might differ depending
; on your distribution and version. The typical path is shown as follows:
;
; Fedora 26 or later    :  param=/usr/libexec/Xorg
; Debian 9 or later     :  param=/usr/lib/xorg/Xorg
; Ubuntu 16.04 or later :  param=/usr/lib/xorg/Xorg
; Arch Linux            :  param=/usr/lib/xorg-server/Xorg
; CentOS 7              :  param=/usr/bin/Xorg or param=Xorg
;
param=Xorg
; Leave the rest paramaters as-is unless you understand what will happen.
param=-config
param=xrdp/xorg.conf
param=-noreset
param=-nolisten
param=tcp
param=-logfile
param=.xorgxrdp.%s.log
param=-layout
param=X11 Server

And after restart of xrdp and xrdp-sesman I was able to get the remote desktop connection working.

EDIT: Also had to add the following lines in startwm.sh in the wm_start() function to get a functional plasma desktop:

  # arch user
  if [ -r ~/.xinitrc ]; then
    eval $(dbus-launch --sh-syntax)
    startplasma-x11
    #. ~/.xinitrc
    exit 0
  fi

Mark this solution, for those not mentioned on manjaro nor archlinux wiki pages. param=-layout param=X11 Server

matt335672 commented 3 years ago

@basncy - thanks for commenting.

That particular issue was also discussed in #1784, and was (I believe) fixed by a patch to xorgxrdp (neutrinolabs/xorgxrdp#181) which shipped in in v0.2.16 of xorgxrdp. If you're running that version or later you might want to check /etc/X11/xrdp/xorg.conf is up-to-date.

I'm closing this issue now, as I believe it to be a duplicate of #1784