Skip to content

Display manager entry for x11docker

mviereck edited this page Jul 3, 2019 · 3 revisions

Display manager entry for x11docker

It is possible to run x11docker immediatly from display managers like lightdm or sddm. Different setups are possible.

Note: Entries for display managers can be stored at two different locations:

  • /usr/share/xsessions: For entries in this folder the display manager will provide an X server.
  • /usr/share/wayland-sessions: Entries in this folder have to set up the X server or wayland compositor on themselves.

Setup with option --xorg

This is the recommended setup.

  • Create a file in /usr/share/wayland-sessions, e.g. /usr/share/wayland-sessions/x11docker-xfce with this content:
    [Desktop Entry]
    Name=x11docker/xfce (--xorg)
    Comment=Xfce in docker image
    Exec=/usr/local/bin/x11docker-xfce-xorg
    Terminal=false
    Type=Application
    
  • Create a file /usr/local/bin/x11docker-xfce-xorg and make it executeable with chmod +x:
    #! /bin/bash
    x11docker --xorg --desktop --gpu --vt=7 x11docker/xfce
    
    Note: It makes sense to specify the desired tty/vt with --vt=7 or another vt number. You can switch between different ttys with CTRL+SHIFT+F1..F12.
  • Allow unprivileged users to run Xorg.

Setup with option --hostdisplay

This setup is discouraged because it degrades container isolation due to limitations of option --hostdisplay.

  • Create a file in /usr/share/xsessions, e.g. /usr/share/xsessions/x11docker-xfce with this content:
    [Desktop Entry]
    Name=x11docker/xfce (--hostdisplay)
    Comment=Xfce in docker image
    Exec=/usr/local/bin/x11docker-xfce-hostdisplay
    Terminal=false
    Type=Application
    
  • Create a file /usr/local/bin/x11docker-xfce-hostdisplay and make it executeable with chmod +x:
    #! /bin/bash
    x11docker --hostdisplay --gpu x11docker/xfce
    
Clone this wiki locally