x11docker: Can't run x11docker within script.

Trying to run x11docker from within a script, however, xorg refuses to run. Error is as follows:

x11docker ERROR: Error during startup of X server --xorg.
  Last lines of xinit log:

/usr/lib/xorg/Xorg.wrap: Only console users are allowed to run the X server



  Type 'x11docker --help' for usage information
  Debug options: '--verbose' (full log) or '--debug' (log excerpt).
  Logfile will be: /home/hosh/.cache/x11docker/x11docker.log
  Please report issues at https://github.com/mviereck/x11docker

sed: -e expression #1, char 16: Invalid collation character
Error: Can't open display: :100

Trying to run it simply using:

#!/usr/bin/env bash

set -exo pipefail
x11docker --gpu --homedir "/tmp/kodi/home" -- --volume /tmp/kodi/media:/media:ro -- erichough/kodi &>/tmp/kodi.log &
sleep 20
echo "it's running!"

Have had this issue previously while doing something else, but was unable to fix it. Any ideas how I can get this running?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Thank you for your tests! The latest release v6.2.0 includes the fixes for this ticket. --enforce-i is part of this release. However, it seems it will be needed for rare edge cases like in #166 now.

Works!

Re -S, I guess you could simply check $- to see if the relevant options are there, and rerun bash using correct options if they’re not. Something like:

if [[ "$-" != *"i"* || "$-" != *"H"* ]]; then
	/usr/bin/env bash -i +H "$0" "$@"
	exit $?
fi

I’m not sure if i and H are the correct options since I can’t test against /usr/bin/env -S.