Xpra: Ticket #2647: Detecting or setting up MIT-SHM

Coming from #2610

I found no way to allow memory sharing for MIT-SHM only. Docker only allows to share the entire IPC namespace/shared memory for all applications (Docker option --ipc=host).

That's a real shame! As per ​Understanding the Linux Virtual Memory Manager: The filesystem comes in two variations called shm and tmpfs. They both share core functionality and mainly differ in what they are used for. shm is for use by the kernel for creating file backings for anonymous pages and for backing regions created by shmget(). We need shmget for xshm, so mounting a tmpfs may not be enough. I have not tried it.

So far I did not even found a hint where to look for MIT-SHM in the system.I would assume that lsipc -m should show it, but it does not. If you can give me some hints where to look for the memory area or maybe even providing one to Xvfb and/or Xdummy, I might find a solution how to share it with a Docker container.

Ideally it would have a representation in the file system like e.g. /dev/shm/MIT-SHM.X20. It is easy to share files with a Docker container.

Wed, 18 Mar 2020 08:47:26 GMT - Antoine Martin: status, description, milestone changed

Sat, 09 May 2020 05:16:47 GMT - Antoine Martin: owner, priority, status changed

Xpra's xshm bindings can be found here: browser/xpra/trunk/src/xpra/x11/bindings/ximage.pyx, we use:

So I don't see any way of telling X11 or xpra about different IPC locations / namespaces.

docker.com : ipc-settings:

Maybe create a new namespace on the host, start Xvfb there, then use host to share this IPC namespace with the container? Will this work? (or maybe it will share the host's main IPC namespace?) Or maybe container can be overloaded to point to the newly created namespace? If not, can you somehow inject nsexec in the docker command to join the IPC namespace created earlier?


@mviereck: any of this make sense to you?

Sat, 13 Jun 2020 06:55:52 GMT - Antoine Martin: status changed; resolution set

Not heard back, closing.

Sat, 13 Jun 2020 07:51:05 GMT - mviereck:

Not heard back, closing.

Ups, sorry!!

Much thanks for your ideas and suggestions! I had a look at this some time ago and it gives me some good attempts.

​nsexec: Join a namespace and execute a command in the namespace

This one looks quite promising. With command nsenter I get he functionality of nsexec. It might work to open an IPC namespace with Docker and to share it with Xvfb as well as with the container.

It will take some time until I try this out because I have some other projects first.

Sat, 23 Jan 2021 05:57:00 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/2647