xrdp from restricted container (singularity/apptainer) #2309
Replies: 6 comments 2 replies
-
Other comments:-
I hope that's of some use. |
Beta Was this translation helpful? Give feedback.
-
Thanks. These points are very helpful, to find out what we may have missed. ad 1. I will give not using
|
Beta Was this translation helpful? Give feedback.
-
ad 1. Running The last lines of strace are:
|
Beta Was this translation helpful? Give feedback.
-
@andreasplesch, have you succeeded with running a container with XRDP? |
Beta Was this translation helpful? Give feedback.
-
Hi there. Yes, I think I got it working but it seemed quite far off the supported configuration and fragile. In the end we switched to Turbovnc since the users were comfortable with installing and using the Turbovnc client both on Windows and Macs. So if vnc is an option, I would suggest looking into it since it is easier to setup for singularity. |
Beta Was this translation helpful? Give feedback.
-
No, I do not think there are issues with vncserver and root. Here is a relevant excerpt for singularity configuration.
|
Beta Was this translation helpful? Give feedback.
-
Our cluster environment offers use of singularity containers ( https://docs.sylabs.io/guides/3.10/user-guide/ ) which have more restrictions than docker containers. Our group would want to use xrdp to enable GUI apps from cluster nodes, and is figuring out ways to deal with the container restrictions.
While we were overall successful, eg. it works in a somewhat hacky way, there are some remaining questions for which any feedback would be much appreciated. Let me list them in the order they were encountered.
following #1360. Is that equivalent to what the service scripts would do ? The nohup back-grounding was necessary because otherwise xrdp-sesman would not start (or start but stop xrdp). Using
xrdp
without--nodaemon
would not work, and I am not sure why. Shouldxrdp-sesman --nodaemon
also be put in the background ?Presumably, this is too open but this is only accessible from within the container which is owned by the user. Probably it is safer to change the owner instead to the $USER but cannot be done by the user. Just read permissions for all should suffice (444) ? Let me try that.
This works fine.
auth.log
is normally generated by syslog from PAM but pam from the container uses the system syslog which is configured to log remotely. I could not find a way to have pam log somewhere else, eg. not use syslog. Is there a way ? I know this is a pam question not a xrdp question. It would have been mostly helpful for problem tracking.And, in deed this allows for connecting without any or the wrong password (after establishing the ssh tunnel). This is not great but perhaps less problematic since the ssh tunnel still needs to be made, and the connection can only be made from one localhost. I have to experiment with the tls security layer but for regular users creating certificates may be too hard. Any suggestions most welcome.
Missing account checking is mostly a problem if the user name is mistyped. Then the connection is still established but there is no home directory, and the session manager gets confused and there is a black screen.
man pam_systemd
although how dbus is related is not quite clear to me. In the container, systemd cannot be used. Accordingly, I could not figure out how to replace that step with something else. It seems to involve mostly creating /run/user/$UID and setting the $XDG_SESSION_ID to something. Instead, I ended up with creating a$HOME/.xsession
file with:The
dbus-launch
command seems to do the right thing. Is there a better way to replace pam_systemd ? In addition, it would be much preferable to preconfigure the container, eg. xrdp, rather than doing this for each user. Where would be the appropriate place for this ?/etc/xrdp/startwm.sh
? What is the recommended way to use xrdp without systemd ?Thanks for reading and any feedback.
Beta Was this translation helpful? Give feedback.
All reactions