Johntron
Johntron

Reputation: 2663

Run GUI apps via Docker without XQuartz or VNC

As an evolution on can you run GUI apps in a docker container, is it possible to run GUI applications via Docker without other tools like VNC or X11/XQuartz?

In VirtualBox, you could pass the --type gui to launch a headed VM, and this doesn't require installing any additional software. Is anything like that possible via Dockerfile or CLI arguments?

Upvotes: 1

Views: 567

Answers (2)

Brijesh Sondarva
Brijesh Sondarva

Reputation: 213

You could try the following which is worked in my case.

Check the Local machine display and its authentication

[root@localhost ~]# echo $DISPLAY
[root@localhost ~]# xauth list $DISPLAY 
localhost:15  MIT-MAGIC-COOKIE-1  cc2764a7313f243a95c22fe21f67d7b1

Copy the above authentication and join your existing container, and add the display autherntication.

[root@apollo-server ~]# docker exec -it -e DISPLAY=$DISPLAY 3a19ab367e79 bash

root@3a19ab367e79:/# xauth add 192.168.10.10:15.0  MIT-MAGIC-COOKIE-1  cc2764a7313f243a95c22fe21f67d7b1
root@3a19ab367e79:/# firefox

Upvotes: 0

Matt
Matt

Reputation: 74791

Docker doesn't provide a virtual video device and a place to render that video content in a window like a VM does.

It might be possible to run a container with --privileged and write to the Docker hosts video devices. That would possibly require a second video card that's not in use. The software that Docker runs in the container would also need to support that video device and be able write directly to it or a frame buffer. This limits what could run in the container to something like an X server or Wayland that draws a display to a device.

Upvotes: 1

Related Questions