[winswitch] Running XPRA with headless GPU in docker container displaying via HTML5 client

Antoine Martin antoine at nagafix.co.uk
Wed Oct 30 17:10:44 GMT 2019


On 30/10/2019 23:14, Florian Feldhaus via shifter-users wrote:
> I have started creating a generic XPRA docker image which can be used to
> run any application and display it via the HTML5 client. It is in an early
> stage, but will likely become the basis of the popular Wireshark image and
> some other images I plan to create. You can find the current status here:
> https://cloud.docker.com/repository/docker/ffeldhaus/docker-xpra-html5
> and the source here
> http://github.com/ffeldhaus/docker-xpra-html5
There are a number of projects doing similar things.
For example, you may want to look at:
https://github.com/mviereck/x11docker

> Now I'm trying to enable the container to use a GPU for OpenGL
> applications. That seems to be nearly impossible, at least if XPRA runs
> inside the container. I found a lot of examples which show how to run a
> container with headless GPUs and X11 including this one from NVIDIA:
> https://gitlab.com/nvidia/container-images/samples/blob/master/opengl/ubuntu16.04/turbovnc-virtualgl/Dockerfile
x11docker does support it:
https://github.com/mviereck/x11docker#gpu-hardware-acceleration

> But it seems that for all examples I found an X-Server in the Docker host
> is used (like in the example above).
AFAIAA, that's currently unavoidable.

> Here's my current take on it. This is the preparation (installation etc):
> https://github.com/ffeldhaus/docker-xpra-html5-opengl/blob/master/Dockerfile
> 
> This is how the xorg config gets created with nvidia-xconfig and how xpra
> is started:
> https://github.com/ffeldhaus/docker-xpra-html5-opengl/blob/master/docker-entrypoint.sh
> 
> I'm currently stuck with the following error but do not think this is the
> real issue:
> parse_vt_settings: Cannot open /dev/tty0 (No such file or directory)
Not sure what's going on there. Ubuntu is known to apply Xorg patches
that cause such problems.
Or maybe Xdummy is finding the wrong Xorg binary.
https://xpra.org/trac/wiki/Xdummy
You may want to just switch to Xvfb instead of Xdummy.

> As the docker container is running non-interactively, it does not have a
> tty0. Is this even possible or any idea how to make this work without X11
> in the docker host?
> 
> Here's the full output:
(snip)

Cheers,
Antoine



More information about the shifter-users mailing list