Regman
Regman

Reputation: 21

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 :

Upvotes: 0

Views: 3021

Answers (2)

Peter V. Mørch
Peter V. Mørch

Reputation: 15947

One way to do it is to run a VNC server along with the GUI application you're interested in inside a container like you list as your last option. Then you can connect to it with VNC. (Or with HTTP(S) if you also install noVNC). kasmweb/chrome is one such option (http only, no VNC exposed). It even has a demo so you can easily try it out.

One problem you're likely going to run into at some point is that Ubuntu is moving towards having all the interesting GUI applications run in snaps. And snaps don't work well under docker. This is what my question How to safely and easily run snap-based applications in Ubuntu under docker? is about. If you're happy to run debian-based containers instead of ubuntu-based containers, this is perhaps less of a problem.

Upvotes: 0

Regman
Regman

Reputation: 21

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.

Upvotes: 2

Related Questions