error running x11 applications in a container

989 views
Skip to first unread message

Aditya Apte

unread,
May 7, 2018, 3:53:09 PM5/7/18
to singularity
I run into following error while launching x11 applications in a container: 

Can't open display: localhost:10.0

I am running the container (ubuntu 18.04) via vagrant. Is there a setting to set the x11 display within the container?

Thanks!

v

unread,
May 7, 2018, 3:58:40 PM5/7/18
to singu...@lbl.gov
I haven't tried this in a while, but with respect to Singularity containers on  a host the x11 forwarding should just work! I think it likely has to do with the fact that the forwarding isn't happening from your host to the Vagrantbox? Here is an article with things to try that might work:  https://code-maven.com/xforwarding-from-vagrant-box It you are still stuck then perhaps share the configuration of your Vagrant box (the Vagrantfile and other stuffs) and others on the list can help debug!

--
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+unsubscribe@lbl.gov.



--
Vanessa Villamia Sochat
Stanford University '16

Aditya Apte

unread,
May 7, 2018, 6:15:34 PM5/7/18
to singu...@lbl.gov

x11 seems to work on Vagrantbox. For example, I am able to bring up xclock from Vagrantbox but not from the container. Could it be due to missing .Xauthority file within the container? .Xauthority file is available in Vagrantbox's $HOME, but not visible in Container's $HOME.


Here are my settings within the Vagrantfile

  config.vm.box = "singularityware/singularity-2.4"

  config.ssh.forward_agent = true

  config.ssh.forward_x11 = true

  config.vm.network "forwarded_port", guest: 80, host: 8080

 

The container is running Ubuntu 18.04.





To unsubscribe from this group and stop receiving emails from it, send an email to singularity...@lbl.gov.



--
Vanessa Villamia Sochat
Stanford University '16

--
You received this message because you are subscribed to a topic in the Google Groups "singularity" group.
To unsubscribe from this topic, visit https://groups.google.com/a/lbl.gov/d/topic/singularity/2BO97_Uhdrs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to singularity+unsubscribe@lbl.gov.

Aditya Apte

unread,
May 7, 2018, 6:52:36 PM5/7/18
to singu...@lbl.gov
update: when I manually copied the .Xauthority file from vagrant box's $HOME to container's $HOME, I am able to bring up xclock. So, the question is why vargantbox's $HOME was not bound to container's $HOME? I am invoking container's shell using:

sudo singularity shell -B /mnt:/mnt /mnt/Aditya/test_container.simg



To unsubscribe from this group and all its topics, send an email to singularity...@lbl.gov.


v

unread,
May 7, 2018, 6:57:03 PM5/7/18
to singu...@lbl.gov
Why are you running with sudo? If you are using sudo, then the $HOME being bound would be root's home (/root) and not a user home I think. I would do a quick sanity check to see what the Vagrant box is calling home, what your container is calling home, and if those two things are the same place (with the file) because it seems like if you needed to copy it, then they are not! You cna also just try a shell without sudo, or to specify a custom home with the --home flag.

To unsubscribe from this group and stop receiving emails from it, send an email to singularity+unsubscribe@lbl.gov.

Aditya Apte

unread,
May 7, 2018, 7:38:12 PM5/7/18
to singu...@lbl.gov
Thanks! That was the issue. $HOME is bound correctly without sudo.

To unsubscribe from this group and all its topics, send an email to singularity+unsubscribe@lbl.gov.

v

unread,
May 7, 2018, 7:40:10 PM5/7/18
to singu...@lbl.gov
Awesome! :>)

- Vanessa and Carrot Nose Emoticon

To unsubscribe from this group and stop receiving emails from it, send an email to singularity+unsubscribe@lbl.gov.
Reply all
Reply to author
Forward
0 new messages