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
After reconnecting the container with RDP, then sound and clipboard not working anymore! #32
Comments
Good news I found a fix for the RDP reconnect problem which also makes reconnecting much faster!I did dig more into defunct, and it seems that when the parent process of the defunct process is stopped it becomes However, I noticed that when xrdp-chansrv became defunct and I started a new xrdp-chansrv in the container myself
Now on each reconnect a new xrdp-chansrv is launched in the background, and it fixed the problem! But if we reconnect several times do we then not get multiple defunct processes? To show what happens:
So the original defunct process stays, but the newly created 'xrdp-chansrv' processes are nicely cleaned up each time after a disconnect. GREAT! Finally, I must remark then without this fix it also took long to reconnect with a black screen for many seconds, but with this fix the reconnect is almost immediately. So somehow a not working xrdp-chansrv process also slowed down the reconnects considerably. In the case, the problem gets fixed by rdp in the future I only start a new xrdp-chansrv process when I discover it is defunct. So the fix becomes a single command we should include in the Dockerfile:
The DISPLAY variable is hard coded to 10 ... I think that is the default always chosen by xrdp. I created a patched version of the Dockerfile which contains this fix. Note however that I had to change the used ubuntu TAG from LATEST to 20.04 explicitly because the docker build gave errors for the current LATEST. Finally, I discovered that I can pause the docker container and the RDP connection stays alive but frozen. When I resume the docker container the RDP session just continues without a problem. I can even close the RDP session when the docker container is paused, and reconnect the RDP session after the container is resumed. |
Both this image and the one from another repo have this problem. |
Tried with the fix and it worked perfectly so far. Thanks for sharing @harcokuppens ! |
Everything works fine on first connect with RDP.
When I close the lid of my laptop the remote desktop connection is closed.
I can then just reconnect the RDP connection, however then everything works fine except that the clipboard and sound are not working anymore.
I investigated the problem, and pulseaudio seems to work fine. The sound controls shows the xrdp output working just fine with the sound meters fluctuating.
After deep investigation it seems that the 'xrdp-chansrv' process gets in a 'defunct' mode if the remote desktop connection gets broken.
The documentation says:
Because both sound and the clipboard are not working seems to be caused that "xrdp-chansrv" is defunct.
I tried several ways to recover "xrdp-chansrv" but nothing helped. This process seems to be launched internally by xrdp and you have no control over it. Killing it also doesn't solve the problem, because it just gets relaunched 'defunct' again.
I tried to get more info about why "xrdp-chansrv" gets defunct, maybe I could remove the cause to fix the problem.
I found in the log:
Seems that he tries to open a different socket...15 instead of 12 .. would that be the cause?
However, I have no way to configure 'xrdp-chansrv' to point it to the right socket?
Online I already found a request to let end-users relaunch the 'xrdp-chansrv' process themselves, but nothing implemented yet.
See: neutrinolabs/xrdp#1259
The only workaround is after reconnect to logout from the XFCE session and let it remember which programs you had open. Then the remote desktop connection gets closed. Then reopen the remote desktop connection, and you get a full new session with the XFCE desktop restarted and 'xrdp-chansrv' restarted and working again. This way you do not have to restart the container.
So It seems to be a problem with 'xrdp-chansrv' which people of the xrdp project could maybe fix in the future...
I google around and say more people struggling with the same kind of problem, however no fix found.
Do you have an idea?
At least I have a small workaround to continue working in the container with sound and clipboard restarted.
technical note: I'm using a Macbook pro with M1 processor, and using the latest version of the "Microsoft Remote Desktop" application.
The text was updated successfully, but these errors were encountered: