Kodi in LXC containers

I had a closer look to all this, and especially the docker-headless repository.

What I found is that Kodi does not come officially with a --headless parameter.
The docker-headless script adds a patch for a --headless parameter and then compiles from scratch all of Kodi. There must be some background as to why Kodi does not include this elemental patch for a --headless parameter.

Here are a few ways forward.

  1. Adapt the docker-headless script to apply the patch and recompile Kodi from source in order to have a --headless parameter. This would work fine, and it would be the solution if the two following are not viable.
  2. Set up X2Go on the server so that Kodi runs with a GUI. Then, you can configure Kodi through the GUI. Note that there will be no graphics acceleration, therefore you would only be able to use the menus, not play videos. There is a pending guide on X2Go that should come out shortly (@bmullan, would Kodi work with X2Go?)
  3. Create a snap package of Kodi, one that has the --headless option built-in. There is already a beta package for Kodi, and can be installed according to the instructions at http://www.omgubuntu.co.uk/2017/05/kodi-popular-media-center-now-available-snap-app Using the same snap configuration, it would be easy to generate a variant that has the --headless patch (snapcraft.yaml).

I think the snap package (option 3) would be the easier to do. It would require to take the snapcraft.yaml, remove anything that is graphics related, add the patch for --headless and that’s it. See https://forum.snapcraft.io/t/kodi-snap-call-for-testing/838/11 for more on this.