LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   CentOS (https://www.linuxquestions.org/questions/centos-111/)
-   -   Centos 7 and xrdp (https://www.linuxquestions.org/questions/centos-111/centos-7-and-xrdp-4175590202/)

lazydog 09-26-2016 03:14 PM

Centos 7 and xrdp
 
So I have installed Centos 7 and wanted to be able to remote into it. So I installed according to this document:

Install xrdp on CentOS 7 / RHEL 7

So far so good. I can log in without issues. The problem starts when I try to exit and then log in again. I get the following on the second login:

Code:

connecting to sesman ip 127.0.0.1 port 3350
sesman connect ok
sending login info to session manager, please wait...
xrdp_mm_process_login_responce: login successful for display 10
VNC started connecting
Waiting 2000 ms for VNC to start...
VNC connecting to 127.0.0.1 5910
VNC error - problem connecting
some problem

Was looking on the web but nothing really addressed this issue. Sure I found a few sites that talked about closing the connection without logging out but I logged out everything. The only way to be able to use VNC was to restart the service.

Anyone know what I might be missing or where to look to fix this?

Thanks.

end 09-27-2016 09:32 AM

re
 
maybe vnc didnt disconnect property from first login. try restart vnc service beafore second login

lazydog 09-27-2016 10:45 AM

End, thanks for your reply.

Yes, restarting VNC does fix the problem but I cannot continue to restart the service every time someone finishes working on the system.
I'm wondering why this is happening and if there is a fix I could try. Luckily for me I'm the only one using it right now and I have Ad,min rights to the system but when it goes live it's going to be a problem.

sag47 09-27-2016 10:56 AM

Check /var/log files for xrdp entries. You can use

Code:

grep -irl xrdp /bar/log

end 09-27-2016 12:21 PM

re
 
sorry you write my answer in your qestion i didnt notice.

only thing cross my mind is that with second login vnc try use different port 5911 insted 5910.

try edit etc/X11/xorg.conf

Section "Module"
Load "vnc"
EndSection

lazydog 09-27-2016 12:50 PM

Thnx sag47.

Here is what I'm seeing in the log for today. I restarted the service and connected.

xrdp.log
Code:

[20160927-13:41:40] [INFO ] A connection received from: 10.5.33.15 port 34842
[20160927-13:41:40] [INFO ] An established connection closed to endpoint: 10.5.33.15:34842 - socket: 8
[20160927-13:41:40] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 7
[20160927-13:41:40] [CORE ] WARNING: Invalid x.509 certificate path defined, default path will be used: /etc/xrdp/cert.pem
[20160927-13:41:40] [WARN ] Invalid X.509 certificate path defined, default path will be used: /etc/xrdp/key.pem
[20160927-13:41:40] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 8
[20160927-13:41:40] [ERROR] Listening socket is in wrong state we terminate listener
[20160927-13:41:42] [INFO ] A connection received from: 10.5.33.15 port 34843
[20160927-13:41:42] [INFO ] An established connection closed to endpoint: 10.5.33.15:34843 - socket: 8
[20160927-13:41:42] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 7
[20160927-13:41:42] [CORE ] WARNING: Invalid x.509 certificate path defined, default path will be used: /etc/xrdp/cert.pem
[20160927-13:41:42] [WARN ] Invalid X.509 certificate path defined, default path will be used: /etc/xrdp/key.pem
[20160927-13:41:42] [DEBUG] xrdp_00005cde_wm_login_mode_event_00000001
[20160927-13:41:42] [WARN ] local keymap file for 0x0409 found and dosen't match built in keymap, using local keymap file
[20160927-13:41:50] [DEBUG] returnvalue from xrdp_mm_connect 0
[20160927-13:41:52] [INFO ] The following channel is allowed: rdpdr (0)
[20160927-13:41:53] [INFO ] The following channel is allowed: rdpsnd (1)
[20160927-13:41:53] [INFO ] The following channel is allowed: cliprdr (2)
[20160927-13:41:53] [INFO ] The following channel is allowed: drdynvc (3)
[20160927-13:41:53] [DEBUG] The allow channel list now initialized for this session
[20160927-13:41:53] [DEBUG] xrdp_mm_connect_chansrv: chansrvconnect successful
[20160927-13:41:53] [INFO ] An established connection closed to endpoint: 127.0.0.1:3350 - socket: 11
[20160927-13:42:20] [INFO ] An established connection closed to endpoint: 109.112.47.46:12148 - socket: 13
[20160927-13:42:20] [INFO ] An established connection closed to endpoint: 10.5.33.15:34843 - socket: 8
[20160927-13:42:20] [DEBUG] xrdp_mm_module_cleanup
[20160927-13:42:20] [DEBUG] VNC mod_exit
[20160927-13:42:20] [INFO ] An established connection closed to endpoint: 127.0.0.1:5910 - socket: 12
[20160927-13:42:20] [ERROR] Listening socket is in wrong state we terminate listener

xrdp-sesman.log
Code:

[20160927-13:41:05] [INFO ] A connection received from: 127.0.0.1 port 32912
[20160927-13:41:05] [INFO ] scp thread on sck 8 started successfully
[20160927-13:41:05] [INFO ] ++ reconnected session: username robert, display :10.0, session_pid 21324, ip 10.5.33.15:34835 - socket: 8
[20160927-13:41:05] [INFO ] An established connection closed to endpoint: 127.0.0.1:32912 - socket: 8
[20160927-13:41:30] [INFO ] shutting down sesman 1
[20160927-13:41:30] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 7
[20160927-13:41:30] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 7
[20160927-13:41:30] [CORE ] shutting down log subsystem...
[20160927-13:41:31] [WARN ] [init:46] libscp initialized
[20160927-13:41:31] [CORE ] starting sesman with pid 23763
[20160927-13:41:31] [INFO ] listening...
[20160927-13:41:50] [INFO ] A connection received from: 127.0.0.1 port 33134
[20160927-13:41:50] [INFO ] scp thread on sck 8 started successfully
[20160927-13:41:50] [INFO ] ++ created session (access granted): username robert, ip 10.5.33.15:34843 - socket: 8
[20160927-13:41:50] [INFO ] starting Xvnc session...
[20160927-13:41:50] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 9
[20160927-13:41:50] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 9
[20160927-13:41:50] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 9
[20160927-13:41:50] [INFO ] An established connection closed to endpoint: 127.0.0.1:33134 - socket: 8
[20160927-13:41:50] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 7
[20160927-13:41:51] [INFO ] An established connection closed to endpoint: 127.0.0.1:33134 - socket: 8
[20160927-13:41:51] [ERROR] env_set_user: error creating .vnc dir
[20160927-13:41:51] [INFO ] Xvnc :10 -geometry 1920x1080 -depth 24 -rfbauth /home/robert/.vnc/sesman_robert_passwd -bs -nolisten tcp -localhost -dpi 96
[20160927-13:41:51] [INFO ] starting xrdp-sessvc - xpid=23782 - wmpid=23781
[20160927-13:42:20] [INFO ] ++ terminated session:  username robert, display :10.0, session_pid 23780, ip 10.5.33.15:34843 - socket: 8


Then I attempted to login again and seen the following in the logs:

xrdp.log
Code:

[20160927-13:45:27] [INFO ] A connection received from: 10.5.33.15 port 34882
[20160927-13:45:27] [INFO ] An established connection closed to endpoint: 10.5.33.15:34882 - socket: 8
[20160927-13:45:27] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 7
[20160927-13:45:27] [CORE ] WARNING: Invalid x.509 certificate path defined, default path will be used: /etc/xrdp/cert.pem
[20160927-13:45:27] [WARN ] Invalid X.509 certificate path defined, default path will be used: /etc/xrdp/key.pem
[20160927-13:45:27] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 8
[20160927-13:45:27] [ERROR] Listening socket is in wrong state we terminate listener
[20160927-13:45:28] [INFO ] A connection received from: 10.5.33.15 port 34884
[20160927-13:45:28] [INFO ] An established connection closed to endpoint: 10.5.33.15:34884 - socket: 8
[20160927-13:45:28] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 7
[20160927-13:45:28] [CORE ] WARNING: Invalid x.509 certificate path defined, default path will be used: /etc/xrdp/cert.pem
[20160927-13:45:28] [WARN ] Invalid X.509 certificate path defined, default path will be used: /etc/xrdp/key.pem
[20160927-13:45:29] [DEBUG] xrdp_00006289_wm_login_mode_event_00000001
[20160927-13:45:29] [WARN ] local keymap file for 0x0409 found and dosen't match built in keymap, using local keymap file
[20160927-13:45:36] [DEBUG] returnvalue from xrdp_mm_connect 0
[20160927-13:45:39] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 12
[20160927-13:45:40] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 12
[20160927-13:45:41] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 12
[20160927-13:45:42] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 12
[20160927-13:45:43] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 12
[20160927-13:45:44] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 12
[20160927-13:45:45] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 12
[20160927-13:45:46] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 12
[20160927-13:45:47] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 12
[20160927-13:45:49] [DEBUG] VNC Error after security negotiation
[20160927-13:45:49] [DEBUG] VNC error before sending share flag
[20160927-13:45:49] [DEBUG] VNC error before receiving server init
[20160927-13:45:49] [DEBUG] VNC error before receiving pixel format
[20160927-13:45:49] [DEBUG] VNC error before receiving name length
[20160927-13:45:49] [DEBUG] VNC error before receiving name
[20160927-13:45:49] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 12
[20160927-13:45:49] [DEBUG] xrdp_mm_module_cleanup
[20160927-13:45:49] [DEBUG] VNC mod_exit
[20160927-13:45:49] [INFO ] An established connection closed to endpoint: 127.0.0.1:3350 - socket: 11
[20160927-13:45:53] [INFO ] An established connection closed to endpoint: 10.5.33.15:34884 - socket: 8
[20160927-13:45:53] [DEBUG] xrdp_mm_module_cleanup
[20160927-13:45:53] [ERROR] Listening socket is in wrong state we terminate listener

xrdp-sesman.log
Code:

[20160927-13:45:36] [INFO ] A connection received from: 127.0.0.1 port 33146
[20160927-13:45:36] [INFO ] scp thread on sck 8 started successfully
[20160927-13:45:36] [INFO ] ++ created session (access granted): username robert, ip 10.5.33.15:34884 - socket: 8
[20160927-13:45:36] [INFO ] starting Xvnc session...
[20160927-13:45:36] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 9
[20160927-13:45:36] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 9
[20160927-13:45:36] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 9
[20160927-13:45:36] [INFO ] An established connection closed to endpoint: 127.0.0.1:33146 - socket: 8
[20160927-13:45:36] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 7
[20160927-13:45:36] [INFO ] An established connection closed to endpoint: 127.0.0.1:33146 - socket: 8
[20160927-13:45:36] [ERROR] env_set_user: error creating .vnc dir
[20160927-13:45:36] [INFO ] Xvnc :10 -geometry 1920x1080 -depth 24 -rfbauth /home/robert/.vnc/sesman_robert_passwd -bs -nolisten tcp -localhost -dpi 96
[20160927-13:45:37] [INFO ] starting xrdp-sessvc - xpid=25232 - wmpid=25231

What am I missing?

sag47 09-29-2016 10:22 AM

Seems another user experiences your issue with similar logs. A solution is documented at the bottom. https://github.com/neutrinolabs/xrdp/issues/284

See also https://sourceforge.net/p/xrdp/bugs/54/#108d

If you're comfortable building from source then apply that patch as a more elegant fix.

lazydog 09-29-2016 01:35 PM

sag47 Thank you kindly. This has fixed my issues.

sag47 10-01-2016 12:08 PM

Awesome! Glad you resolved it. Which solution specifically resolved it for you?

lazydog 10-02-2016 12:54 AM

I used the first solution to get things working. Only drawback is if you are ssh'ed in at the same time as you are rdpx'ed in and quite rdpx you will lose the ssh session also. Not a deal breaker for me at this time though. Thanks again.

sag47 10-02-2016 04:14 PM

Quote:

Originally Posted by lazydog (Post 5612635)
I used the first solution to get things working. Only drawback is if you are ssh'ed in at the same time as you are rdpx'ed in and quite rdpx you will lose the ssh session also. Not a deal breaker for me at this time though. Thanks again.

You can tell the difference between the two environments (rdp vs ssh) by checking what environment variables are set between the two. Use env command and log both scenarios to check the difference. You can make the ssh scenario benign.

Additionally, you should not use killall -9 (aka SIGKILL) but instead should use killall -15 (aka SIGTERM). The latter offers xrdp the chance to gracefully shutdown and clean up its state. If SIGTERM doesn't work then you should use SIGHUP (killall -1) or SIGINT (killall -2) before resorting to SIGKILL.

TL;DR is you almost always want to give the process a chance to save and clean itself up. Only use SIGKILL as the last resort nuclear bomb option. See also http://tldp.org/LDP/Bash-Beginners-G...ect_12_01.html


All times are GMT -5. The time now is 05:07 AM.