I got some sort of working solution now - unfortunately it seems to be highly unstable (see below for further information on this):
How it (sort of) works as of now:
- After the user made their choice, Tins creates a new container given the selected criteria and applies the generic X11 and the specific Desktop Environment profile (e.g: for X11 this, and for GNOME this one)
- The container creation process of LXD downloads the latest available, matching image from images.linuxcontainers.org (e.g.:
images:ubuntu/bionic/cloud) - The desktop specific profile provides a
cloud-initscript, so this gets executed upon container start which downloads, installs and configures the desktop environment (e.g.: for GNOME this one). - If the user wants to open a desktop enabled container,
Xephyris started at an available$DISPLAYnumber - In the container
systemctl start display-manageris executed and LightDM forwards its output toXephyr
… overall it seems we have to be rather lucky if everything goes well. Which leads me to the problems I encounter:
Problems with this approach:
- The images from images.linuxcontainers.org seem to be highly unstable. Sometimes networking does not work, at other times apt is broken, etc…
-
cloud-inittakes very long to complete the initial setup because it needs to download all desktop packages -
cloud-initoften fails to install the needed packages due to various reasons (e.g. failed to unpack package, connectivity issues, …) - I was not able to find a good way to monitor
cloud-init's progress and exit status - so as of now it is impossible to say when it is finished which leads to a bad user experience -
Xephyrruns completely independent from Tins so its just fire and forget - hoping everything goes well
Any help to mitigate these issues and/or improve the overall process would be highly appreciated
I’m also wondering if it is possible to build and publish out-of-the-box, desktop environment enabled images to images.linuxcontainers.org (or some other public mirror)? This would save a ton of bandwith, and would probably dramatically improve the success rate of setting such a container up.
In case you want to experiment yourself
Feel free to clone the project from GitHub, as of now Ubuntu Focal and Ubuntu Bionic are the only two Desktop Environment enriched Distro flavours.