dockerserverdesktopheadlessx11-forwarding

Is it possible to run a docker container embedding a GUI environment on a GUI-less server and open the GUI session from a remote GUI client?


I have a GUI-less server (fresh Debian without any desktop environment or Ubuntu server, without X server, a priori). I consider to install docker and pull an official Ubuntu based container and add a desktop environment on it in order to use regular GUI apps.

I have a second computer in the LAN with a regular Debian Xfce or Xubuntu.

Is it possible to use this second computer to open the desktop session of the container (which is run on the GUI-less server) ? (I would like to use standard Debian or Ubuntu packages as much as possible and avoid to use external PPA packages)

Small state of the art :


Solution

  • I found this docker image which solves my question : docker-x2go-xubuntu : https://hub.docker.com/r/paimpozhil/docker-x2go-xubuntu

    I built it on the GUI-less server and ran it as explained on docker hub.

    On my second computer I opened an ssh tunnel to the GUIless server pointing to the docker interface :

    ssh -CY -L 33333:container.docker.ip:2222 -l guilessuserlogin guiless.server.ip
    

    (I retrieved the container IP by ifconfig on the GUIless server)

    On this second computer I installed x2goclient from the regular repositories and configured a session to connect to localhost:33333

    Once connected, the GUI desktop of the docker machine is completely available.