Discussion:
[winswitch] Xpra - Docker - Assistance request
Ali Sadat via shifter-users
2017-01-08 00:53:05 UTC
Permalink
Hi,


I appreciate if you could assist me with the following question regarding
use of xpra inside Docker containers.

As a part of one of my projects, I have to use xpra inside runc\docker
containers to access GUI apps. (I understand this is not the best practice)

Xpra works perfectly inside containers, until I have to checkpoint and
restore the container. It seems CRIU does not like the concept of
unix-sockets inside containers and requires special IPC to be created
between processes. I tried to follow the instructions provided by CRIU for
VNC in link below. However, could not get xpra to work.

https://criu.org/VNC

Tried other approaches too eg: SSH, TCP and... to avoid use of Display
sockets, but there was not much success there either.

I am really stuck !!! and I am just wondering if you can help me with this
or point me toward the right direction.

Is there any way to create an IPC been xpra and application inside
container ? or exit xpra session before checkpoint and reconnect to exit-ed
session after restore ? or...

Thanks

Ali
Antoine Martin via shifter-users
2017-01-08 07:19:59 UTC
Permalink
Post by Ali Sadat via shifter-users
Hi,
I appreciate if you could assist me with the following question regarding
use of xpra inside Docker containers.
As a part of one of my projects, I have to use xpra inside runc\docker
containers to access GUI apps. (I understand this is not the best practice)
What makes you think that this is not "the best practice"?
Post by Ali Sadat via shifter-users
Xpra works perfectly inside containers, until I have to checkpoint and
restore the container. It seems CRIU does not like the concept of
unix-sockets inside containers and requires special IPC to be created
between processes.
Then I'm not sure how you expect the X11 client applications to survive
the checkpoint and restore. And this would affect VNC the same way.
All X11 applications usually connect to the X11 server using unix domain
sockets (see /tmp/.X11-unix/. You could try switching them to TCP
sockets if that is better supported by the checkpoint code.
Post by Ali Sadat via shifter-users
I tried to follow the instructions provided by CRIU for
VNC in link below. However, could not get xpra to work.
Please always try to provide details and in particular the specific
errors you encounter. "does not work" is not it.
Post by Ali Sadat via shifter-users
https://criu.org/VNC
This seems to be using regular displays with unix domain sockets.
So you will really need to clarify the problem(s) you encounter, and the
CRIU issues, if any, with the sockets.
Post by Ali Sadat via shifter-users
Tried other approaches too eg: SSH, TCP and... to avoid use of Display
sockets, but there was not much success there either.
Xpra is a client of the X11 server (Xdummy or Xvfb), so it will also
connect using unix domain sockets.
Post by Ali Sadat via shifter-users
I am really stuck !!! and I am just wondering if you can help me with this
or point me toward the right direction.
If it helps to use TCP sockets instead of unix domain sockets, then you
can try versions newer than this changeset:
https://xpra.org/trac/changeset/14729

And connect xpra to the X11 server using TCP.
Something like this (here for Fedora 25):

/usr/libexec/Xorg -noreset \
-nolisten unix -listen tcp \
+extension GLX +extension RANDR +extension RENDER \
-logfile /run/user/1000/xpra/Xorg.100.log \
-configdir /home/antoine/.xpra/xorg.conf.d \
-config /etc/xpra/xorg.conf :100 &
xpra start \
--bind=none --bind-tcp=0.0.0.0: \
--no-daemon --start=xterm \
--use-display 127.0.0.1:100
Post by Ali Sadat via shifter-users
Is there any way to create an IPC been xpra and application inside
container ?
Not sure what you mean.
Post by Ali Sadat via shifter-users
or exit xpra session before checkpoint and reconnect to exit-ed
session after restore ? or...
I don't see why that wouldn't work.

Cheers
Antoine
Post by Ali Sadat via shifter-users
Thanks
Ali
_______________________________________________
shifter-users mailing list
http://lists.devloop.org.uk/mailman/listinfo/shifter-users
Timothy Hobbs via shifter-users
2017-01-08 10:15:54 UTC
Permalink
Hello,

I'm the author of a project called subuser.org which helps users install
and use GUI applications in Docker. We use XPRA, but we don't do CRIU
and don't plan on it either.

In my experience, there using XPRA with containers isn't bad practice,
I'm not sure where you heard that from. It works quite well actually.

In order to securely provide access to the X11 server, I have subuser
set up to use a 3 container per application approach which is described
here http://subuser.org/news/0.3.html#the-xpra-x11-bridge .

I presume you currently have it set up so that the XPRA server runs in
the same container as the GUI application? Is your trouble then that the
UNIX sockets INSIDE the container don't work? Aka the applications
connection to the xpra server via the /tmp/.X11-unix socket?

Or is the trouble with the socket that connects the xpra server to the
xpra client? If you're running into the former case then I think you
have no hope of using CRIU for anything usefull untill such a severe bug
is fixed :(. If it is the later, then I think we might be able to find
some workarounds, such as detaching the xpra client before freezing and
then reattaching it afterwards.
Post by Ali Sadat via shifter-users
Hi,
I appreciate if you could assist me with the following question regarding
use of xpra inside Docker containers.
As a part of one of my projects, I have to use xpra inside runc\docker
containers to access GUI apps. (I understand this is not the best practice)
Xpra works perfectly inside containers, until I have to checkpoint and
restore the container. It seems CRIU does not like the concept of
unix-sockets inside containers and requires special IPC to be created
between processes. I tried to follow the instructions provided by CRIU for
VNC in link below. However, could not get xpra to work.
https://criu.org/VNC
Tried other approaches too eg: SSH, TCP and... to avoid use of Display
sockets, but there was not much success there either.
I am really stuck !!! and I am just wondering if you can help me with this
or point me toward the right direction.
Is there any way to create an IPC been xpra and application inside
container ? or exit xpra session before checkpoint and reconnect to exit-ed
session after restore ? or...
Thanks
Ali
_______________________________________________
shifter-users mailing list
http://lists.devloop.org.uk/mailman/listinfo/shifter-users
Loading...