If you want to have a GUI inside your Container there are multiple methods to achieve this.
Factors to consider include:
- GPU acceleration (needed for demanding applications such as Games, Editing-, Rendering programs etc.)
- Security (in terms of seperation between Host and Container)
Methods:
With GPU acceleration:
- Use the Host’s Wayland/XWayland Server: [Howto] Use the Host's Wayland and XWayland Servers inside containers
This is also usable for X-Server users, because some Wayland compositors (e.g. weston) can run on an X-Server (in a seperate window, so you can simply continue using the X-Server) and withXWayland
you also have compatibility for legacy X-Server applications inside Wayland.
Regarding Security: More secure because of the way Wayland works. - Use the Host’s X-Server: Described in simos blog: Running X11 software in LXD containers – Mi blog lah!
Regarding Security: Insecure because of the way X-Server works.
Consider using the Wayland method above, which also works on X-Servers.
Without GPU acceleration:
- Use X2Go (especially useful for remote desktops): How to use the X2Go remote desktop with LXD containers – Mi blog lah!
Regarding Security: More secure because it runs seperate from the Host’s X-Server.
More Methods:
- Overview by simos: Discussion on running X11 applications from within LXD system containers – Mi blog lah!
-
Overview in X11docker github repo by mviereck: X server and Wayland Options · mviereck/x11docker Wiki · GitHub
These might be transferable to LXD.
See also:
-
Might be of interest:
Audio (via Pulseaudio) inside Container