NeuroDesk / neurocommand

A flexible, scalable, and easy to use data analysis environment for reproducible neuroimaging
https://neurodesk.org
MIT License
38 stars 25 forks source link

Pass XAUTHORITY env? #328

Open rhancockn opened 1 week ago

rhancockn commented 1 week ago

I had trouble running a GUI over untrusted (ssh -X) X11 forwarding. The container was launched as a slurm job, which may interact with this. The container was launched with

singularity --silent exec --cleanenv --env DISPLAY=$DISPLAY  --bind $TMPDIR:/tmp $neurodesk_singularity_opts --pwd "$PWD" PATH/neurocommand/local/containers/bidscoin_4.4.0_20241003/bidscoin_4.4.0_20241003.simg bidseditor bids

Passing in the XAUTHORITY environment variable fixed this:

singularity --silent exec --cleanenv --env DISPLAY=$DISPLAY --env XAUTHORITY=$XAUTHORITY --bind $TMPDIR:/tmp $neurodesk_singularity_opts --pwd "$PWD" PATH/neurocommand/local/containers/bidscoin_4.4.0_20241003/bidscoin_4.4.0_20241003.simg bidseditor bids

Could the transparent singularity wrapper include XAUTHORITY env by default? Or is there another way of the user manipulating the singularity options (I couldn't find this in the docs)?

stebo85 commented 4 days ago

Dear @rhancockn,

Thank you for reporting this. We have to do a few tests to make sure we can include it as a default.

A workaround is to use the neurodesk_singularity_opts environment variable to set this option for your system:

export neurodesk_singularity_opts="--env XAUTHORITY=$XAUTHORITY"