running full DE under Singularity

543 views
Skip to first unread message

Crni

unread,
Aug 1, 2018, 4:40:31 PM8/1/18
to singularity
Hello,

I'm trying to use Singularity as sort of replacement for VirtualBox/VMware, so I'd like to run full desktop environment in the container.  The idea is that given user has something like:
   exec singularity exec centos.simg /usr/bin/startkde
in its $HOME/.xinitrc file.  This way, when startx executed, the X server would be run on the host Linux system, to avoid eventual problems with graphics drivers.  On the other side, the desktop environment would be run in the container, so the user would practially do all of its work in the container Linux system.  It all pretty much works, in the sense that the DE get started as I'd like, however for each DE that I tried (KDE/Gnome/Xfce) there are later some problems, starting from some components of the DE not being able to start, and then menus and apanels not working, etc.  So I'm interested: has anyone else tried something alike, and are there any workarounds?

Thanks.

Alex Huang

unread,
Aug 1, 2018, 4:44:35 PM8/1/18
to singularity
I think I tried this before with Xfce, with success. Are you mapping /tmp/.X11-unix and propagating .Xauthority?

Alex

Crni

unread,
Aug 1, 2018, 5:19:37 PM8/1/18
to singularity
I'm not doing any of that, what would be the right way to do it?

Thanks.

Alex Huang

unread,
Aug 1, 2018, 6:37:50 PM8/1/18
to singularity
Actually, sorry, I misunderstood the situation. Propagating /tmp/.X11-unix and ~/.Xauthority is necessary for running a DE from a docker container. But in Sy, $HOME and /tmp are mounted already so you don't need to bind that.

In my test, I can start Xfce from within the container. The panel has broken icons but the DE seems functional otherwise. I assume this is what you are seeing. My guess is the broken icons can be fixed with a bind to a cache directory. I get the same kind of broken icon problem in VBox when the VM has no more space.

Alex

Chris Hines

unread,
Aug 1, 2018, 7:00:50 PM8/1/18
to singu...@lbl.gov
Hi,
I have tried a slightly different scenario: I put a vncserver in the container along with the DE (Mate in my case since our userbase is accustomed to the gnome2 interface). It worked reasonably well, but there were definitely wart that I hadn't worked through yet. I'm not working on it ATM, but intend to return over the next few weeks (I also want to pub a guacamole server in the container).

Dear Sylabs, is there a community wiki you would like us to put stuff like this in? Or would you rather us make PRs on the documentation?

Cheers,
--
Chris.

--
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.

Crni

unread,
Aug 2, 2018, 3:48:07 AM8/2/18
to singularity
On Thursday, August 2, 2018 at 12:37:50 AM UTC+2, Alex Huang wrote:
>
> Actually, sorry, I misunderstood the situation. Propagating
> /tmp/.X11-unix and ~/.Xauthority is necessary for running a DE from a
> docker container. But in Sy, $HOME and /tmp are mounted already so you
> don't need to bind that.

That's what I thought, too.



> In my test, I can start Xfce from within the container. The panel has
> broken icons but the DE seems functional otherwise. I assume this is
> what you are seeing. My guess is the broken icons can be fixed with a
> bind to a cache directory. I get the same kind of broken icon problem
> in VBox when the VM has no more space.

Indeed that's what happens with Xfce in my case too.  In KDE, Plasma is
crashing, so start menu and panels are missing from the taskbar.
Something alike happens with Gnome too.  In each case, environment is
useful, in the sense that one can use right-click menu to reach "run
command" dialog, then start terminal, and run applications from there.
However, there are further issues with some applications, for example
while Firefox works fine, Emacs is crashing.


As far as using VNC server concerned, I'd prefer to avoid this.  The
idea would be everything to be transparent for the end-user, that should
just login under given username, and end up in an container environment
that looks completely the same like under native Linux distribution.
Mounting $HOME and /tmp is perfectly fine in my case too.  I have
experience with Singluarity only, and strictly in the domain of HPC, so
- could anyone advise is something alike maybe easier to accomplish with
Docker?

John Hearns

unread,
Aug 2, 2018, 3:55:28 AM8/2/18
to singu...@lbl.gov
Perhaps a stupid observation from me...
You will have to use something like VNC.
If you have multiple users on the same physical system, then how do you identify the keyboards and mice?
An X server expects there to be physically connected keyboards and mice. So how do you cope with multiple users?
But really.. VNC seems the way to go here.

If I have misunderstood what you are trying to achieve then I apologise.










Crni

unread,
Aug 2, 2018, 8:38:22 AM8/2/18
to singularity
In my case, it's always about single user, sitting at given machine.

It's simply just about to avoid multi-boot, or using VirtualBox/VMware.  For example, let's say that CentOS is installed on given machine, but that from time to time, one would like to use openSUSE, or Ubuntu.  Obviously, one could mess with partitioning, boot manager etc. and install all three together - the disadvantage is complicated setup.  The second option is to install for example VirtualBox, and then install openSUSE and Ubuntu there - the disadvantage here is performance loss because of running within virtual machine.  So using containers seemed to me as an approach worth trying - it's the same reasoning that makes container so popular.  But the difference here is that I'd like to run full desktop environment in container.  With multi-boot, or virtual machine, it's obviously possible, but with containers, it seems that there are some issues...

Joana Chavez

unread,
Aug 2, 2018, 10:36:06 AM8/2/18
to singularity

Hi Chris, please find our GitHub projects related to documentation below, feel free to send us a PR on there, contributions are always appreciated.


Thanks,

Joana

Iv

unread,
Mar 19, 2020, 12:41:23 PM3/19/20
to singularity
Hello Chris,
I am also trying to get a VNC server running within a singularity container. I've spent the last few weeks working through various issues one by one. Currently, I'm on "Cannot establish any listening sockets". Since you claim to have gotten it working, would you be willing to share the procedure?
To unsubscribe from this group and stop receiving emails from it, send an email to singu...@lbl.gov.
Reply all
Reply to author
Forward
0 new messages