X11 forwarding in Singularity with new MacOS X capability

357 views
Skip to first unread message

Alan Sill

unread,
Mar 12, 2019, 3:03:36 PM3/12/19
to singu...@lbl.gov
Trying out the new alpha MacOS X (more) native support, I ran into the following problem launching a container that expects to have X11 forwarding set up:

[…]

$ singularity exec datascience_rstudio463-v1.0.0.sif rstudio
QXcbConnection: Could not connect to display 
[    2.088968] reboot: Power down

This particular image has the following note in its project page:

  • Don't forget to add (config.ssh.forward_x11=true) in your vagrant file.

Of course, in the new method, there is no vagrant file (right)? So what needs to be adjusted to accomplish the same step and enable X11 forwarding for this image?

(Note X11 forwarding is already enabled in my OS-level individual ~/.ssh/config file.)

Thanks,
Alan

Jason Stover

unread,
Mar 12, 2019, 4:02:52 PM3/12/19
to singu...@lbl.gov
Hi Alan,

Right now X11 forwarding doesn't work. I've downloaded XQuartz and
am playing with it. As an aside here's what I _think_ we'll need to
do:

When you echo $DISPLAY on the Mac, you'll get a path to the X11
socket. We need to bind mount this socket in when ran (I'm guessing
just see if DISPLAY is set, and figure it out from there). Then pass
that along the chain to the Singularity run, and set the DISPLAY
variable to it.

So ... I have an idea on how to get X11 forwarding to work, I just
need to figure out how to actually implement it. So far, I can pass
the socket to where I need it, but can't actually use it. So trying to
see if there's something special that needs to be done here. :/

-J
> --
> You received this message because you are subscribed to the Google Groups "singularity" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to singularity...@lbl.gov.

David Godlove

unread,
Mar 13, 2019, 12:49:46 PM3/13/19
to singularity
Would it make sense to make open an issue about this for tracking purposes?

Alan Sill

unread,
Mar 13, 2019, 5:08:28 PM3/13/19
to singu...@lbl.gov
Possibly. First, let’s see what Jason has done to pass the socket. I thought that required the “capability” controls for singularity to be enabled — or was that an older version?

Another related problem is that the SINGULARITYENV_xxxxx method to set environmental variables does not seem to work. This makes trying  the various recipes and tricks for sharing sockets (such as using socat) with containers that depend on passikng environmental variables don't seem to work. Here is an example:


$ SINGULARITYENV_DISPLAY=:0 singularity shell datascience_rstudio463-v1.0.0.sif
Singularity datascience_rstudio463-v1.0.0.sif:~/singularity-desktop> env
SHELL=/bin/bash
singularity_arguments=
SINGULARITY_NAME=datascience_rstudio463-v1.0.0.sif
SINGARG=
PWD=/Users/alansill/singularity-desktop
LOGNAME=alansill
_=/usr/bin/env
USER_PATH=:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
HOME=/Users/alansill
USERNAME=alansill
SINGCWD=/Users/alansill/singularity-desktop
LANG=en_US.UTF-8
SINGULARITY_CONTAINER=/dev/sda
SINGULARITY_APPNAME=
TERM=linux
SINGACT=shell
sing_cwd=/Users/alansill/singularity-desktop
USER=alansill
SHLVL=4
sing_img_name=datascience_rstudio463-v1.0.0.sif
LD_LIBRARY_PATH=/.singularity.d/libs
PS1=Singularity datascience_rstudio463-v1.0.0.sif:\w> 
LC_ALL=en_US.UTF-8
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
sing_user=alansill:501:20
R_BASE_VERSION=3.5.2
singularity_binds=|home:/Users/alansill
SINGULARITY_BINDPATH=
singularity_action=shell


Reply all
Reply to author
Forward
0 new messages