Linux - ContainersThis forum is for the discussion of all topics relating to Linux containers. Docker, LXC, LXD, runC, containerd, CoreOS, Kubernetes, Mesos, rkt, and all other Linux container platforms are welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
So let's imagine a working installed Linux operating system. It has docker. It has no x-windows, no gui at all. Right: now get and put in a container for docker that has x-windows. Do I now have x-windows running?
Generally, I would recommend that any application that is running within a container should never try to avail itself of any host services that are not "by definition, universal."
"X-Windows" cannot be called "universal," because "there is only one of you!"
So let's imagine a working installed Linux operating system. It has docker. It has no x-windows, no gui at all. Right: now get and put in a container for docker that has x-windows. Do I now have x-windows running?
Technically, you don't have x running.
What do you think docker is?
This creates a container called "mycontainer". Then, it runs a "apt updat" inside the container, then, it installs "x11-apps" which includes the "xclock" app.
You then need to be able to SSH into "mycontainer".
This means that you need to place your SSH public key in the account "ubuntu" (/home/ubuntu/.ssh/authorized_keys) in the container.
Here is how to do this:
Technically, you don't have x running.
What do you think docker is?
Well, I must confess some confusion as to what docker is. By asking highly specific, carefully thought out ahead of time, questions I hope to build up a view of what docker actually does.
I've been researching as best as I can, but admit to a sort of conceptual block. It's the sort of thing that would be most likely resolved by actually running docker, but I've not been able to get docker working. D'oh! But that's beyond (and thus off-topic from) the (high specific) focus of this thread.
the problem is not the GUI itself, but the communication with other apps (like X server), using message bus (dbus daemon) and sockets (/tmp/.X11-unix/X0) which may or may not available from the container. And obviously you can have authentication related issues too.
Is this something that only LXD can do, and not the other container methods?
The "ssh -X" method can be used with any Linux server that has the X11 libraries, including containers.
The instructions that I gave above, are suitable for LXD.
It is also possible to run accelerated graphics by sharing the X11 devices to the container.
I am not sure how this would be configured with docker.
The accelerated graphics are required when playing games or running other graphics-intensive apps.
there are a lot of different approaches, yes, and actually I have no idea what is the real goal (by OP).
X itself is a client-server app pair, and also there are GUI apps which will run and use that X server (not to speak about the daemons/services used by X). And at this moment I don't know which are supposed to run inside the docker and which parts should run "elsewhere".
By default/design docker is a "closed" container which means it is used to run something inside in a separated environment. Running X that way goes against this concept.
It's possible to ran gui apps like chromium, libreoffice and a xorg server or desktop in separated containers. You need to share a DISPLAY env variable and some sockets (xorg) to get it running.
There is also a playonlinux image available to play games with wine.
It's possible to run a desktop from simple docker optimized and minimal os (minimal console with docker installed) like RancherOS or Linuxkit.
Because it's my first post I can't post links, so just seach for "github jessfraz dockerfiles" and "joriss playonlinux" for examples.
It's possible to run dbus, but you have to share the dbus policy files from applications with the dbus daemon container. But most applications running without dbus daemon
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.