Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed in starting with --weston-xwayland #19

Closed
netsgnut opened this issue Dec 10, 2017 · 7 comments
Closed

Failed in starting with --weston-xwayland #19

netsgnut opened this issue Dec 10, 2017 · 7 comments
Labels

Comments

@netsgnut
Copy link

Hi,

Thanks for the x11docker project! On my Ubuntu 17.10 box that is running on Wayland session, I have got errors with the flag --weston-xwayland. --xephyr seems to run fine.

Have run with --verbose and got the following as the resulting log. Do you have any ideas/pointers on what could be the culprit? Thanks.

x11docker: Sun Dec 10 07:06:21 GMT 2017 Ubuntu 17.10 
Command: /opt/x11docker/x11docker --weston-xwayland --desktop --gpu --  x11docker/mate 
Parsed options:  --weston-xwayland --desktop --gpu -- '' 'x11docker/mate '

x11docker WARNING: Option --gpu degrades container isolation.
  Container gains access to GPU hardware.
  This allows reading host window content (palinopsia leak)
  and GPU rootkits (compare proof of concept: jellyfish).

x11docker note: Hardware acceleration (option --gpu) works quite well with open
  source drivers (radeon, nouveau, intel ...) on host and OpenGL/MESA in image.
  If you have closed source drivers on your host, you need to install
  the very same driver version in your image to get hardware acceleration.

x11docker: Host system: ubuntu

x11docker: X or Wayland server option: --weston-xwayland

x11docker: Virtual screen size: 1820x980

x11docker: Real screen size: Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192

x11docker: Environment variables: 
  DISPLAY=:250 XAUTHORITY=/home/user/.cache/x11docker/X250-x11docker-mate/share/Xclientcookie XSOCKET=/tmp/.X11-unix/X250 XPRA_XSHM=0 X11DOCKER_CACHE=/home/user/.cache/x11docker/X250-x11docker-mate 

x11docker: Image name: x11docker/mate

x11docker: Image command: 

x11docker: Users and terminal:
  x11docker was started by: user
  As host user serves (running X, storing cache): user
  Container user will be:   user
  Container user password:  x11docker
  Getting permission to run docker with: bash -c 
  Running X and other user commands with: bash -c
  Terminal for password frontend: bash -c
  Terminal to show docker pull progress: xterm -e
  Running on console: no

x11docker: Current cache folder: /home/user/.cache/x11docker/X250-x11docker-mate

x11docker: Created X server command:
  /usr/bin/Xwayland :250 \
  -nolisten tcp -dpms -retro \
  +extension Composite +extension RANDR +extension RENDER +extension GLX +iglx \
  +extension XVideo +extension DOUBLE-BUFFER \
  -extension X-Resource +extension SECURITY +extension DAMAGE \
  -extension XINERAMA -xinerama -extension MIT-SHM \
  -auth /home/user/.cache/x11docker/X250-x11docker-mate/Xservercookie -dpi 96

x11docker: Created compositor command:
  weston --socket=wayland-250 --config='/home/user/.cache/x11docker/X250-x11docker-mate/weston.ini' --backend=wayland-backend.so

x11docker: Created docker command:
  docker run --rm --name=x11docker_X250_fc50a7_x11docker_mate \
  --cap-drop=ALL \
  --security-opt=no-new-privileges \
  --init \
  --user 1000:1000 --env USER=user --group-add video \
  -v /home/user/.cache/x11docker/X250-x11docker-mate/passwd:/etc/passwd:ro \
  -v /home/user/.cache/x11docker/X250-x11docker-mate/shadow:/etc/shadow:ro \
  --read-only \
  --tmpfs /tmp --tmpfs /run --tmpfs /var/tmp \
  --entrypoint=env \
  -v /home/user/.cache/x11docker/X250-x11docker-mate/share:/x11docker:rw \
  -v /tmp/.X11-unix/X250:/x11docker/X250:rw \
  --device=/dev/dri:/dev/dri:rw \
    --  x11docker/mate /bin/sh /x11docker/x11docker.CMD.sh

x11docker: IP of docker interface: 172.17.0.1/16

x11docker: Created dockerrc:
     1	#! /bin/bash
     2	verbose () 
     3	{ 
     4	    [ -e "$Logfile" ] && echo "x11docker: $*
     5	" >> "$Logfile";
     6	    return 0
     7	}
     8	waitforfilecreation () 
     9	{ 
    10	    local Zeit Warten;
    11	    Zeit=$(date +%s);
    12	    verbose "Waiting for file creation of ${1:-}";
    13	    case $2 in 
    14	        "")
    15	            Warten=15
    16	        ;;
    17	        infinity | inf)
    18	            Warten=32000
    19	        ;;
    20	        *)
    21	            Warten=${2:-}
    22	        ;;
    23	    esac;
    24	    while [ ! "$(find  "${1:-}" 2>/dev/null)" ]; do
    25	        sleep 0.2;
    26	        [ $Warten -lt $(expr $(date +%s) - $Zeit) ] && return 1;
    27	        [ -e "$Timetosaygoodbye" ] && return 1;
    28	    done;
    29	    verbose "Found newly created file ${1:-}";
    30	    return 0
    31	}
    32	waitforfilecontent () 
    33	{ 
    34	    local Zeit;
    35	    Zeit=$(date +%s);
    36	    verbose "Waiting for file content in ${1:-}";
    37	    while [ ! -s "${1:-}" ]; do
    38	        sleep 0.1;
    39	        [ 15 -lt $(expr $(date +%s) - $Zeit) ] && return 1;
    40	        [ -e "$Timetosaygoodbye" ] && return 1;
    41	    done;
    42	    verbose "Found file content in ${1:-}";
    43	    return 0
    44	}
    45	Imagename='x11docker/mate'
    46	Imagecommand=''
    47	# check if image is available locally
    48	docker inspect --type=image x11docker/mate > /dev/null 2>&1 || {
    49	  xterm -e /bin/bash /home/user/.cache/x11docker/X250-x11docker-mate/pullrc
    50	  waitforfilecreation /home/user/.cache/x11docker/X250-x11docker-mate/pullready
    51	  docker inspect --type=image x11docker/mate > /dev/null 2>&1 || {
    52	    echo ''
    53	    echo "ERROR: Image 'x11docker/mate' not found locally and not pulled from docker hub. " >&2
    54	    exit 1
    55	  }
    56	}
    57	# check CMD
    58	[ -z "$Imagecommand" ] && {
    59	  # extract image command from image if not given on cli
    60	  Imagecommand=$(docker inspect --format='{{.Config.Cmd}}' x11docker/mate)
    61	  Imagecommand=${Imagecommand#[}
    62	  Imagecommand=${Imagecommand#/bin/sh -c }
    63	  Imagecommand=${Imagecommand%]}
    64	}
    65	# check ENTRYPOINT
    66	Entrypoint=$(docker inspect --format='{{.Config.Entrypoint}}' x11docker/mate)
    67	Entrypoint=${Entrypoint#[}
    68	Entrypoint=${Entrypoint#/bin/sh -c }
    69	Entrypoint=${Entrypoint%]}
    70	[ -z "$Imagecommand$Entrypoint" ] && echo 'x11docker WARNING: No image command specified and no CMD or ENTRYPOINT found in image.'|tee -a /tmp/x11docker.fc50a7.log
    71	Dbus=''
    72	
    73	# create x11docker.CMD.sh (shared with container and given as image command on docker run)
    74	{ echo '#! /bin/sh'
    75	  echo '# created startscript for docker run: x11docker.CMD.sh'
    76	  echo Imagecommand="\"$Imagecommand\""
    77	  echo Entrypoint="\"$Entrypoint\""
    78	  echo ''
    79	  echo export USER=user
    80	  echo export HOME="\"/tmp/fakehome\""
    81	  echo 'mkdir -p  "$HOME" && cd "$HOME"'
    82	  echo 'touch "$HOME/.xinitrc" '
    83	  echo 'mkdir -p /tmp/.ICE-unix'
    84	  echo ''
    85	  echo '# link X socket into right folder /tmp/.X11-unix.'
    86	  echo '# Was not directly shared to provide .X11-unix with rw-access. '
    87	  echo '# Needed for X created in container like with startplasmacompositor'
    88	  echo 'mkdir -p /tmp/.X11-unix'
    89	  [ -e '/tmp/.X11-unix/X250' ] && echo 'ln -s /x11docker/X250 /tmp/.X11-unix/X250'
    90	  echo 'export DISPLAY=:250'
    91	  echo 'export XAUTHORITY=/x11docker/Xclientcookie'
    92	  echo ''
    93	  echo '# xpra environment settings'
    94	  echo 'export UBUNTU_MENUPROXY= QT_X11_NO_NATIVE_MENUBAR=1 MWNOCAPTURE=true MWNO_RIT=true MWWM=allwm'
    95	  echo ''
    96	  echo '[ -e "$XDG_RUNTIME_DIR" ] || {'
    97	  echo '  # XDG_RUNTIME_DIR must be owned by user'
    98	  echo '  mkdir -p /tmp/XDG_RUNTIME_DIR'
    99	  echo '  export XDG_RUNTIME_DIR=/tmp/XDG_RUNTIME_DIR'
   100	  echo '}'
   101	  echo 'echo "x11docker: XDG_RUNTIME_DIR in container is $XDG_RUNTIME_DIR" >&2'
   102	  echo 'export XDG_SESSION_TYPE=x11'
   103	  echo ''
   104	  echo 'export SHELL=/bin/bash'
   105	  echo 'export TERM=xterm'
   106	  echo ''
   107	  echo 'cd "$HOME"'
   108	  echo ''
   109	  echo                "exec $Dbus $Entrypoint $Imagecommand >>/x11docker/stdout 2>>/x11docker/stderr"
   110	  echo '# Ready for docker run'
   111	} >> /home/user/.cache/x11docker/X250-x11docker-mate/share/x11docker.CMD.sh
   112	
   113	cat /home/user/.cache/x11docker/X250-x11docker-mate/share/x11docker.CMD.sh | nl -ba >> /home/user/.cache/x11docker/X250-x11docker-mate/docker.log
   114	
   115	nohup setsid docker run --rm --name=x11docker_X250_fc50a7_x11docker_mate \
   116	  --cap-drop=ALL \
   117	  --security-opt=no-new-privileges \
   118	  --init \
   119	  --user 1000:1000 --env USER=user --group-add video \
   120	  -v /home/user/.cache/x11docker/X250-x11docker-mate/passwd:/etc/passwd:ro \
   121	  -v /home/user/.cache/x11docker/X250-x11docker-mate/shadow:/etc/shadow:ro \
   122	  --read-only \
   123	  --tmpfs /tmp --tmpfs /run --tmpfs /var/tmp \
   124	  --entrypoint=env \
   125	  -v /home/user/.cache/x11docker/X250-x11docker-mate/share:/x11docker:rw \
   126	  -v /tmp/.X11-unix/X250:/x11docker/X250:rw \
   127	  --device=/dev/dri:/dev/dri:rw \
   128	    --  x11docker/mate /bin/sh /x11docker/x11docker.CMD.sh >>/home/user/.cache/x11docker/X250-x11docker-mate/docker.log 2>&1 & echo $! >> /home/user/.cache/x11docker/X250-x11docker-mate/docker.pid
   129	for Count in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do
   130	  sleep 0.1
   131	  docker exec x11docker_X250_fc50a7_x11docker_mate sh -c : && { verbose 'container x11docker_X250_fc50a7_x11docker_mate is ready' ; break ; } || verbose "container not ready on $Count. attempt, trying again" 
   132	done

x11docker: Created xtermrc:
     1	#! /bin/bash
     2	touchxtermready() {
     3	  bash -c 'touch /home/user/.cache/x11docker/X250-x11docker-mate/xtermready'
     4	}
     5	trap touchxtermready EXIT
     6	export TERM=xterm SHELL=/bin/bash
     7	bash -c "bash /home/user/.cache/x11docker/X250-x11docker-mate/dockerrc" >>/home/user/.cache/x11docker/X250-x11docker-mate/xterm.log 2>&1
     8	exit

x11docker: Created xinitrc:
     1	#! /bin/sh
     2	storepid () 
     3	{ 
     4	    echo ${1:-} ${2:-} >> $Bgpidfile;
     5	    verbose "stored background pid ${1:-} of ${2:-}"
     6	}
     7	mywatch () 
     8	{ 
     9	    env TERM=linux watch --interval 1 --chgexit --no-title -- "sh -c '${1:-}'" > /dev/null 2>&1
    10	}
    11	no_xhost () 
    12	{ 
    13	    local Line;
    14	    xhost;
    15	    xhost | tail -n +2 /dev/stdin | while read -r Line; do
    16	        xhost -$Line;
    17	    done;
    18	    xhost -;
    19	    [ "$(xhost | wc -l)" -gt "1" ] && { 
    20	        warning "Remaining xhost permissions found on display $DISPLAY
    21	$(xhost)";
    22	        return 1
    23	    };
    24	    return 0
    25	}
    26	warning () 
    27	{ 
    28	    echo "$(tput setaf 3)x11docker WARNING:$(tput sgr0) $*" 1>&3;
    29	    echo "" 1>&3;
    30	    [ -e "$Logfile" ] && echo "x11docker WARNING: $*
    31	" >> "$Logfile";
    32	    return 0
    33	}
    34	verbose () 
    35	{ 
    36	    [ -e "$Logfile" ] && echo "x11docker: $*
    37	" >> "$Logfile";
    38	    return 0
    39	}
    40	note () 
    41	{ 
    42	    echo "$(tput setaf 2)x11docker note:$(tput sgr0) $*" 1>&3;
    43	    echo "" 1>&3;
    44	    [ -e "$Logfile" ] && echo "x11docker note: $*
    45	" >> "$Logfile";
    46	    return 0
    47	}
    48	Bgpidfile=/home/user/.cache/x11docker/X250-x11docker-mate/backgroundpids
    49	export Hostxenv='DISPLAY=:0 XAUTHORITY= XSOCKET=/tmp/.X11-unix/X0 WAYLAND_DISPLAY=wayland-0 XDG_RUNTIME_DIR=/run/user/1000'
    50	export Newxenv='DISPLAY=:250 XAUTHORITY=/home/user/.cache/x11docker/X250-x11docker-mate/share/Xclientcookie XSOCKET=/tmp/.X11-unix/X250 XPRA_XSHM=0 X11DOCKER_CACHE=/home/user/.cache/x11docker/X250-x11docker-mate '
    51	# set X variables to new display
    52	# create new XAUTHORITY cookies
    53	:> /home/user/.cache/x11docker/X250-x11docker-mate/share/Xclientcookie
    54	xauth -v -f /home/user/.cache/x11docker/X250-x11docker-mate/share/Xclientcookie generate :250 . trusted timeout 3600
    55	[ -s '/home/user/.cache/x11docker/X250-x11docker-mate/share/Xclientcookie' ] || { 
    56	  [ 'trusted' = 'untrusted' ] && note 'Could not create untrusted cookie. 
    57	  Maybe your X server misses extension SECURITY.'
    58	}
    59	[ -s '/home/user/.cache/x11docker/X250-x11docker-mate/share/Xclientcookie' ] || { 
    60	  # still no cookie? try to create one without extension security
    61	  xauth -f /home/user/.cache/x11docker/X250-x11docker-mate/share/Xclientcookie add :250 . 3f50694958c70662ebb6dae1c7e3915e
    62	}
    63	# create prepared cookie with localhost identification disabled by ffff, needed if X socket is shared. ffff means 'familiy wild'
    64	Cookie=$(xauth -f /home/user/.cache/x11docker/X250-x11docker-mate/share/Xclientcookie nlist | sed -e 's/^..../ffff/')
    65	echo $Cookie | xauth -v -f /home/user/.cache/x11docker/X250-x11docker-mate/share/Xclientcookie nmerge -
    66	cp /home/user/.cache/x11docker/X250-x11docker-mate/share/Xclientcookie /home/user/.cache/x11docker/X250-x11docker-mate/Xservercookie
    67	[ -s '/home/user/.cache/x11docker/X250-x11docker-mate/share/Xclientcookie' ] || warning 'Cookie creation failed! --weston-xwayland runs without cookie authentication.'
    68	export $Newxenv
    69	verbose "Created cookie: $(xauth list)"
    70	verbose 'disabling any possible access to new X server possibly granted by xhost'
    71	no_xhost
    72	export $Newxenv
    73	getscreensize() {
    74	  CurrentXaxis=$(xrandr | grep primary | cut -d' ' -f4 | cut -dx -f1 )
    75	  CurrentYaxis=$(xrandr | grep primary | cut -d' ' -f4 | cut -dx -f2 | cut -d+ -f1)
    76	}
    77	checkscreensize() {
    78	  getscreensize
    79	  [ "$Xaxis" = "$CurrentXaxis" ] || return 1
    80	  [ "$Yaxis" = "$CurrentYaxis" ] || return 1
    81	  return 0
    82	}
    83	getprimary() {
    84	  xrandr | grep -q primary || xrandr --output $(xrandr | grep ' connected' | head -n1 | cut -d' ' -f1) --primary
    85	  echo $(xrandr | grep primary | cut -d' ' -f1)
    86	}
    87	Output=$(getprimary)
    88	verbose "Output of xrandr on :250
    89	$(xrandr)"
    90	touch /home/user/.cache/x11docker/X250-x11docker-mate/Xready
    91	mywatch 'ls /home/user/.cache/x11docker/X250-x11docker-mate/share/timetosaygoodbye'

x11docker: Created weston.ini:
     1	
     2	[core]
     3	shell=desktop-shell.so
     4	idle-time=0
     5	[shell]
     6	panel-location=none
     7	panel-position=none
     8	locking=false
     9	background-color=0xff002244
    10	animation=fade
    11	startup-animation=fade
    12	[keyboard]
    13	keymap_layout=
    14	
    15	[output]
    16	name=WL1
    17	mode=1820x980
    18	

x11docker: Logfiles are:
  /home/user/.cache/x11docker/X250-x11docker-mate/xinit.log
  /home/user/.cache/x11docker/X250-x11docker-mate/xpraserver.log
  /home/user/.cache/x11docker/X250-x11docker-mate/xpraclient.log
  /home/user/.cache/x11docker/X250-x11docker-mate/compositor.log
  /home/user/.cache/x11docker/X250-x11docker-mate/xterm.log
  /home/user/.cache/x11docker/X250-x11docker-mate/docker.log
Summary logfile: /home/user/.cache/x11docker/X250-x11docker-mate/share/x11docker.log
In container: /x11docker/x11docker.log
After finish: /home/user/.cache/x11docker/x11docker.log

x11docker: Running X server --weston-xwayland on display :250 now ...

==> /home/user/.cache/x11docker/X250-x11docker-mate/xterm.log <==

==> /home/user/.cache/x11docker/X250-x11docker-mate/docker.log <==

==> /home/user/.cache/x11docker/X250-x11docker-mate/xpraserver.log <==

==> /home/user/.cache/x11docker/X250-x11docker-mate/xpraclient.log <==

==> /home/user/.cache/x11docker/X250-x11docker-mate/xinit.log <==

==> /home/user/.cache/x11docker/X250-x11docker-mate/compositor.log <==

==> /home/user/.cache/x11docker/X250-x11docker-mate/docker.log <==
==> /home/user/.cache/x11docker/X250-x11docker-mate/share/stdout <==

==> /home/user/.cache/x11docker/X250-x11docker-mate/share/stderr <==
x11docker: Waiting for file creation of /home/user/.cache/x11docker/X250-x11docker-mate/Xready


==> /home/user/.cache/x11docker/X250-x11docker-mate/compositor.log <==
Date: 2017-12-10 GMT
[07:06:22.288] weston 1.12.0
               http://wayland.freedesktop.org
               Bug reports to: https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=1.12.0
               Build: 1.11.94-2-ga08dff5 configure.ac: bump to version 1.12.0 for the official release (2016-09-20 12:22:46 -0700)
[07:06:22.288] Command line: weston --socket=wayland-250 --config=/home/user/.cache/x11docker/X250-x11docker-mate/weston.ini --backend=wayland-backend.so
[07:06:22.288] OS: Linux, 4.13.0-19-generic, #22-Ubuntu SMP Mon Dec 4 11:58:07 UTC 2017, x86_64
[07:06:22.288] Using config file '/home/user/.cache/x11docker/X250-x11docker-mate/weston.ini'
[07:06:22.288] Output repaint window is 7 ms maximum.
[07:06:22.288] Loading module '/usr/lib/x86_64-linux-gnu/libweston-1/wayland-backend.so'
x11docker: waiting since 0s for weston to be ready...

[07:06:22.297] Loading module '/usr/lib/x86_64-linux-gnu/libweston-1/gl-renderer.so'
[07:06:22.301] EGL client extensions: EGL_EXT_client_extensions
               EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses
               EGL_KHR_debug EGL_EXT_platform_wayland EGL_EXT_platform_x11
               EGL_MESA_platform_gbm EGL_MESA_platform_surfaceless
               EGL_KHR_platform_mir
x11docker: waiting since 0s for weston to be ready...

x11docker: waiting since 0s for weston to be ready...

x11docker: waiting since 0s for weston to be ready...

x11docker: waiting since 1s for weston to be ready...

x11docker: waiting since 1s for weston to be ready...

x11docker: waiting since 1s for weston to be ready...

x11docker: waiting since 1s for weston to be ready...

x11docker: waiting since 2s for weston to be ready...

x11docker: waiting since 2s for weston to be ready...

x11docker: waiting since 2s for weston to be ready...

x11docker: waiting since 2s for weston to be ready...

x11docker: waiting since 2s for weston to be ready...

x11docker: waiting since 3s for weston to be ready...

x11docker: waiting since 3s for weston to be ready...

x11docker: waiting since 3s for weston to be ready...

x11docker: waiting since 3s for weston to be ready...

x11docker: waiting since 3s for weston to be ready...

x11docker: waiting since 4s for weston to be ready...

x11docker: waiting since 4s for weston to be ready...

x11docker: waiting since 4s for weston to be ready...

x11docker: waiting since 4s for weston to be ready...

x11docker: waiting since 5s for weston to be ready...

x11docker: waiting since 5s for weston to be ready...

x11docker: waiting since 5s for weston to be ready...

x11docker: waiting since 5s for weston to be ready...

x11docker: waiting since 5s for weston to be ready...

x11docker: waiting since 6s for weston to be ready...

x11docker: waiting since 6s for weston to be ready...

x11docker: waiting since 6s for weston to be ready...

x11docker: waiting since 6s for weston to be ready...

x11docker: waiting since 6s for weston to be ready...

x11docker: waiting since 7s for weston to be ready...

x11docker: waiting since 7s for weston to be ready...

x11docker: waiting since 7s for weston to be ready...

x11docker: waiting since 7s for weston to be ready...

x11docker: waiting since 8s for weston to be ready...

x11docker: waiting since 8s for weston to be ready...

x11docker: waiting since 8s for weston to be ready...

x11docker: waiting since 8s for weston to be ready...

x11docker: waiting since 8s for weston to be ready...

x11docker: waiting since 9s for weston to be ready...

x11docker: waiting since 9s for weston to be ready...

x11docker: waiting since 9s for weston to be ready...

x11docker: waiting since 9s for weston to be ready...

x11docker: waiting since 9s for weston to be ready...

x11docker: waiting since 10s for weston to be ready...

x11docker: waiting since 10s for weston to be ready...

x11docker: waiting since 10s for weston to be ready...

x11docker: waiting since 10s for weston to be ready...

x11docker: waiting since 11s for weston to be ready...

x11docker: waiting since 11s for weston to be ready...

x11docker: waiting since 11s for weston to be ready...

x11docker: waiting since 11s for weston to be ready...

x11docker: waiting since 11s for weston to be ready...

x11docker: waiting since 12s for weston to be ready...

x11docker: waiting since 12s for weston to be ready...

x11docker: waiting since 12s for weston to be ready...

x11docker: waiting since 12s for weston to be ready...

x11docker: waiting since 13s for weston to be ready...

x11docker: waiting since 13s for weston to be ready...

x11docker: waiting since 13s for weston to be ready...

x11docker: waiting since 13s for weston to be ready...

x11docker: waiting since 13s for weston to be ready...

x11docker: waiting since 14s for weston to be ready...

x11docker: waiting since 14s for weston to be ready...

x11docker: waiting since 14s for weston to be ready...

x11docker: waiting since 14s for weston to be ready...

x11docker: waiting since 14s for weston to be ready...

x11docker: waiting since 15s for weston to be ready...

x11docker: waiting since 15s for weston to be ready...

x11docker: waiting since 15s for weston to be ready...

x11docker: waiting since 15s for weston to be ready...

x11docker ERROR: Startup of X server --weston-xwayland failed. 
  Last lines of xinit logfile:

  
  Type 'x11docker --help' for usage information
  For debugging, run x11docker in terminal and/or enable option '--verbose'
  and look afterwards at logfile /home/user/.cache/x11docker/x11docker.log
  If you think this is a bug in x11docker, 
  please report at https://github.com/mviereck/x11docker

x11docker: Creating /home/user/.cache/x11docker/X250-x11docker-mate/share/timetosaygoodbye

x11docker ERROR: Weston startup failed. Can not run --weston-xwayland.
  Last lines of weston log:
[07:06:22.288] OS: Linux, 4.13.0-19-generic, #22-Ubuntu SMP Mon Dec 4 11:58:07 UTC 2017, x86_64
[07:06:22.288] Using config file '/home/user/.cache/x11docker/X250-x11docker-mate/weston.ini'
[07:06:22.288] Output repaint window is 7 ms maximum.
[07:06:22.288] Loading module '/usr/lib/x86_64-linux-gnu/libweston-1/wayland-backend.so'
[07:06:22.297] Loading module '/usr/lib/x86_64-linux-gnu/libweston-1/gl-renderer.so'
[07:06:22.301] EGL client extensions: EGL_EXT_client_extensions
               EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses
               EGL_KHR_debug EGL_EXT_platform_wayland EGL_EXT_platform_x11
               EGL_MESA_platform_gbm EGL_MESA_platform_surfaceless
               EGL_KHR_platform_mir
  
  Type 'x11docker --help' for usage information
  For debugging, run x11docker in terminal and/or enable option '--verbose'
  and look afterwards at logfile /home/user/.cache/x11docker/x11docker.log
  If you think this is a bug in x11docker, 
  please report at https://github.com/mviereck/x11docker

x11docker: Creating /home/user/.cache/x11docker/X250-x11docker-mate/share/timetosaygoodbye

x11docker: terminating x11docker ...

x11docker: Creating /home/user/.cache/x11docker/X250-x11docker-mate/share/timetosaygoodbye

@mviereck
Copy link
Owner

It is a bit strange as weston does not show an obvious error message. It just stops during startup. On my debian system, it starts up well in Gnome-Wayland.

Does weston start if you run it alone in a terminal?

Looking closer, I see weston tries to load extension EGL_KHR_platform_mir. Maybe the issue lies here. MIR was an Ubuntu project similar but incompatible to Wayland.

I did a change to x11docker to use Xwayland backend instead of Wayland to create its window if it runs on Ubuntu. Please try out if this solves the problem: https://raw.githubusercontent.com/mviereck/x11docker/experimental/x11docker

@netsgnut
Copy link
Author

Thanks @mviereck! Applying the patch as specified above (v3.8.1) does allow calling x11docker --weston-xwayland --desktop --gpu -- x11docker/mate successfully. indeed it is pretty strange without any error message in the console.

Does weston start if you run it alone in a terminal?

If run as current user:

$ mkdir /dev/shm/xdg_runtime_0
$ chown 1000:1000 /dev/shm/xdg_runtime_0
$ chmod 0700 /dev/shm/xdg_runtime_0
$ XDG_RUNTIME_DIR=/dev/shm/xdg_runtime_0 weston
Date: 2017-12-11 GMT
[04:37:13.370] weston 1.12.0
               http://wayland.freedesktop.org
               Bug reports to: https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=1.12.0
               Build: 1.11.94-2-ga08dff5 configure.ac: bump to version 1.12.0 for the official release (2016-09-20 12:22:46 -0700)
[04:37:13.370] Command line: weston
[04:37:13.370] OS: Linux, 4.13.0-19-generic, #22-Ubuntu SMP Mon Dec 4 11:58:07 UTC 2017, x86_64
[04:37:13.370] Starting with no config file.
[04:37:13.370] Output repaint window is 7 ms maximum.
[04:37:13.370] Loading module '/usr/lib/x86_64-linux-gnu/libweston-1/wayland-backend.so'
[04:37:13.374] failed to create display: No such file or directory
[04:37:13.374] fatal: failed to create compositor backend

...and quit without getting a weston window.

If run as root:

$ sudo mkdir /dev/shm/xdg_runtime_1
$ sudo chown root:root /dev/shm/xdg_runtime_1
$ sudo chmod 0700 /dev/shm/xdg_runtime_1
$ sudo XDG_RUNTIME_DIR=/dev/shm/xdg_runtime_1 weston
Date: 2017-12-11 GMT
[04:42:50.534] weston 1.12.0
               http://wayland.freedesktop.org
               Bug reports to: https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=1.12.0
               Build: 1.11.94-2-ga08dff5 configure.ac: bump to version 1.12.0 for the official release (2016-09-20 12:22:46 -0700)
[04:42:50.534] Command line: weston
[04:42:50.534] OS: Linux, 4.13.0-19-generic, #22-Ubuntu SMP Mon Dec 4 11:58:07 UTC 2017, x86_64
[04:42:50.534] Starting with no config file.
[04:42:50.534] Output repaint window is 7 ms maximum.
[04:42:50.534] Loading module '/usr/lib/x86_64-linux-gnu/libweston-1/x11-backend.so'
[04:42:50.536] Loading module '/usr/lib/x86_64-linux-gnu/libweston-1/gl-renderer.so'
[04:42:50.540] EGL client extensions: EGL_EXT_client_extensions
               EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses
               EGL_KHR_debug EGL_EXT_platform_wayland EGL_EXT_platform_x11
               EGL_MESA_platform_gbm EGL_MESA_platform_surfaceless
               EGL_KHR_platform_mir
[04:42:50.545] warning: EGL_EXT_swap_buffers_with_damage not supported. Performance could be affected.
[04:42:50.545] EGL_KHR_surfaceless_context available
[04:42:50.546] EGL version: 1.4 (DRI2)
[04:42:50.546] EGL vendor: Mesa Project
[04:42:50.546] EGL client APIs: OpenGL OpenGL_ES 
[04:42:50.546] EGL extensions: EGL_ANDROID_native_fence_sync
               EGL_CHROMIUM_sync_control EGL_EXT_buffer_age
               EGL_EXT_create_context_robustness EGL_EXT_image_dma_buf_import
               EGL_EXT_image_dma_buf_import_modifiers EGL_KHR_config_attribs
               EGL_KHR_create_context EGL_KHR_create_context_no_error
               EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses
               EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image
               EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image
               EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap
               EGL_KHR_no_config_context EGL_KHR_reusable_sync
               EGL_KHR_surfaceless_context EGL_KHR_wait_sync
               EGL_MESA_configless_context EGL_MESA_drm_image
               EGL_MESA_image_dma_buf_export EGL_NOK_texture_from_pixmap
               EGL_WL_bind_wayland_display
[04:42:50.546] GL version: OpenGL ES 3.2 Mesa 17.2.2
[04:42:50.546] GLSL version: OpenGL ES GLSL ES 3.20
[04:42:50.546] GL vendor: Intel Open Source Technology Center
[04:42:50.546] GL renderer: Mesa DRI Intel(R) HD Graphics 630 (Kaby Lake GT2) 
[04:42:50.546] GL extensions: GL_EXT_blend_minmax GL_EXT_multi_draw_arrays
               GL_EXT_texture_filter_anisotropic
               GL_EXT_texture_compression_dxt1 GL_EXT_texture_format_BGRA8888
               GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth24
               GL_OES_element_index_uint GL_OES_fbo_render_mipmap
               GL_OES_mapbuffer GL_OES_rgb8_rgba8 GL_OES_standard_derivatives
               GL_OES_stencil8 GL_OES_texture_3D GL_OES_texture_float
               GL_OES_texture_float_linear GL_OES_texture_half_float
               GL_OES_texture_half_float_linear GL_OES_texture_npot
               GL_OES_vertex_half_float GL_EXT_texture_sRGB_decode
               GL_OES_EGL_image GL_OES_depth_texture
               GL_OES_packed_depth_stencil GL_EXT_texture_type_2_10_10_10_REV
               GL_OES_get_program_binary GL_APPLE_texture_max_level
               GL_EXT_discard_framebuffer GL_EXT_read_format_bgra
               GL_EXT_frag_depth GL_NV_fbo_color_attachments
               GL_OES_EGL_image_external GL_OES_EGL_sync
               GL_OES_vertex_array_object GL_OES_viewport_array
               GL_ANGLE_texture_compression_dxt3
               GL_ANGLE_texture_compression_dxt5 GL_EXT_robustness
               GL_EXT_texture_rg GL_EXT_unpack_subimage GL_NV_draw_buffers
               GL_NV_read_buffer GL_NV_read_depth GL_NV_read_depth_stencil
               GL_NV_read_stencil GL_EXT_draw_buffers GL_EXT_map_buffer_range
               GL_KHR_debug GL_KHR_robustness
               GL_KHR_texture_compression_astc_ldr
               GL_OES_depth_texture_cube_map GL_OES_surfaceless_context
               GL_EXT_color_buffer_float GL_EXT_separate_shader_objects
               GL_EXT_shader_framebuffer_fetch GL_EXT_shader_integer_mix
               GL_EXT_tessellation_point_size GL_EXT_tessellation_shader
               GL_INTEL_conservative_rasterization GL_INTEL_performance_query
               GL_ANDROID_extension_pack_es31a
               GL_EXT_compressed_ETC1_RGB8_sub_texture GL_EXT_copy_image
               GL_EXT_draw_buffers_indexed GL_EXT_draw_elements_base_vertex
               GL_EXT_gpu_shader5 GL_EXT_polygon_offset_clamp
               GL_EXT_primitive_bounding_box GL_EXT_shader_io_blocks
               GL_EXT_texture_border_clamp GL_EXT_texture_buffer
               GL_EXT_texture_cube_map_array GL_KHR_blend_equation_advanced
               GL_KHR_blend_equation_advanced_coherent
               GL_KHR_context_flush_control
               GL_KHR_robust_buffer_access_behavior GL_NV_image_formats
               GL_OES_copy_image GL_OES_draw_buffers_indexed
               GL_OES_draw_elements_base_vertex GL_OES_gpu_shader5
               GL_OES_primitive_bounding_box GL_OES_sample_shading
               GL_OES_sample_variables GL_OES_shader_io_blocks
               GL_OES_shader_multisample_interpolation
               GL_OES_tessellation_point_size GL_OES_tessellation_shader
               GL_OES_texture_border_clamp GL_OES_texture_buffer
               GL_OES_texture_cube_map_array GL_OES_texture_stencil8
               GL_OES_texture_storage_multisample_2d_array
               GL_EXT_blend_func_extended GL_EXT_buffer_storage
               GL_EXT_geometry_point_size GL_EXT_geometry_shader
               GL_EXT_shader_samples_identical GL_KHR_no_error
               GL_KHR_texture_compression_astc_sliced_3d
               GL_OES_geometry_point_size GL_OES_geometry_shader
               GL_OES_shader_image_atomic GL_EXT_clip_cull_distance
               GL_MESA_shader_integer_functions
[04:42:50.546] GL ES 2 renderer features:
               read-back format: BGRA
               wl_shm sub-image to texture: yes
               EGL Wayland extension: yes
[04:42:50.546] Using gl renderer
[04:42:50.549] Chosen EGL config details:
               RGBA bits: 8 8 8 0
               swap interval range: 0 - 1000
[04:42:50.549] x11 output 1024x600, window id 52428805
[04:42:50.549] Compositor capabilities:
               arbitrary surface rotation: yes
               screen capture uses y-flip: yes
               presentation clock: CLOCK_MONOTONIC_RAW, id 4
               presentation clock resolution: 0.000000001 s
[04:42:50.549] Loading module '/usr/lib/x86_64-linux-gnu/weston/desktop-shell.so'
[04:42:50.550] launching '/usr/lib/weston/weston-keyboard'
[04:42:50.550] launching '/usr/lib/weston/weston-desktop-shell'
libEGL warning: FIXME: egl/x11 doesn't support front buffer rendering.

...and a weston window will appear.

Looking closer, I see weston tries to load extension EGL_KHR_platform_mir. Maybe the issue lies here. MIR was an Ubuntu project similar but incompatible to Wayland.

Indeed. On a potentially unrelated note, if I run weston alone I would get a segfault.

$ weston
Date: 2017-12-11 GMT
[04:58:50.727] weston 1.12.0
               http://wayland.freedesktop.org
               Bug reports to: https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=1.12.0
               Build: 1.11.94-2-ga08dff5 configure.ac: bump to version 1.12.0 for the official release (2016-09-20 12:22:46 -0700)
[04:58:50.727] Command line: weston
[04:58:50.727] OS: Linux, 4.13.0-19-generic, #22-Ubuntu SMP Mon Dec 4 11:58:07 UTC 2017, x86_64
[04:58:50.727] Starting with no config file.
[04:58:50.728] Output repaint window is 7 ms maximum.
[04:58:50.728] Loading module '/usr/lib/x86_64-linux-gnu/libweston-1/wayland-backend.so'
[04:58:50.737] Loading module '/usr/lib/x86_64-linux-gnu/libweston-1/gl-renderer.so'
[04:58:50.742] EGL client extensions: EGL_EXT_client_extensions
               EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses
               EGL_KHR_debug EGL_EXT_platform_wayland EGL_EXT_platform_x11
               EGL_MESA_platform_gbm EGL_MESA_platform_surfaceless
               EGL_KHR_platform_mir
Segmentation fault (core dumped)

...and the dmesg looks like this:

[17728.463146] weston[23188]: segfault at 0 ip 00007f7630beb1ac sp 00007ffcee188700 error 4 in libwayland-client.so.0.3.0[7f7630be3000+c000]
[17797.046950] weston[24291]: segfault at 0 ip 00007f81b8e231ac sp 00007fff574c0100 error 4 in libwayland-client.so.0.3.0[7f81b8e1b000+c000]

While it seems to work for now, feel free if you need any more test here as well - my dev box is an Ubuntu 17.10 (artful), upgraded from a fresh installation of 17.04 (zesty). Thanks again!

mviereck added a commit that referenced this issue Dec 11, 2017
…ce-wine-#1)

# 10.12.2017 V3.8.1     bugfix Ubuntu: avoid Wayland backend for Weston due to MIR issue #19
#                       --xorg: change Xorg to X. X is setuid wrapper for Xorg on Ubuntu 14.04
@mviereck
Copy link
Owner

Fine that it works now and the solution was that easy. :-) Thanks for reporting, I would not have found that issue myself.

The bugfix is quite small, weston now runs as an X client instead of running as Wayland client on Ubuntu. Though, I prefer it to run as Wayland client as that adds another layer of security. Hopefully the bug will be gone in Ubuntu 18.04.

Strange that weston does not crash if running as root. As user, it will most probably run on your ystem withweston --backend=x11-backend.so.

While it seems to work for now, feel free if you need any more test here as well

Thanks! Currently I don't know anything special to test. Just try out x11docker options and report if something seems to be fishy.

A new option that may fail in Ubuntu is --systemd. It allows containers to run with systemd as init system (systemd must be installed in image). --systemd depends partially on the host, and as Ubuntu is migrating from Upstart to systemd, there may be unexspected issues. Maybe you would like to try that out? An example image is x11docker/cinnamon.

I already found that Ubuntu images do not work well with --systemd, it seems the migration is not complete yet.

@mviereck mviereck added the bug label Dec 11, 2017
@mviereck
Copy link
Owner

I have uploaded the patch / V3.8.1 yet.

@netsgnut
Copy link
Author

Thanks! I tried the final v3.8.1 release and ran it with --systemd --weston-xwayland for x11docker/cinnamon, it seems to be running fine. Even --sys-admin seems optional here.


There is one more thing that bothers me but may not be entirely related to this issue at all - my apologies if I should file a new issue or we should dismiss it as expected behavior.

When running x11docker with Mate or Cinnamon, with flags --hostwayland or --weston (but not together), I would receive an error Could not connect to session bus: Failed to connect to socket /tmp/dbus-xxxxxxxxxx: Connection refused. With --xwayland alone, however, I would get a "passthrough" window-less interface that does not accept any input and would simply give focus to the window behind it. Are both of this intended behavior?

Thanks again. Admittedly I know too little regarding the X/Wayland/compositors under the hood than I should. Would like to have your pointers here, if possible.

@mviereck
Copy link
Owner

mviereck commented Dec 12, 2017

There is one more thing that bothers me but may not be entirely related to this issue at all - my apologies if I should file a new issue

It is better to open new issues ;-).

I would receive an error Could not connect to session bus: Failed to connect to socket /tmp/dbus-xxxxxxxxxx: Connection refused.

I am currently working on a major update that will set up dbus, consolekit and /tmp/.ICE-unix properly. Most probably this error message is related. Though, I do not get exactly the message you describe. Would you mind to open a new issue and show me the exact command you have used? Also it helps to store x11docker.log at https://pastebin.com/ . You find the logfile after terminating the x11docker session in ~/.cache/x11docker/x11docker.log. Though, I doubt mate or cinnamon will run in a pure wayland environment at all.

With --xwayland alone, however, I would get a "passthrough" window-less interface that does not accept any input and would simply give focus to the window behind it.

I am not sure if I understand correctly. Xwayland appears as a borderless window in wayland; mate and cinnamon should start properly in Xwayland. The Xwayland window itself can be moved around with META+LeftMouseButton. Please open a new issue for this if you experience a different behaviour.

@netsgnut
Copy link
Author

OK, thanks :)

Will try to provide better description for each of them after gathering more information first then. Thanks again!

mviereck added a commit that referenced this issue Dec 15, 2017
# 15.12.2017 V3.9.0     /etc/shadow: disable possible root password
#                       --dbusdaemon: new option to run dbus system daemon and consolekit in container
# 14.12.2017            re-checked capabilities for init systems
#                       --systemd: set environment globally, especially DISPLAY for deepin is needed
#                       --systemd: set xhost+SI:localuser:$Benutzer as XAUTHORITY seems to be ignored
# 12.12.2017            /tmp/.ICE-unix created in dockerrc, root owned with 1777, needed for SESSION_MANAGER
#                       --rw: deprecated, root file system is always r/w now due to 'docker exec' in dockerrc
# 10.12.2017 (V3.8.1)   bugfix Ubuntu: avoid Wayland backend for Weston due to MIR issue #19
#            (V3.8.1)   --xorg: change Xorg to X. X is setuid wrapper for Xorg on Ubuntu 14.04
#            (V3.8.1)   +iglx removed from X options, not present in older versions of X, and maybe security issue.
# 09.12.2017            create user in dockerrc with 'docker exec' instead of using createuser.sh
#                       --xorg: removed +iglx from options, not supported on older X versions
# 07.12.2017            --openrc: new option for init system OpenRC in container
#                       --sharecgroup: new option to share /sys/fs/cgroup. default for --systemd.
# 06.12.2017            create /var/lib/dbus in dockerrc to avoid dbus errors with init systems
#                       show image name and display in weston windows
#                       bugfix --runit: add SYS_BOOT even with --cap-default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants