FedoraForum.org - Fedora Support Forums and Community
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 20
  1. #1
    Join Date
    Feb 2011
    Posts
    8

    Angry xrdp " Listening socket is in wrong state, terminating listener"

    At some point my working xrdp stopped working. I have been Googling the issue but have no up to date information to work on.

    The symptoms are: when the user logs in (from a Windows host)

    1. first attempt the client reports "some error"
    2. Second attempt shows a black screen for a second or two which then closes


    xrdp log shows the following

    Code:
    [20170615-11:14:27] [DEBUG] xrdp_wm_log_msg: connecting to sesman ip 127.0.0.1 port 3350
    [20170615-11:14:28] [INFO ] xrdp_wm_log_msg: sesman connect ok
    [20170615-11:14:28] [DEBUG] xrdp_wm_log_msg: sending login info to session manager, please wait...
    [20170615-11:14:28] [DEBUG] return value from xrdp_mm_connect 0
    [20170615-11:14:29] [INFO ] xrdp_wm_log_msg: login successful for display 19
    [20170615-11:14:29] [DEBUG] xrdp_wm_log_msg: VNC started connecting
    [20170615-11:14:29] [DEBUG] xrdp_wm_log_msg: VNC connecting to 127.0.0.1 5919
    [20170615-11:14:31] [DEBUG] xrdp_wm_log_msg: VNC tcp connected
    [20170615-11:14:31] [DEBUG] xrdp_wm_log_msg: VNC security level is 2 (1 = none, 2 = standard)
    [20170615-11:14:31] [DEBUG] xrdp_wm_log_msg: VNC password ok
    [20170615-11:14:31] [DEBUG] xrdp_wm_log_msg: VNC sending share flag
    [20170615-11:14:31] [DEBUG] xrdp_wm_log_msg: VNC receiving server init
    [20170615-11:14:31] [DEBUG] xrdp_wm_log_msg: VNC receiving pixel format
    [20170615-11:14:31] [DEBUG] xrdp_wm_log_msg: VNC receiving name length
    [20170615-11:14:31] [DEBUG] xrdp_wm_log_msg: VNC receiving name
    [20170615-11:14:31] [DEBUG] xrdp_wm_log_msg: VNC sending pixel format
    [20170615-11:14:31] [DEBUG] xrdp_wm_log_msg: VNC sending encodings
    [20170615-11:14:31] [DEBUG] xrdp_wm_log_msg: VNC sending framebuffer update request
    [20170615-11:14:31] [DEBUG] xrdp_wm_log_msg: VNC sending cursor
    [20170615-11:14:31] [DEBUG] xrdp_wm_log_msg: VNC connection complete, connected ok
    [20170615-11:14:31] [INFO ] The following channel is allowed: rdpdr (0)
    [20170615-11:14:31] [INFO ] The following channel is allowed: rdpsnd (1)
    [20170615-11:14:31] [INFO ] The following channel is allowed: cliprdr (2)
    [20170615-11:14:31] [INFO ] The following channel is allowed: drdynvc (3)
    [20170615-11:14:31] [DEBUG] The allow channel list now initialized for this session
    [20170615-11:14:31] [DEBUG] xrdp_wm_log_msg: connected ok
    [20170615-11:14:31] [DEBUG] xrdp_mm_connect_chansrv: chansrv connect successful
    [20170615-11:14:32] [DEBUG] Closed socket 18 (AF_INET 127.0.0.1:38414)
    [20170615-11:14:32] [DEBUG] VNC got clip data
    [20170615-11:14:32] [DEBUG] Closed socket 12 (AF_INET 10.9.8.10:3389)
    [20170615-11:14:32] [DEBUG] xrdp_mm_module_cleanup
    [20170615-11:14:32] [DEBUG] VNC mod_exit
    [20170615-11:14:32] [DEBUG] Closed socket 19 (AF_INET 127.0.0.1:40824)
    [20170615-11:14:32] [DEBUG] Closed socket 20 (AF_UNIX)
    [20170615-11:14:32] [ERROR] Listening socket is in wrong state, terminating listener
    [20170615-11:14:32] [CORE ] shutting down log subsystem...
    This behaviour is reported as a bug, now fixed, on Ubuntu in various places and there are suggestions it relates to ssh certs, but nothing I have tried so far seems to make a difference.

    My requirement is that users should be able to login to the Fedora box via RDP (don't care which desktop), but also to be able to run a Gnome session from the console itself.

    What is my next step?

  2. #2
    Join Date
    May 2017
    Location
    www
    Posts
    135

    Re: xrdp " Listening socket is in wrong state, terminating listener"

    Second attempt shows a black screen for a second or two which then closes
    have you tried adding:

    Code:
    delay_ms=2000

  3. #3
    Join Date
    Feb 2011
    Posts
    8

    Re: xrdp " Listening socket is in wrong state, terminating listener"

    to xrdp.ini?

    I tried that - but to no effect
    Last edited by Huwmungous; 15th June 2017 at 05:09 PM.

  4. #4
    Join Date
    May 2017
    Location
    www
    Posts
    135

    Re: xrdp " Listening socket is in wrong state, terminating listener"

    Check the files in /etc/xrdp and create them if they don't exist or are empty:

    • cert.pem
    • key.pem



    Code:
    openssl req -x509 -newkey rsa:2048 -nodes -keyout key.pem -out cert.pem -days 365

    • rsakeys.ini


    Code:
    sudo xrdp-keygen xrdp auto 2048

    Restart the xrdp service

    Code:
    service xrdp restart

  5. #5
    Join Date
    Feb 2011
    Posts
    8

    Smile Re: xrdp " Listening socket is in wrong state, terminating listener"

    Fab - sorted.

    I had guessed that my certs had expired but was missing the second of the 2 commands you suggested.

    All up and running.

  6. #6
    Join Date
    Jan 2017
    Location
    Huntingtown MD
    Posts
    6

    Re: xrdp " Listening socket is in wrong state, terminating listener"

    Anyone get this working? I use xrdp a LOT. I set up test machines as VMs so I can snap, test and restore while developing code. ESXI is great that way. Recently it broke, I think about the same time this thread started. I can't get it to work anymore. I've rebuilt the VM, I've updated, I've tried everything I can get my hands on. Here's what I'm doing:

    New built vm host. Has xrdp, tigervnc, desktop. F25.

    [robert@firefox ~]$ rdesktop -g 2460x1340 192.168.2.13 &
    [1] 5914
    [robert@firefox ~]$ Autoselected keyboard map en-us
    Connection established using SSL.
    NOT IMPLEMENTED: RDPDR pakid 0x554c of component 0x4472

    This pops up the screen, I can see the desktop for about 1/10 second then it's blown away. Nothing in the local user files.

    In /var/log,
    xrdp-sesman.log:
    20170704-12:25:59] [INFO ] Socket 12: AF_INET connection received from 192.168.2.2 port 34632
    [20170704-12:25:59] [DEBUG] Closed socket 12 (AF_INET 192.168.2.13:3389)
    [20170704-12:25:59] [DEBUG] Closed socket 11 (AF_INET 0.0.0.0:3389)
    [20170704-12:25:59] [INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
    [20170704-12:25:59] [INFO ] Using default X.509 key file: /etc/xrdp/key.pem
    [20170704-12:25:59] [DEBUG] TLSv1.2 enabled
    [20170704-12:25:59] [DEBUG] TLSv1.1 enabled
    [20170704-12:25:59] [DEBUG] TLSv1 enabled
    [20170704-12:25:59] [DEBUG] Security layer: requested 1, selected 1
    [20170704-12:25:59] [INFO ] connected client computer name: firefox
    [20170704-12:25:59] [INFO ] TLS connection established from 192.168.2.2 port 34632: TLSv1 with cipher AES256-SHA
    [20170704-12:25:59] [DEBUG] xrdp_0000444e_wm_login_mode_event_00000001
    [20170704-12:26:00] [INFO ] Loading keymap file /etc/xrdp/km-00000409.ini
    [20170704-12:26:00] [WARN ] local keymap file for 0x00000409 found and doesn't match built in keymap, using local keymap file
    [20170704-12:26:02] [DEBUG] xrdp_wm_log_msg: connecting to sesman ip 127.0.0.1 port 3350
    [20170704-12:26:02] [INFO ] xrdp_wm_log_msg: sesman connect ok
    [20170704-12:26:02] [DEBUG] xrdp_wm_log_msg: sending login info to session manager, please wait...
    [20170704-12:26:02] [DEBUG] return value from xrdp_mm_connect 0
    [20170704-12:26:02] [INFO ] xrdp_wm_log_msg: login successful for display 10
    [20170704-12:26:02] [DEBUG] xrdp_wm_log_msg: VNC started connecting
    [20170704-12:26:02] [DEBUG] xrdp_wm_log_msg: VNC connecting to 127.0.0.1 5910
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: VNC tcp connected
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: VNC security level is 2 (1 = none, 2 = standard)
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: VNC password ok
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: VNC sending share flag
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: VNC receiving server init
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: VNC receiving pixel format
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: VNC receiving name length
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: VNC receiving name
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: VNC sending pixel format
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: VNC sending encodings
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: VNC sending framebuffer update request
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: VNC sending cursor
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: VNC connection complete, connected ok
    [20170704-12:26:03] [INFO ] The following channel is allowed: cliprdr (0)
    [20170704-12:26:03] [INFO ] The following channel is allowed: rdpsnd (1)
    [20170704-12:26:03] [INFO ] This channel is disabled (not in List): snddbg
    [20170704-12:26:03] [INFO ] The following channel is not allowed: snddbg (2)
    [20170704-12:26:03] [INFO ] The following channel is allowed: rdpdr (3)
    [20170704-12:26:03] [DEBUG] The allow channel list now initialized for this session
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: connected ok
    [20170704-12:26:03] [DEBUG] xrdp_mm_connect_chansrv: chansrv connect successful
    [20170704-12:26:03] [DEBUG] Closed socket 18 (AF_INET 127.0.0.1:51866)
    [20170704-12:26:03] [DEBUG] VNC got clip data
    [20170704-12:26:03] [DEBUG] Closed socket 12 (AF_INET 192.168.2.13:3389)
    [20170704-12:26:03] [DEBUG] xrdp_mm_module_cleanup
    [20170704-12:26:03] [DEBUG] VNC mod_exit
    [20170704-12:26:03] [DEBUG] Closed socket 19 (AF_INET 127.0.0.1:42128)
    [20170704-12:26:03] [DEBUG] Closed socket 20 (AF_UNIX)
    [20170704-12:26:03] [ERROR] Listening socket is in wrong state, terminating listener
    [20170704-12:26:03] [CORE ] shutting down log subsystem...


    xrdp.log:
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: VNC password ok
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: VNC sending share flag
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: VNC receiving server init
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: VNC receiving pixel format
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: VNC receiving name length
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: VNC receiving name
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: VNC sending pixel format
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: VNC sending encodings
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: VNC sending framebuffer update request
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: VNC sending cursor
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: VNC connection complete, connected ok
    [20170704-12:26:03] [INFO ] The following channel is allowed: cliprdr (0)
    [20170704-12:26:03] [INFO ] The following channel is allowed: rdpsnd (1)
    [20170704-12:26:03] [INFO ] This channel is disabled (not in List): snddbg
    [20170704-12:26:03] [INFO ] The following channel is not allowed: snddbg (2)
    [20170704-12:26:03] [INFO ] The following channel is allowed: rdpdr (3)
    [20170704-12:26:03] [DEBUG] The allow channel list now initialized for this session
    [20170704-12:26:03] [DEBUG] xrdp_wm_log_msg: connected ok
    [20170704-12:26:03] [DEBUG] xrdp_mm_connect_chansrv: chansrv connect successful
    [20170704-12:26:03] [DEBUG] Closed socket 18 (AF_INET 127.0.0.1:51866)
    [20170704-12:26:03] [DEBUG] VNC got clip data
    [20170704-12:26:03] [DEBUG] Closed socket 12 (AF_INET 192.168.2.13:3389)
    [20170704-12:26:03] [DEBUG] xrdp_mm_module_cleanup
    [20170704-12:26:03] [DEBUG] VNC mod_exit
    [20170704-12:26:03] [DEBUG] Closed socket 19 (AF_INET 127.0.0.1:42128)
    [20170704-12:26:03] [DEBUG] Closed socket 20 (AF_UNIX)
    [20170704-12:26:03] [ERROR] Listening socket is in wrong state, terminating listener
    [20170704-12:26:03] [CORE ] shutting down log subsystem...


    I'm very surprised the recent update didn't fix this. I was hopeful it would work. Maybe I'm just overlooking something?

  7. #7
    Join Date
    Feb 2011
    Posts
    8

    Re: xrdp " Listening socket is in wrong state, terminating listener"

    I said the problem was sorted in a previous reply, but the fix was only temporary.

    I am not 100% certain the problem I now have is the exact same issue as I have not had a chance to check the logs. I will post back as soon as possible.

  8. #8
    Join Date
    Feb 2011
    Posts
    8

    Re: xrdp " Listening socket is in wrong state, terminating listener"

    Quote Originally Posted by Huwmungous
    I am not 100% certain the problem I now have is the exact same issue as I have not had a chance to check the logs. I will post back as soon as possible.
    I have just checked and the error message is the same.


    [20170705-16:39:00] [DEBUG] xrdp_wm_log_msg: connected ok
    [20170705-16:39:00] [DEBUG] xrdp_mm_connect_chansrv: chansrv connect successful
    [20170705-16:39:00] [DEBUG] Closed socket 18 (AF_INET 127.0.0.1:34824)
    [20170705-16:39:02] [DEBUG] VNC got clip data
    [20170705-16:39:02] [DEBUG] Closed socket 12 (AF_INET 10.9.8.10:3389)
    [20170705-16:39:02] [DEBUG] xrdp_mm_module_cleanup
    [20170705-16:39:02] [DEBUG] VNC mod_exit
    [20170705-16:39:02] [DEBUG] Closed socket 19 (AF_INET 127.0.0.1:33534)
    [20170705-16:39:02] [DEBUG] Closed socket 20 (AF_UNIX)
    [20170705-16:39:02] [ERROR] Listening socket is in wrong state, terminating listener
    [20170705-16:39:02] [CORE ] shutting down log subsystem...


    Interestingly I did briefly get a desktop with an authentication dialog - entering the password caused the session to close.
    Last edited by Huwmungous; 5th July 2017 at 04:51 PM. Reason: Further information

  9. #9
    Join Date
    Feb 2011
    Posts
    8

    Re: xrdp " Listening socket is in wrong state, terminating listener"

    The plot thickens!

    Yesterday evening I witnessed my partner's 12 year old daughter logging in to an RDP session from her laptop! I had forgotten that I had shown her how to do this.

    She is running Windows 10, I am running Windows 7, so I made a few experiments.

    I can RDP to my Raspberry Pi from my workstation.

    The Pi can RDP to the target host.

    A virtual windows 7 running on the target host can RDP to the target host (although I had problems ending that session)

    A virtual Windows 7 on my workstation fails.

    A Virtual Ubuntu 15.04 on my workstation is successful.

    So it would appear that there is some issue with Windows 7 remotely connecting to xrdp.

    Any suggestions anyone?

  10. #10
    Join Date
    Jan 2017
    Location
    Huntingtown MD
    Posts
    6

    Re: xrdp " Listening socket is in wrong state, terminating listener"

    I fired up Win 10, used mstsc. It looked like it might actually work for a while, then Poof! Gone. At least we can be fairly sure it's not rdesktop.

  11. #11
    Join Date
    Feb 2011
    Posts
    8

    Re: xrdp " Listening socket is in wrong state, terminating listener"

    I think I may have cracked the problem.

    I have made quite a few changes over the course of the past week or so but I think the salient points are:

    i) Set/uncomment the delay_ms=2000 in the relevant section of xrdp.ini ([Xvnc]) (thanks to askfedoraa for that)

    ii) Edit ~/.Xclients to contain ONLY the line 'gnome-session' (or whichever desktop you wish to run)

  12. #12
    Join Date
    Jan 2017
    Location
    Huntingtown MD
    Posts
    6

    Re: xrdp " Listening socket is in wrong state, terminating listener"

    I saw those before and tried them. For fun I changed the delay_ms to 5000. Still blows away. So now I can see it started up kde and I have a desktop. I just can't touch the mouse or it'll go away or if I wait it goes away.

    What I can tell you is whatever happened happened around June 11 and no later than June 20th. I think probably the 15th is when I started having trouble. The only way I know this is I happened to have downloaded a file using the gui on the 11th. By June 20th I was trying to downgrade, install other packages, and generally having a tough time.

    HTH

  13. #13
    Join Date
    Dec 2005
    Posts
    48

    Re: xrdp " Listening socket is in wrong state, terminating listener"

    Did you get this to work?? How?

  14. #14
    Join Date
    Jan 2017
    Location
    Huntingtown MD
    Posts
    6

    Re: xrdp " Listening socket is in wrong state, terminating listener"

    Still broken. I updated my machine to F26, updated the test server to F26, no dice. I think it was a bit better than the F25 version. I've completely rebuilt the test box, tried connecting from a Windows 10 machine. Still blows it away.

    So I loaded Ubuntu, I think one a revision or two old, the server version, install xrdp, the KDE desktop and such, works fine. So I'm using Ubuntu and kali until it's fixed.

    I think it's safe to say whatever the problem is, it's in xrdp. My guess is it was a change made certainly before June 20th. Probably before June 15th.

  15. #15
    Join Date
    Dec 2005
    Posts
    48

    Re: xrdp " Listening socket is in wrong state, terminating listener"

    Quote Originally Posted by armonica
    Still broken. I updated my machine to F26, updated the test server to F26, no dice. I think it was a bit better than the F25 version. I've completely rebuilt the test box, tried connecting from a Windows 10 machine. Still blows it away.

    So I loaded Ubuntu, I think one a revision or two old, the server version, install xrdp, the KDE desktop and such, works fine. So I'm using Ubuntu and kali until it's fixed.

    I think it's safe to say whatever the problem is, it's in xrdp. My guess is it was a change made certainly before June 20th. Probably before June 15th.
    Thanks for the quick response!

    I don't use RDP frequently. I last used it about 3-4 months ago to access my F25, and it worked fine. I access it from Window 10.

    Yesterday, after upgrading one of my F25s to F26, I decided to try to RDP from my Windows. After logon, I got a light blue screen, then a black screen, and then a disconnect. I then tried RDP-ing from Windows 10 to an F25 - and that failed too. I dnf update frequently, so that if an xrdp update was issued in the last few months, it would have been on updated on my F25.

    I still have an original Fedora 25 installation medium. I am considering installing it on a virtual machine, to see if that works.

    BYW, using a vinagre client, I van RDP from one Fedora to the other.

    To whom do I complain? Where can I register a bug?

    TIA,
    Lavie

Page 1 of 2 1 2 LastLast

Similar Threads

  1. [SOLVED] Milter-Greylist failing to create socket / "unsafe"
    By PolywogSys in forum Guides & Solutions (Not For Questions)
    Replies: 0
    Last Post: 22nd February 2012, 02:43 AM
  2. differences between "struct sock" and "struct socket"
    By ahm_irf in forum Programming & Packaging
    Replies: 0
    Last Post: 30th March 2009, 05:24 AM
  3. Replies: 0
    Last Post: 26th September 2007, 05:51 PM
  4. Replies: 8
    Last Post: 4th January 2007, 04:49 PM
  5. Replies: 0
    Last Post: 23rd May 2005, 04:59 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •