Hi all,
There are specific reasons I built a Linux Ubuntu container with a fully functioning Lubuntu desktop but the reason for that isn’t relevant to this discussion. The RDP problem is what I need to get fixed and I have no idea what is wrong.
I’m running my docker desktop on a Windows 11 machine. I have no problem RDPing into the container using local host as many times as I want as long as the container has never been stopped. I can terminate the RDP connection and go back just fine, like I said, as long as the container has never been stopped. Once the container has been stopped I cannot get back in even if I have saved the RDP connection prior to stopping the container. After that if I try to RDP back in I get the following message.
Any ideas as to what the problem is and how I can RDP back into the container after it has been stopped?
I can’t let the container run indefinitely. I have to be able to turn my computer off at some point but I need to be able to access the container after turning my machine back on.
Thank you everyone!
Norm
I added an empty line after your screenshot as otherwise the forum “thinks” it is a description of the image apparently.
If it is a full Linux desktop inside the container then you should probably try to check the logs inside the container. I mean assuming the desktop also contains systemd and journal logs or any text based log you can check. Or the output of docker logs.
Since the container is a process started in an isolated way and stoping the container does not really change anything except stopping the process, my guess is that when you stop the container it cannot stop correctly and some files are still kept in the container’s filesystem which are not supposed to be there when the new process starts. In that case something should log that somewhere in the container.
Make sure the proper stop signals are handled inside the container. The first process has to be able to recieve it and forward it to any other processes. If it takes too much time, procdesses will be killed forcefully. The default timeout is 10 seconds, so if you noticed that the container needs 10 seconds to stop, and almost exactly 10 seconds every time, it is likely that either your timoeut is to low or the main process with PID 1 ccannot recieve or forward the signal properly.
I wrote about stop signals here:
If you still can’t figure it out, please show more about the container. The output of docker container inspect containername could help. Or a Dockerfile.
Thank you for taking the time to answer.
Sometimes a problem gets overwhelming and you forget the basics. I found the answer in the container logs.
It showed an error with starting the XRDP server and even suggested checking the /var/run/xrdp files. After doing a cat on the 2 files located in that directory it looked like they were storing the PID number for the current established XRDP session which was apparently causing an error on restart of the container.
If I delete both the xrdp-sesman.pid and xrdp.pid files prior to stopping the container there are no errors on restart and I can RDP back into the container with no problem.
The container always starts even if I forget to delete the files before closing it and then get blocked on the next RDP attempt. Then I just go to the files and delete them, restart the container and still no problem with the RDP.
Thank you again!
Norm