Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/stderr <==
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/stdout <==
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/container.log <==
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/message.log <==
- DEBUGNOTE[07:56:02,926]: check_host(): ps can watch root processes: yes
- x11docker[07:56:02,940]: Image name: rstudioxhost:verse
- Container command:
- x11docker WARNING: User ignacio is member of group docker.
- That allows unprivileged processes on host to gain root privileges.
- DEBUGNOTE[07:56:03,303]: storeinfo(): cache=/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491
- DEBUGNOTE[07:56:03,316]: storeinfo(): stdout=/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/stdout
- DEBUGNOTE[07:56:03,329]: storeinfo(): stderr=/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/stderr
- DEBUGNOTE[07:56:03,367]: storeinfo(): x11dockerpid=141478
- DEBUGNOTE[07:56:03,433]:
- x11docker version: 6.4.0
- docker version: Docker version 19.03.4, build 9013bf583a
- Host system: "Debian GNU/Linux bullseye/sid"
- Command: '/usr/bin/x11docker' '--hostdisplay' '--gpu' '--runtime=nvidia' 'rstudioxhost:verse'
- Parsed options: --hostdisplay --gpu --runtime 'nvidia' -- 'rstudioxhost:verse'
- DEBUGNOTE[07:56:03,438]: Dependency check for --hostdisplay: 0
- DEBUGNOTE[07:56:03,442]: Dependencies of --hostdisplay already checked: 0
- DEBUGNOTE[07:56:03,446]: Dependencies of --hostdisplay already checked: 0
- DEBUGNOTE[07:56:03,450]: storeinfo(): xserver=--hostdisplay
- 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: Option --gpu: To allow GPU acceleration with --hostdisplay,
- x11docker will allow trusted cookies.
- x11docker note: Option --hostdisplay: To allow --hostdisplay with trusted cookies,
- x11docker must share host IPC namespace with container (option --hostipc)
- to allow shared memory for X extension MIT-SHM.
- x11docker WARNING: Option --hostdisplay with trusted cookies provides
- QUITE BAD CONTAINER ISOLATION !
- Keylogging and controlling host applications is possible!
- Clipboard sharing is enabled (option --cliboard).
- It is recommended to use another X server option like --xpra or --nxagent.
- x11docker WARNING: Option --hostipc severely degrades
- container isolation. IPC namespace remapping is disabled.
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/xinit.log <==
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/stderr <==
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/stdout <==
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/container.log <==
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/message.log <==
- DEBUGNOTE[07:56:02,926]: check_host(): ps can watch root processes: yes
- x11docker[07:56:02,940]: Image name: rstudioxhost:verse
- Container command:
- x11docker WARNING: User ignacio is member of group docker.
- That allows unprivileged processes on host to gain root privileges.
- DEBUGNOTE[07:56:03,303]: storeinfo(): cache=/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491
- DEBUGNOTE[07:56:03,316]: storeinfo(): stdout=/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/stdout
- DEBUGNOTE[07:56:03,329]: storeinfo(): stderr=/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/stderr
- DEBUGNOTE[07:56:03,367]: storeinfo(): x11dockerpid=141478
- DEBUGNOTE[07:56:03,433]:
- x11docker version: 6.4.0
- docker version: Docker version 19.03.4, build 9013bf583a
- Host system: "Debian GNU/Linux bullseye/sid"
- Command: '/usr/bin/x11docker' '--hostdisplay' '--gpu' '--runtime=nvidia' 'rstudioxhost:verse'
- Parsed options: --hostdisplay --gpu --runtime 'nvidia' -- 'rstudioxhost:verse'
- DEBUGNOTE[07:56:03,438]: Dependency check for --hostdisplay: 0
- DEBUGNOTE[07:56:03,442]: Dependencies of --hostdisplay already checked: 0
- DEBUGNOTE[07:56:03,446]: Dependencies of --hostdisplay already checked: 0
- DEBUGNOTE[07:56:03,450]: storeinfo(): xserver=--hostdisplay
- 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: Option --gpu: To allow GPU acceleration with --hostdisplay,
- x11docker will allow trusted cookies.
- x11docker note: Option --hostdisplay: To allow --hostdisplay with trusted cookies,
- x11docker must share host IPC namespace with container (option --hostipc)
- to allow shared memory for X extension MIT-SHM.
- x11docker WARNING: Option --hostdisplay with trusted cookies provides
- QUITE BAD CONTAINER ISOLATION !
- Keylogging and controlling host applications is possible!
- Clipboard sharing is enabled (option --cliboard).
- It is recommended to use another X server option like --xpra or --nxagent.
- x11docker WARNING: Option --hostipc severely degrades
- container isolation. IPC namespace remapping is disabled.
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/xinit.log <==
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/message.log <==
- DEBUGNOTE[07:56:03,534]: waitforlogentry(): tailstdout: Waiting for logentry "x11docker=ready" in store.info
- DEBUGNOTE[07:56:03,535]: waitforlogentry(): tailstderr: Waiting for logentry "x11docker=ready" in store.info
- DEBUGNOTE[07:56:03,556]: storepid(): Stored pid '141917' of 'watchpidlist': 141917 pts/6 00:00:00 bash
- DEBUGNOTE[07:56:03,581]: storepid(): Stored pid '141931' of 'watchmessagefifo': 141931 pts/6 00:00:00 bash
- x11docker[07:56:03,613]: Virtual screen size: 3840x2160
- x11docker[07:56:03,628]: Physical screen size:
- Screen 0: minimum 8 x 8, current 3840 x 2160, maximum 32767 x 32767
- x11docker[07:56:03,645]: Detected host window manager: cinnamon --sm-disable
- DEBUGNOTE[07:56:03,778]: NVIDIA: Detected driver version 430.50 on host.
- DEBUGNOTE[07:56:03,789]: NVIDIA runtime detected. Not installing driver.
- DEBUGNOTE[07:56:03,822]: storeinfo(): DISPLAY=:0
- DEBUGNOTE[07:56:03,834]: storeinfo(): XAUTHORITY=/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client
- DEBUGNOTE[07:56:03,846]: storeinfo(): XSOCKET=/tmp/.X11-unix/X0
- DEBUGNOTE[07:56:03,857]: storeinfo(): XDG_RUNTIME_DIR=/run/user/738202
- DEBUGNOTE[07:56:03,869]: storeinfo(): Xenv= DISPLAY=:0 XAUTHORITY=/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client XSOCKET=/tmp/.X11-unix/X0 XDG_RUNTIME_DIR=/run/user/738202
- x11docker[07:56:04,021]: --init: Found tini binary: /usr/bin/docker-init
- DEBUGNOTE[07:56:04,026]: storeinfo(): tini=/usr/bin/docker-init
- DEBUGNOTE[07:56:04,039]: Users and terminal:
- x11docker was started by: ignacio
- As host user serves (running X, storing cache): ignacio
- Container user will be: ignacio
- Container user password: x11docker
- Getting permission to run docker with: eval
- Terminal for password frontend: bash -c
- Running in a terminal: yes
- Running on console: no
- Running over SSH: no
- Running sourced: no
- bash $-: hB
- DEBUGNOTE[07:56:04,045]: storeinfo(): containername=x11docker_X0_rstudioxhost-verse_33362576491
- x11docker WARNING: Sharing device file: /dev/dri
- x11docker WARNING: Sharing device file: /dev/nvidia0
- x11docker WARNING: Sharing device file: /dev/nvidiactl
- x11docker WARNING: Sharing device file: /dev/nvidia-modeset
- x11docker WARNING: Sharing device file: /dev/nvidia-uvm
- x11docker WARNING: Sharing device file: /dev/nvidia-uvm-tools
- x11docker WARNING: Sharing device file: /dev/vga_arbiter
- DEBUGNOTE[07:56:04,580]: Docker command:
- docker run --tty --rm --detach \
- --name x11docker_X0_rstudioxhost-verse_33362576491 \
- --user 738202:89939 \
- --env USER=ignacio \
- --userns host \
- --group-add 44 \
- --group-add 108 \
- --runtime='nvidia' \
- --cap-drop ALL \
- --security-opt no-new-privileges \
- --security-opt label=type:container_runtime_t \
- --volume '/usr/bin/docker-init':'/usr/local/bin/tini':ro \
- --tmpfs /run --tmpfs /run/lock \
- --volume '/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share':'/x11docker':rw \
- --device '/dev/dri':'/dev/dri':rw \
- --device '/dev/nvidia0':'/dev/nvidia0':rw \
- --device '/dev/nvidiactl':'/dev/nvidiactl':rw \
- --device '/dev/nvidia-modeset':'/dev/nvidia-modeset':rw \
- --device '/dev/nvidia-uvm':'/dev/nvidia-uvm':rw \
- --device '/dev/nvidia-uvm-tools':'/dev/nvidia-uvm-tools':rw \
- --device '/dev/vga_arbiter':'/dev/vga_arbiter':rw \
- --volume '/tmp/.X11-unix/X0':'/X0':rw \
- --ipc host \
- --workdir '/tmp' \
- --entrypoint env \
- --env 'container=docker' \
- --env 'XAUTHORITY=/x11docker/Xauthority.client' \
- --env 'DISPLAY=:0' \
- --env 'XDG_RUNTIME_DIR=/tmp/XDG_RUNTIME_DIR' \
- -- rstudioxhost:verse /usr/local/bin/tini -- /bin/sh - /x11docker/containerrc
- x11docker[07:56:04,874]: Generated dockerrc:
- 1 #! /usr/bin/env bash
- 2
- 3 # dockerrc:
- 4 # This script runs as root (or member of group docker) on host.
- 5 # - inspect image
- 6 # - pull image if needed
- 7 # - create containerrc
- 8 # - set up systemd/elogind cgroup if needed
- 9 # - run window manager in container or from host if needed
- 10
- 11 trap '' SIGINT
- 12
- 13 askyesno ()
- 14 {
- 15 local Choice;
- 16 read -t60 -n1 -p "(timeout after 60s assuming no) [Y|n]" Choice;
- 17 [ "$?" = '0' ] && {
- 18 [[ "$Choice" == [YyJj]* ]] || [ -z "$Choice" ] && return 0
- 19 };
- 20 return 1
- 21 }
- 22 checkpid ()
- 23 {
- 24 [ -e "/proc/${1:-NONSENSE}" ]
- 25 }
- 26 escapestring ()
- 27 {
- 28 echo "${1:-}" | LC_ALL=C sed -e 's/[^a-zA-Z0-9,._+@=:/-]/\\&/g; 1{$s/^$/""/}; 1!s/^/"/; $!s/$/"/'
- 29 }
- 30 mysleep ()
- 31 {
- 32 sleep "${1:-1}" 2> /dev/null || sleep 1
- 33 }
- 34 pspid ()
- 35 {
- 36 LC_ALL=C ps -p "${1:-}" 2> /dev/null | grep -v 'TIME'
- 37 }
- 38 rmcr ()
- 39 {
- 40 case "${1:-}" in
- 41 "")
- 42 sed "s/$(printf "\r")//g"
- 43 ;;
- 44 *)
- 45 sed -i "s/$(printf "\r")//g" "${1:-}"
- 46 ;;
- 47 esac
- 48 }
- 49 rocknroll ()
- 50 {
- 51 [ -s "$Timetosaygoodbyefile" ] && return 1;
- 52 [ -e "$Timetosaygoodbyefile" ] || return 1;
- 53 return 0
- 54 }
- 55 saygoodbye ()
- 56 {
- 57 debugnote "time to say goodbye ($*)";
- 58 [ -e "$Timetosaygoodbyefile" ] && echo timetosaygoodbye >> $Timetosaygoodbyefile;
- 59 [ -e "$Timetosaygoodbyefifo" ] && echo timetosaygoodbye >> $Timetosaygoodbyefifo
- 60 }
- 61 storeinfo ()
- 62 {
- 63 [ -e "$Storeinfofile" ] || return 1;
- 64 case "${1:-}" in
- 65 dump)
- 66 grep "^${2:-}=" $Storeinfofile | sed "s/^${2:-}=//"
- 67 ;;
- 68 drop)
- 69 sed -i "/^${2:-}=/d" $Storeinfofile
- 70 ;;
- 71 test)
- 72 grep -q "^${2:-}=" $Storeinfofile
- 73 ;;
- 74 *)
- 75 debugnote "storeinfo(): ${1:-}";
- 76 grep -q "^$(echo "${1:-}" | cut -d= -f1)=" $Storeinfofile && {
- 77 sed -i "/^$(echo "${1:-}" | cut -d= -f1)=/d" $Storeinfofile
- 78 };
- 79 echo "${1:-}" >> $Storeinfofile
- 80 ;;
- 81 esac
- 82 }
- 83 storepid ()
- 84 {
- 85 case "${1:-}" in
- 86 dump)
- 87 grep -w "${2:-}" "$Storepidfile" | cut -d' ' -f1
- 88 ;;
- 89 test)
- 90 grep -q -w "${2:-}" "$Storepidfile"
- 91 ;;
- 92 *)
- 93 echo "${1:-NOPID}" "${2:-NONAME}" >> "$Storepidfile";
- 94 debugnote "storepid(): Stored pid '${1:-}' of '${2:-}': $(pspid ${1:-} ||:)"
- 95 ;;
- 96 esac
- 97 }
- 98 waitforlogentry ()
- 99 {
- 100 local Startzeit Uhrzeit Dauer Count=0 Schlaf;
- 101 local Errorkeys="${4:-}";
- 102 local Warten="${5:-60}";
- 103 Startzeit="$(date +%s ||:)";
- 104 Startzeit="${Startzeit:-0}";
- 105 [ "$Warten" = "infinity" ] && Warten=32000;
- 106 debugnote "waitforlogentry(): ${1:-}: Waiting for logentry \"${3:-}\" in $(basename ${2:-})";
- 107 while ! grep -q "${3:-}" < "${2:-}"; do
- 108 Count="$(( $Count + 1 ))";
- 109 Uhrzeit="$(date +%s ||:)";
- 110 Uhrzeit="${Uhrzeit:-0}";
- 111 Dauer="$(( $Uhrzeit - $Startzeit ))";
- 112 Schlaf="$(( $Count / 10 ))";
- 113 [ "$Schlaf" = "0" ] && Schlaf="0.5";
- 114 mysleep "$Schlaf";
- 115 [ "$Dauer" -gt "10" ] && debugnote "waitforlogentry(): ${1:-}: Waiting since ${Dauer}s for log entry \"${3:-}\" in $(basename ${2:-})";
- 116 [ "$Dauer" -gt "$Warten" ] && error "waitforlogentry(): ${1:-}: Timeout waiting for log entry \"${3:-}\" in $(basename ${2:-})
- 117 Last lines of logfile $(basename ${2:-}):
- 118 $(tail "${2:-}")";
- 119 [ "$Errorkeys" ] && grep -i -q -E "$Errorkeys" < "${2:-}" && error "waitforlogentry(): ${1:-}: Found error message in logfile.
- 120 Last lines of logfile $(basename ${2:-}):
- 121 $(tail "${2:-}")";
- 122 rocknroll || {
- 123 debugnote "waitforlogentry(): ${1:-}: Stopped waiting for ${3:-} in $(basename ${2:-}) due to terminating signal.";
- 124 return 1
- 125 };
- 126 done;
- 127 debugnote "waitforlogentry(): ${1:-}: Found log entry \"${3:-}\" in $(basename ${2:-}).";
- 128 return 0
- 129 }
- 130
- 131 warning() {
- 132 echo "$*:WARNING" | sed "s/\$/ /" >>$Messagefile
- 133 }
- 134 note() {
- 135 echo "$*:NOTE" | sed "s/\$/ /" >>$Messagefile
- 136 }
- 137 verbose() {
- 138 echo "$*:VERBOSE" | sed "s/\$/ /" >>$Messagefile
- 139 }
- 140 debugnote() {
- 141 echo "$*:DEBUGNOTE" | sed "s/\$/ /" >>$Messagefile
- 142 }
- 143 error() {
- 144 echo "$*:ERROR" | sed "s/\$/ /" >>$Messagefile
- 145 exit 64
- 146 }
- 147 stdout() {
- 148 echo "$*:STDOUT" | sed "s/\$/ /" >>$Messagefile
- 149 }
- 150
- 151 Containercommand=""
- 152 Imagename="rstudioxhost:verse"
- 153 Messagefile='/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/message.fifo'
- 154 Newxenv=' DISPLAY=:0 XAUTHORITY=/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client XSOCKET=/tmp/.X11-unix/X0 XDG_RUNTIME_DIR=/run/user/738202'
- 155 export PATH='/usr/local/buildtools/java/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games'
- 156 Storeinfofile='/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/store.info'
- 157 Storepidfile='/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/store.pids'
- 158 Timetosaygoodbyefile='/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/timetosaygoodbye'
- 159 Timetosaygoodbyefifo='/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/timetosaygoodbye.fifo'
- 160 Xserver='--hostdisplay'
- 161 Workdir=''
- 162
- 163 Containerid=
- 164 Containerip=
- 165 Dockerlogspid=''
- 166 Dockerpull=
- 167 Exec=
- 168 Entrypoint=
- 169 Failure=
- 170 Imageuser=
- 171 Inspect=
- 172 Line=
- 173 Pid1pid=
- 174 Runtime=
- 175 Signal=
- 176 Windowmanager=
- 177 Windowmanagercommand=
- 178 Wmcontainerid=
- 179 Wmdockercommand=
- 180 Workdir=
- 181 debugnote 'Running dockerrc: Setup as root or as user docker on host.'
- 182
- 183
- 184 # Check whether docker daemon is running, get docker info
- 185 docker info >>/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/docker.info 2>>/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/container.log || {
- 186 error "Calling docker daemon failed.
- 187 Is docker daemon running at all?
- 188 Try to start docker daemon with: systemctl start docker
- 189 Last lines of log:
- 190 $(rmcr < '/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/container.log' | tail)"
- 191 }
- 192
- 193 # Check default runtime
- 194 Runtime="$(grep 'Default Runtime' < '/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/docker.info' | awk '{print $3}')"
- 195 debugnote "dockerrc: Found default Runtime: $Runtime"
- 196 debugnote "dockerrc: All $(grep 'Runtimes' < '/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/docker.info')"
- 197 [ "$Runtime" != 'nvidia' ] && {
- 198 case $Runtime in
- 199 kata-runtime) warning 'Found default docker runtime kata-runtime.
- 200 Please run x11docker with --runtime=kata-runtime to avoid issues.' ;;
- 201 nvidia) [ 'yes' = 'yes' ] && warning 'Option --gpu: Found default docker runtime nvidia.
- 202 Please run x11docker with --runtime=nvidia to avoid issues.' ;;
- 203 runc|crun) ;;
- 204 *) warning "Found unknown container runtime: $Runtime
- 205 Please report at: https://github.com/mviereck/x11docker" ;;
- 206 esac
- 207 Runtime='nvidia'
- 208 }
- 209 debugnote "dockerrc: Container Runtime: $Runtime"
- 210 storeinfo "runtime=$Runtime"
- 211
- 212 # Refresh images.list for x11docker-gui
- 213 docker images 2>>/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/container.log | grep -v REPOSITORY | awk '{print $1 ":" $2}' >>/home/ignacio/.cache/x11docker/docker.imagelist.sort
- 214 rmcr /home/ignacio/.cache/x11docker/docker.imagelist.sort
- 215 while read -r Line ; do
- 216 grep -q "<none>" <<<$Line || echo $Line >> /home/ignacio/.cache/x11docker/docker.imagelist
- 217 done < <(sort < /home/ignacio/.cache/x11docker/docker.imagelist.sort)
- 218 rm /home/ignacio/.cache/x11docker/docker.imagelist.sort
- 219
- 220 # Check if image rstudioxhost:verse is available locally
- 221 Dockerpull=no
- 222 grep -x -q 'rstudioxhost:verse' < /home/ignacio/.cache/x11docker/docker.imagelist || grep -x -q 'rstudioxhost:verse:latest' < /home/ignacio/.cache/x11docker/docker.imagelist || {
- 223 docker inspect rstudioxhost:verse >>/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/container.log 2>&1 || {
- 224 echo 'Image rstudioxhost:verse not found locally.' >&2
- 225 echo 'Do you want to pull it from docker hub?' >&2
- 226 askyesno && Dockerpull=yes || error "Image 'rstudioxhost:verse' not available locally and not pulled from docker hub."
- 227 }
- 228 }
- 229
- 230 rocknroll || exit 64
- 231
- 232 [ "$Dockerpull" = 'yes' ] && {
- 233 note "Pulling image 'rstudioxhost:verse' from docker hub"
- 234 docker pull rstudioxhost:verse 1>&2 || error "Pulling docker image 'rstudioxhost:verse' seems to have failed!"
- 235 }
- 236
- 237 rocknroll || exit 64
- 238
- 239 Inspect="$(docker inspect rstudioxhost:verse --format='{{.Config.Entrypoint}}{{.Config.Cmd}}[{{.Config.User}}][{{.Config.WorkingDir}}]')"
- 240
- 241 # Check CMD
- 242 [ -z "$Containercommand" ] && {
- 243 # extract image command from image if not given on cli
- 244 Containercommand="$(cut -d] -f2 <<< "$Inspect" | cut -d[ -f2)"
- 245 debugnote "dockerrc: Image CMD: $Containercommand"
- 246 echo "$Containercommand" | grep -q /x11docker/containerrc && error 'Recursion error: Found CMD /x11docker/containerrc in image.
- 247 Did you use docker commit with an x11docker container?
- 248 Please build new images with a Dockerfile instead of using docker commit,
- 249 or provide a different container command.'
- 250 }
- 251
- 252 # Check USER
- 253 Imageuser="$(cut -d[ -f4 <<< "$Inspect" | cut -d] -f1)"
- 254 debugnote "dockerrc: Image USER: $Imageuser"
- 255 [ "$Imageuser" ] && note "Found 'USER $Imageuser' in image.
- 256 If you want to run with user $Imageuser instead of host user ignacio,
- 257 than run with --user=RETAIN."
- 258 storeinfo containeruser="ignacio"
- 259
- 260 # Check ENTRYPOINT
- 261 Entrypoint="$(cut -d] -f1 <<< "$Inspect" | cut -d[ -f2)"
- 262 debugnote "dockerrc: Image ENTRYPOINT: $Entrypoint"
- 263 echo "$Entrypoint" | grep -qE 'tini|init|systemd' && {
- 264 note "There seems to be an init system in ENTRYPOINT of image:
- 265 $Entrypoint
- 266 Will disable it as x11docker already runs an init with option --tini.
- 267 To allow this ENTRYPOINT, run x11docker with option --init=none."
- 268 Entrypoint=
- 269 }
- 270
- 271 # Check WORKDIR
- 272 Workdir="$(cut -d[ -f5 <<< "$Inspect" | cut -d] -f1)"
- 273 debugnote "dockerrc: Image WORKDIR: $Workdir"
- 274 [ "$Workdir" ] && note "Found 'WORKDIR $Workdir' in image.
- 275 You can change it with option --workdir=DIR."
- 276
- 277 [ -z "$Containercommand$Entrypoint" ] && error 'No container command specified and no CMD or ENTRYPOINT found in image.'
- 278
- 279 ######## Create containerrc ########
- 280
- 281 { echo '#! /bin/sh'
- 282 echo ''
- 283 echo '# containerrc'
- 284 echo '# Created startscript for docker run used as container command.'
- 285 echo '# Runs as unprivileged user in container.'
- 286 echo ''
- 287 echo 'exec 6>&1 7>&2'
- 288 echo 'exec >>/x11docker/container.log 2>&1'
- 289 echo ''
- 290 echo 'mysleep ()
- 291 {
- 292 sleep "${1:-1}" 2> /dev/null || sleep 1
- 293 }'
- 294 echo 'rocknroll ()
- 295 {
- 296 [ -s "$Timetosaygoodbyefile" ] && return 1;
- 297 [ -e "$Timetosaygoodbyefile" ] || return 1;
- 298 return 0
- 299 }'
- 300 echo 'saygoodbye ()
- 301 {
- 302 debugnote "time to say goodbye ($*)";
- 303 [ -e "$Timetosaygoodbyefile" ] && echo timetosaygoodbye >> $Timetosaygoodbyefile;
- 304 [ -e "$Timetosaygoodbyefifo" ] && echo timetosaygoodbye >> $Timetosaygoodbyefifo
- 305 }'
- 306 echo 'storeinfo ()
- 307 {
- 308 [ -e "$Storeinfofile" ] || return 1;
- 309 case "${1:-}" in
- 310 dump)
- 311 grep "^${2:-}=" $Storeinfofile | sed "s/^${2:-}=//"
- 312 ;;
- 313 drop)
- 314 sed -i "/^${2:-}=/d" $Storeinfofile
- 315 ;;
- 316 test)
- 317 grep -q "^${2:-}=" $Storeinfofile
- 318 ;;
- 319 *)
- 320 debugnote "storeinfo(): ${1:-}";
- 321 grep -q "^$(echo "${1:-}" | cut -d= -f1)=" $Storeinfofile && {
- 322 sed -i "/^$(echo "${1:-}" | cut -d= -f1)=/d" $Storeinfofile
- 323 };
- 324 echo "${1:-}" >> $Storeinfofile
- 325 ;;
- 326 esac
- 327 }'
- 328 echo 'waitforlogentry ()
- 329 {
- 330 local Startzeit Uhrzeit Dauer Count=0 Schlaf;
- 331 local Errorkeys="${4:-}";
- 332 local Warten="${5:-60}";
- 333 Startzeit="$(date +%s ||:)";
- 334 Startzeit="${Startzeit:-0}";
- 335 [ "$Warten" = "infinity" ] && Warten=32000;
- 336 debugnote "waitforlogentry(): ${1:-}: Waiting for logentry \"${3:-}\" in $(basename ${2:-})";
- 337 while ! grep -q "${3:-}" < "${2:-}"; do
- 338 Count="$(( $Count + 1 ))";
- 339 Uhrzeit="$(date +%s ||:)";
- 340 Uhrzeit="${Uhrzeit:-0}";
- 341 Dauer="$(( $Uhrzeit - $Startzeit ))";
- 342 Schlaf="$(( $Count / 10 ))";
- 343 [ "$Schlaf" = "0" ] && Schlaf="0.5";
- 344 mysleep "$Schlaf";
- 345 [ "$Dauer" -gt "10" ] && debugnote "waitforlogentry(): ${1:-}: Waiting since ${Dauer}s for log entry \"${3:-}\" in $(basename ${2:-})";
- 346 [ "$Dauer" -gt "$Warten" ] && error "waitforlogentry(): ${1:-}: Timeout waiting for log entry \"${3:-}\" in $(basename ${2:-})
- 347 Last lines of logfile $(basename ${2:-}):
- 348 $(tail "${2:-}")";
- 349 [ "$Errorkeys" ] && grep -i -q -E "$Errorkeys" < "${2:-}" && error "waitforlogentry(): ${1:-}: Found error message in logfile.
- 350 Last lines of logfile $(basename ${2:-}):
- 351 $(tail "${2:-}")";
- 352 rocknroll || {
- 353 debugnote "waitforlogentry(): ${1:-}: Stopped waiting for ${3:-} in $(basename ${2:-}) due to terminating signal.";
- 354 return 1
- 355 };
- 356 done;
- 357 debugnote "waitforlogentry(): ${1:-}: Found log entry \"${3:-}\" in $(basename ${2:-}).";
- 358 return 0
- 359 }'
- 360 echo 'calculate() {'
- 361 echo ' LC_ALL=C printf %.3f\\n "$((10**9 * $@))e-9"'
- 362 echo '}'
- 363 echo '
- 364 warning() {
- 365 echo "$*:WARNING" | sed "s/\$/ /" >>$Messagefile
- 366 }
- 367 note() {
- 368 echo "$*:NOTE" | sed "s/\$/ /" >>$Messagefile
- 369 }
- 370 verbose() {
- 371 echo "$*:VERBOSE" | sed "s/\$/ /" >>$Messagefile
- 372 }
- 373 debugnote() {
- 374 echo "$*:DEBUGNOTE" | sed "s/\$/ /" >>$Messagefile
- 375 }
- 376 error() {
- 377 echo "$*:ERROR" | sed "s/\$/ /" >>$Messagefile
- 378 exit 64
- 379 }
- 380 stdout() {
- 381 echo "$*:STDOUT" | sed "s/\$/ /" >>$Messagefile
- 382 }'
- 383 echo 'Messagefile=/x11docker/message.fifo'
- 384 echo 'Storeinfofile=/x11docker/store.info'
- 385 echo 'Timetosaygoodbyefile=/x11docker/timetosaygoodbye'
- 386 echo ''
- 387 echo 'waitforlogentry containerrc $Storeinfofile containerrootrc=ready infinity'
- 388 echo 'debugnote "Running containerrc: Unprivileged user commands in container"'
- 389 echo ''
- 390 echo "Containercommand=\"$Containercommand\""
- 391 echo "Entrypoint=\"$Entrypoint\""
- 392 echo ''
- 393 echo 'verbose "containerrc: Container system:'
- 394 echo '$(cat /etc/os-release 2>&1 ||:)"'
- 395 echo ''
- 396 } >> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/containerrc
- 397 {
- 398 echo ''
- 399 echo '# USER and HOME'
- 400 echo 'Containeruser="$(storeinfo dump containeruser)"'
- 401 echo 'Containeruserhome="/fakehome/ignacio"'
- 402 echo 'export USER="$Containeruser"'
- 403 echo 'export HOME="$Containeruserhome"'
- 404 echo ''
- 405 echo '# XDG_RUNTIME_DIR'
- 406 echo 'Containeruseruid=$(id -u $Containeruser)'
- 407 echo 'export XDG_RUNTIME_DIR=/tmp/XDG_RUNTIME_DIR'
- 408 echo '[ -e /run/user/$Containeruseruid ] && ln -s /run/user/$Containeruseruid $XDG_RUNTIME_DIR || mkdir -p -m700 $XDG_RUNTIME_DIR'
- 409 echo ''
- 410 echo 'mkdir -p $Containeruserhome'
- 411 echo '# Copy files from /etc/skel into empty HOME'
- 412 echo '[ -d /etc/skel ] && [ -z "$(ls -A "/fakehome/ignacio" 2>/dev/null | grep -v gnupg)" ] && {'
- 413 echo ' debugnote "containerrc: HOME is empty. Copying from /etc/skel"'
- 414 echo ' cp -n -R /etc/skel/. $Containeruserhome'
- 415 echo ' :'
- 416 echo '} || {'
- 417 echo ' debugnote "containerrc: HOME not empty. Not copying from /etc/skel"'
- 418 echo '}'
- 419 echo ''
- 420 echo '# Create softlink to X unix socket'
- 421 echo '[ -e /tmp/.X11-unix/X0 ] || ln -s /X0 /tmp/.X11-unix'
- 422 echo ''
- 423 echo 'unset WAYLAND_DISPLAY'
- 424 echo ''
- 425 echo 'export XDG_SESSION_TYPE=x11'
- 426 echo ''
- 427 echo ''
- 428 echo 'bash --version >/dev/null 2>&1 && export SHELL=/bin/bash || export SHELL=/bin/sh'
- 429 echo 'export TERM=xterm'
- 430 echo 'storeinfo test locale && export LANG="$(storeinfo dump locale)"'
- 431 echo '[ -e "/usr/share/zoneinfo/America/Los_Angeles" ] || export TZ=UTC+08'
- 432 echo '[ "$(date -Ihours)" != "2019-11-15T07-08:00" ] && export TZ=UTC+08'
- 433 echo '[ "$DEBIAN_FRONTEND" = noninteractive ] && unset DEBIAN_FRONTEND && export DEBIAN_FRONTEND'
- 434 echo '[ "$DEBIAN_FRONTEND" = newt ] && unset DEBIAN_FRONTEND && export DEBIAN_FRONTEND'
- 435 echo '# container environment (--env)'
- 436 echo "export 'container=docker'"
- 437 echo "export 'XAUTHORITY=/x11docker/Xauthority.client'"
- 438 echo "export 'DISPLAY=:0'"
- 439 echo "export 'XDG_RUNTIME_DIR=/tmp/XDG_RUNTIME_DIR'"
- 440 echo ''
- 441 echo 'env >> /x11docker/container.environment'
- 442 echo 'verbose "Container environment:'
- 443 echo '$(env | sort)"'
- 444 echo ''
- 445 echo 'cd "$HOME"'
- 446 [ "$Workdir" ] && echo "[ -d \"$Workdir\" ] && cd \"$Workdir\" # WORKDIR in image"
- 447 echo ''
- 448 echo "debugnote \"containerrc: Running container command:
- 449 \$Dbus $Entrypoint $Containercommand
- 450 \""
- 451 echo ''
- 452 echo 'exec 1>&6 2>&7 6>&- 7>&-'
- 453 echo "$Exec \$Dbus $Entrypoint $Containercommand >>/x11docker/stdout 2>>/x11docker/stderr"
- 454 echo "storeinfo cmdexitcode=\$?"
- 455 } >> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/containerrc
- 456 ######## End of containerrc ########
- 457
- 458 # Write containerrc into x11docker.log
- 459 nl -ba >> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/x11docker.log < /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/containerrc
- 460
- 461 # Send signal to run X and wait for X to be ready
- 462 storeinfo readyforX=ready
- 463 waitforlogentry 'dockerrc' /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/xinit.log 'xinitrc is ready' 'xinit: giving up|unable to connect to X server|Connection refused|server error|Only console users are allowed'
- 464
- 465 rocknroll || exit 64
- 466
- 467
- 468 rocknroll || exit 64
- 469
- 470
- 471 #### run docker image ####
- 472 read Containerid < <(docker run --tty --rm --detach \
- 473 --name x11docker_X0_rstudioxhost-verse_33362576491 \
- 474 --user 738202:89939 \
- 475 --env USER=ignacio \
- 476 --userns host \
- 477 --group-add 44 \
- 478 --group-add 108 \
- 479 --runtime='nvidia' \
- 480 --cap-drop ALL \
- 481 --security-opt no-new-privileges \
- 482 --security-opt label=type:container_runtime_t \
- 483 --volume '/usr/bin/docker-init':'/usr/local/bin/tini':ro \
- 484 --tmpfs /run --tmpfs /run/lock \
- 485 --volume '/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share':'/x11docker':rw \
- 486 --device '/dev/dri':'/dev/dri':rw \
- 487 --device '/dev/nvidia0':'/dev/nvidia0':rw \
- 488 --device '/dev/nvidiactl':'/dev/nvidiactl':rw \
- 489 --device '/dev/nvidia-modeset':'/dev/nvidia-modeset':rw \
- 490 --device '/dev/nvidia-uvm':'/dev/nvidia-uvm':rw \
- 491 --device '/dev/nvidia-uvm-tools':'/dev/nvidia-uvm-tools':rw \
- 492 --device '/dev/vga_arbiter':'/dev/vga_arbiter':rw \
- 493 --volume '/tmp/.X11-unix/X0':'/X0':rw \
- 494 --ipc host \
- 495 --workdir '/tmp' \
- 496 --entrypoint env \
- 497 --env 'container=docker' \
- 498 --env 'XAUTHORITY=/x11docker/Xauthority.client' \
- 499 --env 'DISPLAY=:0' \
- 500 --env 'XDG_RUNTIME_DIR=/tmp/XDG_RUNTIME_DIR' \
- 501 -- rstudioxhost:verse /usr/local/bin/tini -- /bin/sh - /x11docker/containerrc 2>>/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/container.log | rmcr)
- 502 ##########################
- 503
- 504
- 505 [ "$Containerid" ] || {
- 506 error "Startup of docker failed. Did not receive a container ID.
- 507
- 508 Last lines of container log:
- 509 $(rmcr < /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/container.log | tail)"
- 510 }
- 511 storeinfo containerid="$Containerid"
- 512 # Wait for container to be ready
- 513 for ((Count=1 ; Count<=40 ; Count++)); do
- 514 docker exec x11docker_X0_rstudioxhost-verse_33362576491 sh -c : 2>&1 | rmcr >>/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/container.log && { debugnote 'dockerrc: Container is up and running.' ; break ; } || debugnote "dockerrc: Container not ready on $Count. attempt, trying again."
- 515 rocknroll || exit 64
- 516 mysleep 0.1
- 517 done
- 518
- 519 # Wait for pid 1 in container
- 520 for ((Count=1 ; Count<=40 ; Count++)); do
- 521 Pid1pid="$(docker inspect --format '{{.State.Pid}}' x11docker_X0_rstudioxhost-verse_33362576491 2>>/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/container.log | rmcr)"
- 522 debugnote "dockerrc: $Count. check for PID 1: $Pid1pid"
- 523 checkpid "$Pid1pid" && break
- 524 rocknroll || exit 64
- 525 mysleep 0.1
- 526 done
- 527 storeinfo pid1pid="$Pid1pid"
- 528
- 529 # Get IP of container
- 530 Containerip="$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' x11docker_X0_rstudioxhost-verse_33362576491 2>>/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/container.log)"
- 531 storeinfo containerip=$Containerip
- 532
- 533 # Check log for startup failure
- 534 Failure="$(rmcr < /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/container.log | grep -v grep | grep -E 'Error response from daemon|OCI runtime exec' ||:)"
- 535 [ "$Failure" ] && {
- 536 echo "$Failure" >>/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/container.log
- 537 error "Got error message from docker daemon:
- 538 $Failure
- 539
- 540 Last lines of logfile:
- 541 "
- 542 }
- 543
- 544 # copy containerrootrc inside of container to avoid possible noexec of host home.
- 545 docker exec --tty x11docker_X0_rstudioxhost-verse_33362576491 sh -c 'cp /x11docker/containerrootrc /tmp/containerrootrc ; chmod 644 /tmp/containerrootrc' 2>&1 | rmcr >>/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/container.log
- 546 # run container root setup. containerrc will wait until setup script is ready.
- 547 docker exec --tty -u root x11docker_X0_rstudioxhost-verse_33362576491 /bin/sh /tmp/containerrootrc 2>&1 | rmcr >>/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/container.log
- 548
- 549 storeinfo dockerrc=ready
- 550
- 551 [ "$Containerid" ] || [ "$Wmcontainerid" ] && {
- 552 # wait for signal of finish()
- 553 read Signal </home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/dockerrc.stopfifo
- 554 [ "$Signal" = "stop" ] && {
- 555 [ "$Containerid" ] && docker stop $Containerid >> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/container.log 2>&1 &
- 556 [ "$Wmcontainerid" ] && docker stop $Wmcontainerid >> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/container.log 2>&1 &
- 557 [ "$Dockerlogspid" ] && kill $Dockerlogspid >> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/container.log 2>&1 &
- 558 }
- 559 } & storepid $! dockerstopshell
- 560 exit 0
- x11docker[07:56:04,978]: Generated containerrootrc:
- 1 #! /bin/sh
- 2
- 3 # containerrootrc
- 4 # This Script is executed as root in container.
- 5 # - Create container user
- 6 # - Time zone
- 7 # - Install NVIDIA driver if requested
- 8 # - Set up init system services and DBus for --init=systemd|openrc|runit|sysvinit
- 9
- 10 # redirect output to have it available before 'docker logs' starts. --init=runit (void) would eat up the output at all for unknown reasons.
- 11 exec 1>>/x11docker/container.log 2>&1
- 12
- 13 storeinfo ()
- 14 {
- 15 [ -e "$Storeinfofile" ] || return 1;
- 16 case "${1:-}" in
- 17 dump)
- 18 grep "^${2:-}=" $Storeinfofile | sed "s/^${2:-}=//"
- 19 ;;
- 20 drop)
- 21 sed -i "/^${2:-}=/d" $Storeinfofile
- 22 ;;
- 23 test)
- 24 grep -q "^${2:-}=" $Storeinfofile
- 25 ;;
- 26 *)
- 27 debugnote "storeinfo(): ${1:-}";
- 28 grep -q "^$(echo "${1:-}" | cut -d= -f1)=" $Storeinfofile && {
- 29 sed -i "/^$(echo "${1:-}" | cut -d= -f1)=/d" $Storeinfofile
- 30 };
- 31 echo "${1:-}" >> $Storeinfofile
- 32 ;;
- 33 esac
- 34 }
- 35 rocknroll ()
- 36 {
- 37 [ -s "$Timetosaygoodbyefile" ] && return 1;
- 38 [ -e "$Timetosaygoodbyefile" ] || return 1;
- 39 return 0
- 40 }
- 41
- 42 warning() {
- 43 echo "$*:WARNING" | sed "s/\$/ /" >>$Messagefile
- 44 }
- 45 note() {
- 46 echo "$*:NOTE" | sed "s/\$/ /" >>$Messagefile
- 47 }
- 48 verbose() {
- 49 echo "$*:VERBOSE" | sed "s/\$/ /" >>$Messagefile
- 50 }
- 51 debugnote() {
- 52 echo "$*:DEBUGNOTE" | sed "s/\$/ /" >>$Messagefile
- 53 }
- 54 error() {
- 55 echo "$*:ERROR" | sed "s/\$/ /" >>$Messagefile
- 56 exit 64
- 57 }
- 58 stdout() {
- 59 echo "$*:STDOUT" | sed "s/\$/ /" >>$Messagefile
- 60 }
- 61 Messagefile=/x11docker/message.fifo
- 62 Storeinfofile='/x11docker/store.info'
- 63 Timetosaygoodbyefile=/x11docker/timetosaygoodbye
- 64
- 65 debugnote 'Running containerrootrc: Setup as root in container'
- 66
- 67 # Check type of libc
- 68 ldd --version 2>&1 | grep -q 'musl libc' && Containerlibc='musl'
- 69 ldd --version 2>&1 | grep -q -E 'GLIBC|GNU libc' && Containerlibc='glibc'
- 70 debugnote "containerrootrc: Container libc: $Containerlibc"
- 71
- 72 # Prepare X environment
- 73 # Create some system dirs with needed permissions
- 74 mkdir -v -p /var/lib/dbus /var/run/dbus
- 75 mkdir -v -p -m 1777 /tmp/.ICE-unix /tmp/.X11-unix /tmp/.font-unix
- 76 chmod -c 1777 /tmp/.ICE-unix /tmp/.X11-unix /tmp/.font-unix
- 77 export DISPLAY=:0 XAUTHORITY=/x11docker/Xauthority.client
- 78 [ -e /X0 ] && ln -s /X0 /tmp/.X11-unix/X0
- 79 ls -l /X0
- 80 ls -l /tmp/.X11-unix/X0
- 81
- 82 # Time zone
- 83 [ ! -d /usr/share/zoneinfo ] && [ "$Containerlibc" = "glibc" ] && {
- 84 mkdir -p /usr/share/zoneinfo/America
- 85 cp '/x11docker/libc.localtime' '/usr/share/zoneinfo/America/Los_Angeles'
- 86 }
- 87 [ -e '/usr/share/zoneinfo/America/Los_Angeles' ] && ln -f -s '/usr/share/zoneinfo/America/Los_Angeles' /etc/localtime
- 88
- 89 # Container system
- 90 Containersystem="$(grep '^ID=' /etc/os-release 2>/dev/null | cut -d= -f2 || echo 'unknown')"
- 91 verbose "Container system ID: $Containersystem"
- 92
- 93 # Environment variables
- 94 export 'container=docker'
- 95 export 'XAUTHORITY=/x11docker/Xauthority.client'
- 96 export 'DISPLAY=:0'
- 97 export 'XDG_RUNTIME_DIR=/tmp/XDG_RUNTIME_DIR'
- 98
- 99 # Check container user
- 100 Containeruser="$(storeinfo dump containeruser)"
- 101
- 102 mkdir -v -m 777 /fakehome
- 103 Containeruserhome='/fakehome/ignacio'
- 104
- 105 # Create user entry in /etc/passwd (and delete possibly existing same uid)
- 106 cat /etc/passwd | grep -v ':738202:' > /tmp/passwd
- 107
- 108 # Disable possible /etc/shadow passwords for other users
- 109 sed -i 's%:x:%:-:%' /tmp/passwd
- 110 echo 'ignacio:x:738202:89939:ignacio,,,:/fakehome/ignacio:/bin/sh' >> /tmp/passwd
- 111
- 112 rm /etc/passwd
- 113 mv /tmp/passwd /etc/passwd || warning 'Unable to change /etc/passwd. That may be a security risk.'
- 114
- 115 # Create password entry for container user in /etc/shadow
- 116 rm -v /etc/shadow || warning 'Cannot change /etc/shadow. That may be a security risk.'
- 117 echo "ignacio:sac19FwGGTx/A:17293:0:99999:7:::" > /etc/shadow
- 118 echo 'root:*:17219:0:99999:7:::' >> /etc/shadow
- 119
- 120 # Create user group entry (and delete possibly existing same gid)
- 121 cat /etc/group | grep -v ':89939:' > /tmp/group
- 122 echo "primarygroup:x:89939:" >> /tmp/group
- 123 mv /tmp/group /etc/group
- 124
- 125 # Create /etc/sudoers, delete /etc/sudoers.d. Overwrite possible sudo setups in image.
- 126 [ -e /etc/sudoers.d ] && rm -v -R /etc/sudoers.d
- 127 [ -e /etc/sudoers ] && rm -v /etc/sudoers
- 128 echo '# /etc/sudoers created by x11docker' > /etc/sudoers
- 129 echo 'root ALL=(ALL) ALL' >> /etc/sudoers
- 130
- 131 # Restrict PAM configuration of su and sudo
- 132 mkdir -p /etc/pam.d
- 133 [ -e /etc/pam.d/sudo ] && rm -v /etc/pam.d/sudo
- 134 case "$Containersystem" in
- 135 fedora)
- 136 echo '#%PAM-1.0' > /etc/pam.d/su
- 137 echo 'auth sufficient pam_rootok.so' >> /etc/pam.d/su
- 138 echo 'account sufficient pam_succeed_if.so uid = 0 use_uid quiet' >> /etc/pam.d/su
- 139 echo 'session include system-auth' >> /etc/pam.d/su
- 140 ;;
- 141 *)
- 142 echo '#%PAM-1.0' > /etc/pam.d/su
- 143 echo 'auth sufficient pam_rootok.so' >> /etc/pam.d/su # allow root to switch user without a password
- 144 echo '@include common-auth' >> /etc/pam.d/su
- 145 echo '@include common-account' >> /etc/pam.d/su
- 146 echo '@include common-session' >> /etc/pam.d/su
- 147 ;;
- 148 esac
- 149
- 150 # Set up container user groups
- 151 Groupname="video"
- 152 Groupid="44"
- 153 [ "$Groupname" ] || Groupname="$(cat /etc/group | grep "video" | cut -d: -f1)"
- 154 [ "$Groupid" ] || Groupid="$(cat /etc/group | grep "video" | cut -d: -f3)"
- 155 [ "$Groupname" ] && {
- 156 cat /etc/group | sed "s/^$Groupname.*/$Groupname:x:$Groupid:$(cat /etc/group | grep "$Groupname:.:" | cut -d: -f4 ),$Containeruser/" | sed 's/:,/:/' > /tmp/group
- 157 cat /etc/group | grep -q "$Groupname:.:" || echo "$Groupname:x:$Groupid:$Containeruser" >> /tmp/group
- 158 cp /tmp/group /etc/group
- 159 } || note 'Failed to add container user to group video.'
- 160
- 161 Groupname="render"
- 162 Groupid="108"
- 163 [ "$Groupname" ] || Groupname="$(cat /etc/group | grep "render" | cut -d: -f1)"
- 164 [ "$Groupid" ] || Groupid="$(cat /etc/group | grep "render" | cut -d: -f3)"
- 165 [ "$Groupname" ] && {
- 166 cat /etc/group | sed "s/^$Groupname.*/$Groupname:x:$Groupid:$(cat /etc/group | grep "$Groupname:.:" | cut -d: -f4 ),$Containeruser/" | sed 's/:,/:/' > /tmp/group
- 167 cat /etc/group | grep -q "$Groupname:.:" || echo "$Groupname:x:$Groupid:$Containeruser" >> /tmp/group
- 168 cp /tmp/group /etc/group
- 169 } || note 'Failed to add container user to group render.'
- 170
- 171 [ -e "$Containeruserhome" ] || {
- 172 # only create HOME here if capability CHOWN is allowed.
- 173 :>/tmp/chowntestfile
- 174 chown "$Containeruser" /tmp/chowntestfile && {
- 175 mkdir -v -p "$Containeruserhome"
- 176 chown "$Containeruser" "$Containeruserhome"
- 177 }
- 178 rm /tmp/chowntestfile
- 179 }
- 180
- 181 rocknroll || exit 64
- 182
- 183
- 184 # disable getty in inittab
- 185 [ -e /etc/inittab ] && sed -i 's/.*getty/##getty disabled by x11docker## \0/' /etc/inittab
- 186
- 187
- 188 rocknroll || exit 64
- 189
- 190 storeinfo containerrootrc=ready
- 191
- x11docker[07:56:04,991]: Generated xinitrc:
- 1 #! /bin/sh
- 2 disable_xhost ()
- 3 {
- 4 local Line=;
- 5 command -v xhost > /dev/null || {
- 6 warning "Command 'xhost' not found.
- 7 Can not check for possibly allowed network access to X.
- 8 Please install 'xhost'.";
- 9 return 1
- 10 };
- 11 xhost 2>&1 | tail -n +2 /dev/stdin | while read -r Line; do
- 12 debugnote "xhost: Removing entry $Line";
- 13 xhost -$Line;
- 14 done;
- 15 xhost -;
- 16 [ "$(xhost 2>&1 | wc -l)" -gt "1" ] && {
- 17 warning "Remaining xhost permissions found on display ${DISPLAY:-}
- 18 $(xhost 2>&1 )";
- 19 return 1
- 20 };
- 21 xhost 2>&1 | grep "access control disabled" && {
- 22 warning "Failed to restrict xhost permissions.
- 23 Access to display ${DISPLAY:-} is allowed for everyone.";
- 24 return 1
- 25 };
- 26 return 0
- 27 }
- 28 pspid ()
- 29 {
- 30 LC_ALL=C ps -p "${1:-}" 2> /dev/null | grep -v 'TIME'
- 31 }
- 32 rocknroll ()
- 33 {
- 34 [ -s "$Timetosaygoodbyefile" ] && return 1;
- 35 [ -e "$Timetosaygoodbyefile" ] || return 1;
- 36 return 0
- 37 }
- 38 storeinfo ()
- 39 {
- 40 [ -e "$Storeinfofile" ] || return 1;
- 41 case "${1:-}" in
- 42 dump)
- 43 grep "^${2:-}=" $Storeinfofile | sed "s/^${2:-}=//"
- 44 ;;
- 45 drop)
- 46 sed -i "/^${2:-}=/d" $Storeinfofile
- 47 ;;
- 48 test)
- 49 grep -q "^${2:-}=" $Storeinfofile
- 50 ;;
- 51 *)
- 52 debugnote "storeinfo(): ${1:-}";
- 53 grep -q "^$(echo "${1:-}" | cut -d= -f1)=" $Storeinfofile && {
- 54 sed -i "/^$(echo "${1:-}" | cut -d= -f1)=/d" $Storeinfofile
- 55 };
- 56 echo "${1:-}" >> $Storeinfofile
- 57 ;;
- 58 esac
- 59 }
- 60 storepid ()
- 61 {
- 62 case "${1:-}" in
- 63 dump)
- 64 grep -w "${2:-}" "$Storepidfile" | cut -d' ' -f1
- 65 ;;
- 66 test)
- 67 grep -q -w "${2:-}" "$Storepidfile"
- 68 ;;
- 69 *)
- 70 echo "${1:-NOPID}" "${2:-NONAME}" >> "$Storepidfile";
- 71 debugnote "storepid(): Stored pid '${1:-}' of '${2:-}': $(pspid ${1:-} ||:)"
- 72 ;;
- 73 esac
- 74 }
- 75
- 76 warning() {
- 77 echo "$*:WARNING" | sed "s/\$/ /" >>$Messagefile
- 78 }
- 79 note() {
- 80 echo "$*:NOTE" | sed "s/\$/ /" >>$Messagefile
- 81 }
- 82 verbose() {
- 83 echo "$*:VERBOSE" | sed "s/\$/ /" >>$Messagefile
- 84 }
- 85 debugnote() {
- 86 echo "$*:DEBUGNOTE" | sed "s/\$/ /" >>$Messagefile
- 87 }
- 88 error() {
- 89 echo "$*:ERROR" | sed "s/\$/ /" >>$Messagefile
- 90 exit 64
- 91 }
- 92 stdout() {
- 93 echo "$*:STDOUT" | sed "s/\$/ /" >>$Messagefile
- 94 }
- 95 getscreensize() {
- 96 CurrentXaxis="$(xrandr | grep primary | cut -d' ' -f4 | cut -dx -f1 )"
- 97 CurrentYaxis="$(xrandr | grep primary | cut -d' ' -f4 | cut -dx -f2 | cut -d+ -f1)"
- 98 }
- 99 checkscreensize() {
- 100 getscreensize
- 101 [ "$Xaxis" = "$CurrentXaxis" ] || return 1
- 102 [ "$Yaxis" = "$CurrentYaxis" ] || return 1
- 103 return 0
- 104 }
- 105 getprimary() {
- 106 xrandr | grep -q primary || xrandr --output $(xrandr | grep ' connected' | head -n1 | cut -d' ' -f1) --primary
- 107 echo $(xrandr | grep primary | cut -d' ' -f1)
- 108 }
- 109
- 110 Messagefile='/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/message.fifo'
- 111 Output="$(getprimary)"
- 112 Storeinfofile='/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/store.info'
- 113 Storepidfile='/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/store.pids'
- 114 Timetosaygoodbyefile='/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/timetosaygoodbye'
- 115
- 116 export PATH='/usr/local/buildtools/java/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games'
- 117 export DISPLAY=:0 XAUTHORITY=/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client XSOCKET=/tmp/.X11-unix/X0 XDG_RUNTIME_DIR=/run/user/738202
- 118
- 119 Cookie=''
- 120 Line=''
- 121 Var=''
- 122
- 123 debugnote 'Running xinitrc'
- 124
- 125 # background color
- 126
- 127 # create new XAUTHORITY cookies
- 128 :> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client
- 129
- 130 export XAUTHORITY=/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/Xauthority.host.0
- 131 xhost | grep -q 'SI:localuser:ignacio' || { xhost +SI:localuser:ignacio ; Xhostentry='yes' ; }
- 132
- 133 echo 'Requesting trusted cookie from X server'
- 134 xauth -v -i -f /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client generate :0 . trusted timeout 3600
- 135
- 136 [ -s '/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client' ] || {
- 137 [ 'trusted' = 'untrusted' ] && note 'Could not create untrusted cookie.
- 138 Maybe your X server misses extension SECURITY.'
- 139 [ 'trusted' = 'untrusted' ] && warning 'SECURITY RISK! Keylogging and remote host control
- 140 may be possible! Better avoid using option --hostdisplay,
- 141 rather use --xpra or --nxagent.'
- 142 cp /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/Xauthority.host.0 /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client
- 143 }
- 144 [ -s '/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client' ] || {
- 145 # still no cookie? try to create one without extension security
- 146 debugnote 'xinitrc: Failed to retrieve trusted cookie from X server. Will bake one myself.'
- 147 echo 'Failed to retrieve trusted cookie from X server. Will bake one myself.'
- 148 xauth -v -i -f /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client add :0 . 2846f1c5695bee96fbe76f84d686a0bf
- 149 ls -l /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client
- 150 }
- 151
- 152 # Prepare cookie with localhost identification disabled by ffff, needed if X socket is shared. ffff means 'familiy wild'
- 153 Cookie="$(xauth -i -f /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client nlist | sed -e 's/^..../ffff/')"
- 154 echo "$Cookie" | xauth -v -i -f /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client nmerge -
- 155
- 156 debugnote "xinitrc: Created cookie: $(xauth -f /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client list 2>&1)"
- 157 ls -l /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client
- 158 cp /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/Xauthority.server
- 159 chmod 644 /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client
- 160
- 161 [ -s '/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client' ] || warning 'Cookie creation failed!'
- 162 [ '$Xhostentry' = 'yes' ] && env XAUTHORITY=/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/Xauthority.host.0 xhost -SI:localuser:ignacio
- 163 export XAUTHORITY=/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client
- 164 [ 'yes' = 'no' ] || [ ! -s '/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client' ] && unset XAUTHORITY && warning '--hostdisplay: X server :0 runs without cookie authentication.'
- 165
- 166 verbose "Output of xrandr on :0
- 167 $(xrandr)"
- 168
- 169 echo 'xinitrc: xinitrc is ready'
- 170 storeinfo xinitrc=ready
- 171
- 172 # wait for the end
- 173 read Var </home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/timetosaygoodbye.fifo
- DEBUGNOTE[07:56:05,015]: Running xtermrc: Ask for password if needed (no)
- DEBUGNOTE[07:56:05,017]: storepid(): Stored pid '142834' of 'containershell': 142834 pts/6 00:00:00 bash
- DEBUGNOTE[07:56:05,026]: waitforlogentry(): start_xserver(): Waiting for logentry "readyforX=ready" in store.info
- DEBUGNOTE[07:56:05,029]: Running dockerrc: Setup as root or as user docker on host.
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/container.log <==
- WARNING: No swap limit support
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/message.log <==
- DEBUGNOTE[07:56:05,143]: dockerrc: Found default Runtime: runc
- DEBUGNOTE[07:56:05,158]: dockerrc: All Runtimes: nvidia runc
- DEBUGNOTE[07:56:05,169]: dockerrc: Container Runtime: nvidia
- DEBUGNOTE[07:56:05,181]: storeinfo(): runtime=nvidia
- DEBUGNOTE[07:56:05,281]: dockerrc: Image CMD: /bin/sh -c /usr/lib/rstudio/bin/rstudio
- DEBUGNOTE[07:56:05,294]: dockerrc: Image USER: developer
- 1 #! /bin/sh
- 2
- 3 # containerrc
- 4 # Created startscript for docker run used as container command.
- 5 # Runs as unprivileged user in container.
- 6
- 7 exec 6>&1 7>&2
- 8 exec >>/x11docker/container.log 2>&1
- 9
- 10 mysleep ()
- 11 {
- 12 sleep "${1:-1}" 2> /dev/null || sleep 1
- 13 }
- 14 rocknroll ()
- 15 {
- 16 [ -s "$Timetosaygoodbyefile" ] && return 1;
- 17 [ -e "$Timetosaygoodbyefile" ] || return 1;
- 18 return 0
- 19 }
- 20 saygoodbye ()
- 21 {
- 22 debugnote "time to say goodbye ($*)";
- 23 [ -e "$Timetosaygoodbyefile" ] && echo timetosaygoodbye >> $Timetosaygoodbyefile;
- 24 [ -e "$Timetosaygoodbyefifo" ] && echo timetosaygoodbye >> $Timetosaygoodbyefifo
- 25 }
- 26 storeinfo ()
- 27 {
- 28 [ -e "$Storeinfofile" ] || return 1;
- 29 case "${1:-}" in
- 30 dump)
- 31 grep "^${2:-}=" $Storeinfofile | sed "s/^${2:-}=//"
- 32 ;;
- 33 drop)
- 34 sed -i "/^${2:-}=/d" $Storeinfofile
- 35 ;;
- 36 test)
- 37 grep -q "^${2:-}=" $Storeinfofile
- 38 ;;
- 39 *)
- 40 debugnote "storeinfo(): ${1:-}";
- 41 grep -q "^$(echo "${1:-}" | cut -d= -f1)=" $Storeinfofile && {
- 42 sed -i "/^$(echo "${1:-}" | cut -d= -f1)=/d" $Storeinfofile
- 43 };
- 44 echo "${1:-}" >> $Storeinfofile
- 45 ;;
- 46 esac
- 47 }
- 48 waitforlogentry ()
- 49 {
- 50 local Startzeit Uhrzeit Dauer Count=0 Schlaf;
- 51 local Errorkeys="${4:-}";
- 52 local Warten="${5:-60}";
- 53 Startzeit="$(date +%s ||:)";
- 54 Startzeit="${Startzeit:-0}";
- 55 [ "$Warten" = "infinity" ] && Warten=32000;
- 56 debugnote "waitforlogentry(): ${1:-}: Waiting for logentry \"${3:-}\" in $(basename ${2:-})";
- 57 while ! grep -q "${3:-}" < "${2:-}"; do
- 58 Count="$(( $Count + 1 ))";
- 59 Uhrzeit="$(date +%s ||:)";
- 60 Uhrzeit="${Uhrzeit:-0}";
- 61 Dauer="$(( $Uhrzeit - $Startzeit ))";
- 62 Schlaf="$(( $Count / 10 ))";
- 63 [ "$Schlaf" = "0" ] && Schlaf="0.5";
- 64 mysleep "$Schlaf";
- 65 [ "$Dauer" -gt "10" ] && debugnote "waitforlogentry(): ${1:-}: Waiting since ${Dauer}s for log entry \"${3:-}\" in $(basename ${2:-})";
- 66 [ "$Dauer" -gt "$Warten" ] && error "waitforlogentry(): ${1:-}: Timeout waiting for log entry \"${3:-}\" in $(basename ${2:-})
- 67 Last lines of logfile $(basename ${2:-}):
- 68 $(tail "${2:-}")";
- 69 [ "$Errorkeys" ] && grep -i -q -E "$Errorkeys" < "${2:-}" && error "waitforlogentry(): ${1:-}: Found error message in logfile.
- 70 Last lines of logfile $(basename ${2:-}):
- 71 $(tail "${2:-}")";
- 72 rocknroll || {
- 73 debugnote "waitforlogentry(): ${1:-}: Stopped waiting for ${3:-} in $(basename ${2:-}) due to terminating signal.";
- 74 return 1
- 75 };
- 76 done;
- 77 debugnote "waitforlogentry(): ${1:-}: Found log entry \"${3:-}\" in $(basename ${2:-}).";
- 78 return 0
- 79 }
- 80 calculate() {
- 81 LC_ALL=C printf %.3f\\n "$((10**9 * $@))e-9"
- 82 }
- 83
- 84 warning() {
- 85 echo "$*:WARNING" | sed "s/\$/ /" >>$Messagefile
- 86 }
- 87 note() {
- 88 echo "$*:NOTE" | sed "s/\$/ /" >>$Messagefile
- 89 }
- 90 verbose() {
- 91 echo "$*:VERBOSE" | sed "s/\$/ /" >>$Messagefile
- 92 }
- 93 debugnote() {
- 94 echo "$*:DEBUGNOTE" | sed "s/\$/ /" >>$Messagefile
- 95 }
- 96 error() {
- 97 echo "$*:ERROR" | sed "s/\$/ /" >>$Messagefile
- 98 exit 64
- 99 }
- 100 stdout() {
- 101 echo "$*:STDOUT" | sed "s/\$/ /" >>$Messagefile
- 102 }
- 103 Messagefile=/x11docker/message.fifo
- 104 Storeinfofile=/x11docker/store.info
- 105 Timetosaygoodbyefile=/x11docker/timetosaygoodbye
- 106
- 107 waitforlogentry containerrc $Storeinfofile containerrootrc=ready infinity
- 108 debugnote "Running containerrc: Unprivileged user commands in container"
- 109
- 110 Containercommand="/bin/sh -c /usr/lib/rstudio/bin/rstudio"
- 111 Entrypoint=""
- 112
- 113 verbose "containerrc: Container system:
- 114 $(cat /etc/os-release 2>&1 ||:)"
- 115
- 116
- 117 # USER and HOME
- 118 Containeruser="$(storeinfo dump containeruser)"
- 119 Containeruserhome="/fakehome/ignacio"
- 120 export USER="$Containeruser"
- 121 export HOME="$Containeruserhome"
- 122
- 123 # XDG_RUNTIME_DIR
- 124 Containeruseruid=$(id -u $Containeruser)
- 125 export XDG_RUNTIME_DIR=/tmp/XDG_RUNTIME_DIR
- 126 [ -e /run/user/$Containeruseruid ] && ln -s /run/user/$Containeruseruid $XDG_RUNTIME_DIR || mkdir -p -m700 $XDG_RUNTIME_DIR
- 127
- 128 mkdir -p $Containeruserhome
- 129 # Copy files from /etc/skel into empty HOME
- 130 [ -d /etc/skel ] && [ -z "$(ls -A "/fakehome/ignacio" 2>/dev/null | grep -v gnupg)" ] && {
- 131 debugnote "containerrc: HOME is empty. Copying from /etc/skel"
- 132 cp -n -R /etc/skel/. $Containeruserhome
- 133 :
- 134 } || {
- 135 debugnote "containerrc: HOME not empty. Not copying from /etc/skel"
- 136 }
- 137
- 138 # Create softlink to X unix socket
- 139 [ -e /tmp/.X11-unix/X0 ] || ln -s /X0 /tmp/.X11-unix
- 140
- 141 unset WAYLAND_DISPLAY
- 142
- 143 export XDG_SESSION_TYPE=x11
- 144
- 145
- 146 bash --version >/dev/null 2>&1 && export SHELL=/bin/bash || export SHELL=/bin/sh
- 147 export TERM=xterm
- 148 storeinfo test locale && export LANG="$(storeinfo dump locale)"
- 149 [ -e "/usr/share/zoneinfo/America/Los_Angeles" ] || export TZ=UTC+08
- 150 [ "$(date -Ihours)" != "2019-11-15T07-08:00" ] && export TZ=UTC+08
- 151 [ "$DEBIAN_FRONTEND" = noninteractive ] && unset DEBIAN_FRONTEND && export DEBIAN_FRONTEND
- 152 [ "$DEBIAN_FRONTEND" = newt ] && unset DEBIAN_FRONTEND && export DEBIAN_FRONTEND
- 153 # container environment (--env)
- 154 export 'container=docker'
- 155 export 'XAUTHORITY=/x11docker/Xauthority.client'
- 156 export 'DISPLAY=:0'
- 157 export 'XDG_RUNTIME_DIR=/tmp/XDG_RUNTIME_DIR'
- 158
- 159 env >> /x11docker/container.environment
- 160 verbose "Container environment:
- 161 $(env | sort)"
- 162
- 163 cd "$HOME"
- 164 [ -d "/home/developer" ] && cd "/home/developer" # WORKDIR in image
- 165
- 166 debugnote "containerrc: Running container command:
- 167 $Dbus /bin/sh -c /usr/lib/rstudio/bin/rstudio
- 168 "
- 169
- 170 exec 1>&6 2>&7 6>&- 7>&-
- 171 $Dbus /bin/sh -c /usr/lib/rstudio/bin/rstudio >>/x11docker/stdout 2>>/x11docker/stderr
- 172 storeinfo cmdexitcode=$?
- x11docker note: Found 'USER developer' in image.
- If you want to run with user developer instead of host user ignacio,
- than run with --user=RETAIN.
- DEBUGNOTE[07:56:05,324]: storeinfo(): containeruser=ignacio
- DEBUGNOTE[07:56:05,340]: dockerrc: Image ENTRYPOINT:
- DEBUGNOTE[07:56:05,354]: dockerrc: Image WORKDIR: /home/developer
- x11docker note: Found 'WORKDIR /home/developer' in image.
- You can change it with option --workdir=DIR.
- DEBUGNOTE[07:56:05,376]: storeinfo(): readyforX=ready
- DEBUGNOTE[07:56:05,388]: waitforlogentry(): dockerrc: Waiting for logentry "xinitrc is ready" in xinit.log
- DEBUGNOTE[07:56:05,543]: waitforlogentry(): start_xserver(): Found log entry "readyforX=ready" in store.info.
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/xinit.log <==
- Requesting trusted cookie from X server
- Ignoring locks on authority file /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client
- authorization id is 1248
- Ignoring locks and writing authority file /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client
- Ignoring locks on authority file /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client
- 1 entries read in: 0 new, 1 replacement
- Ignoring locks and writing authority file /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/message.log <==
- DEBUGNOTE[07:56:05,585]: Running xinitrc
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/xinit.log <==
- -rw------- 1 ignacio primarygroup 75 Nov 15 07:56 /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/message.log <==
- DEBUGNOTE[07:56:05,600]: xinitrc: Created cookie: #ffff#6d617274696e657a69672e73666f2e636f72702e676f6f676c652e636f6d#:0 MIT-MAGIC-COOKIE-1 55066642a1ee66acb6ef2a556c766716
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/xinit.log <==
- xinitrc: xinitrc is ready
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/message.log <==
- x11docker[07:56:05,692]: Output of xrandr on :0
- Screen 0: minimum 8 x 8, current 3840 x 2160, maximum 32767 x 32767
- DP-0 disconnected (normal left inverted right x axis y axis)
- DP-1 disconnected (normal left inverted right x axis y axis)
- DP-2 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 708mm x 398mm
- 3840x2160 60.00*+ 30.00
- 2560x1440 59.95
- 1920x2160 59.99
- 1920x1200 59.88
- 1920x1080 60.00 60.00 59.94 50.00
- 1680x1050 59.95
- 1600x900 60.00
- 1440x900 59.89
- 1440x576 50.00
- 1440x480 59.94
- 1280x1024 60.02
- 1280x800 59.81
- 1280x720 60.00 59.94 50.00
- 1024x768 60.00
- 800x600 60.32
- 720x576 50.00
- 720x480 59.94
- 640x480 75.00 59.94 59.93
- DP-3 disconnected (normal left inverted right x axis y axis)
- DP-4 disconnected (normal left inverted right x axis y axis)
- DP-5 disconnected (normal left inverted right x axis y axis)
- DP-6 disconnected (normal left inverted right x axis y axis)
- DP-7 disconnected (normal left inverted right x axis y axis)
- DEBUGNOTE[07:56:05,707]: storeinfo(): xinitrc=ready
- DEBUGNOTE[07:56:05,846]: waitforlogentry(): dockerrc: Found log entry "xinitrc is ready" in xinit.log.
- DEBUGNOTE[07:56:06,412]: waitforlogentry(): containerrc: Waiting for logentry "containerrootrc=ready" in store.info
- DEBUGNOTE[07:56:06,424]: storeinfo(): containerid=66327248d3615e71476cbb4b965905a97b73ab1620dcca316e8ff725ed7618f6
- DEBUGNOTE[07:56:06,559]: dockerrc: Container is up and running.
- DEBUGNOTE[07:56:06,603]: dockerrc: 1. check for PID 1: 143360
- DEBUGNOTE[07:56:06,613]: storeinfo(): pid1pid=143360
- DEBUGNOTE[07:56:06,657]: storeinfo(): containerip=192.168.9.2
- DEBUGNOTE[07:56:06,908]: Running containerrootrc: Setup as root in container
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/container.log <==
- mkdir: created directory '/var/lib/dbus'
- mkdir: created directory '/var/run/dbus'
- mkdir: created directory '/tmp/.ICE-unix'
- mkdir: created directory '/tmp/.X11-unix'
- mkdir: created directory '/tmp/.font-unix'
- srwxrwxrwx 1 root root 0 Nov 11 15:53 /X0
- lrwxrwxrwx 1 root root 3 Nov 15 15:56 /tmp/.X11-unix/X0 -> /X0
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/message.log <==
- DEBUGNOTE[07:56:06,926]: containerrootrc: Container libc: glibc
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/container.log <==
- mkdir: created directory '/fakehome'
- removed '/etc/shadow'
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/message.log <==
- x11docker[07:56:06,946]: Container system ID: ubuntu
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/container.log <==
- chown: changing ownership of '/tmp/chowntestfile': Operation not permitted
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/message.log <==
- DEBUGNOTE[07:56:06,983]: storeinfo(): containerrootrc=ready
- DEBUGNOTE[07:56:07,019]: storeinfo(): dockerrc=ready
- DEBUGNOTE[07:56:07,043]: storepid(): Stored pid '143925' of 'dockerstopshell': 143925 pts/6 00:00:00 bash
- DEBUGNOTE[07:56:07,046]: waitforlogentry(): start_docker(): Waiting for logentry "dockerrc=ready" in store.info
- DEBUGNOTE[07:56:07,053]: waitforlogentry(): start_docker(): Found log entry "dockerrc=ready" in store.info.
- DEBUGNOTE[07:56:07,055]: storeinfo(): xtermrc=ready
- DEBUGNOTE[07:56:07,060]: watchpidlist(): Setting pid 143360 on watchlist: pid1pid
- DEBUGNOTE[07:56:07,080]: watchpidlist(): Watching pids:
- 143360 pts/0 00:00:00 tini
- DEBUGNOTE[07:56:07,083]: storepid(): Stored pid '143360' of 'pid1pid': 143360 pts/0 00:00:00 tini
- DEBUGNOTE[07:56:07,197]: Process tree of container: (maybe not complete yet)
- tini(143360)---sh(143418)---sleep(143806)
- DEBUGNOTE[07:56:07,432]: waitforlogentry(): containerrc: Found log entry "containerrootrc=ready" in store.info.
- DEBUGNOTE[07:56:07,438]: Process tree of x11docker:
- bash(141478)-+-bash(141894)---tail(141897)
- |-bash(141896)---sleep(144033)
- |-bash(141898)---sleep(144032)
- |-bash(141917)
- |-bash(141931)
- |-bash(142834)---bash(144037)---pstree(144038)
- `-bash(143179)
- Lost child of dockerrc (dockerstopshell):
- bash(143925)
- DEBUGNOTE[07:56:07,443]: storeinfo(): Stored info:
- cache=/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491
- stdout=/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/stdout
- stderr=/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/stderr
- x11dockerpid=141478
- xserver=--hostdisplay
- DISPLAY=:0
- XAUTHORITY=/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client
- XSOCKET=/tmp/.X11-unix/X0
- XDG_RUNTIME_DIR=/run/user/738202
- Xenv= DISPLAY=:0 XAUTHORITY=/home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/Xauthority.client XSOCKET=/tmp/.X11-unix/X0 XDG_RUNTIME_DIR=/run/user/738202
- tini=/usr/bin/docker-init
- containername=x11docker_X0_rstudioxhost-verse_33362576491
- runtime=nvidia
- containeruser=ignacio
- readyforX=ready
- xinitrc=ready
- containerid=66327248d3615e71476cbb4b965905a97b73ab1620dcca316e8ff725ed7618f6
- pid1pid=143360
- containerip=192.168.9.2
- containerrootrc=ready
- dockerrc=ready
- xtermrc=ready
- DEBUGNOTE[07:56:07,443]: Running containerrc: Unprivileged user commands in container
- DEBUGNOTE[07:56:07,448]: storepid(): Stored pids:
- 141917 watchpidlist
- 141931 watchmessagefifo
- 142834 containershell
- 143925 dockerstopshell
- 143360 pid1pid
- DEBUGNOTE[07:56:07,451]: storeinfo(): x11docker=ready
- x11docker[07:56:07,481]: containerrc: Container system:
- NAME="Ubuntu"
- VERSION="18.04.3 LTS (Bionic Beaver)"
- ID=ubuntu
- ID_LIKE=debian
- PRETTY_NAME="Ubuntu 18.04.3 LTS"
- VERSION_ID="18.04"
- HOME_URL="https://www.ubuntu.com/"
- SUPPORT_URL="https://help.ubuntu.com/"
- BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
- PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
- VERSION_CODENAME=bionic
- UBUNTU_CODENAME=bionic
- DEBUGNOTE[07:56:07,494]: containerrc: HOME is empty. Copying from /etc/skel
- x11docker[07:56:07,547]: Container environment:
- container=docker
- DISPLAY=:0
- HOME=/fakehome/ignacio
- HOSTNAME=66327248d361
- LANG=en_US.UTF-8
- LC_ALL=en_US.UTF-8
- PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
- PWD=/tmp
- SHELL=/bin/bash
- TERM=xterm
- USER=ignacio
- XAUTHORITY=/x11docker/Xauthority.client
- XDG_RUNTIME_DIR=/tmp/XDG_RUNTIME_DIR
- XDG_SESSION_TYPE=x11
- DEBUGNOTE[07:56:07,565]: containerrc: Running container command:
- /bin/sh -c /usr/lib/rstudio/bin/rstudio
- DEBUGNOTE[07:56:07,607]: waitforlogentry(): tailstderr: Found log entry "x11docker=ready" in store.info.
- DEBUGNOTE[07:56:07,610]: waitforlogentry(): tailstdout: Found log entry "x11docker=ready" in store.info.
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/share/stderr <==
- libGL error: No matching fbConfigs or visuals found
- libGL error: failed to load driver: swrast
- WebEngineContext used before QtWebEngine::initialize() or OpenGL context creation failed.
- Failed to create OpenGL context for format QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::DefaultSwapBehavior, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::NoProfile)
- Received signal 6
- #0 0x7f0e60755a4f <unknown>
- #1 0x7f0e60755e4b <unknown>
- #2 0x7f0e607564ce <unknown>
- #3 0x7f0e5b9be890 <unknown>
- #4 0x7f0e59d33e97 gsignal
- #5 0x7f0e59d35801 abort
- #6 0x7f0e5bc50dcc QMessageLogger::fatal()
- #7 0x7f0e5940fafc QQuickWidgetPrivate::handleContextCreationFailure()
- #8 0x7f0e5940fcfa QQuickWidgetPrivate::createContext()
- #9 0x7f0e59411e86 QQuickWidget::resizeEvent()
- #10 0x7f0e65e3f98d QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget::resizeEvent()
- #11 0x7f0e5cdb4ea2 QWidget::event()
- #12 0x7f0e59412acb QQuickWidget::event()
- #13 0x7f0e65e3fc88 QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget::event()
- #14 0x7f0e5cd76b3c QApplicationPrivate::notify_helper()
- #15 0x7f0e5cd7dd30 QApplication::notify()
- #16 0x7f0e5be3de28 QCoreApplication::notifyInternal2()
- #17 0x7f0e5cdad63d QWidgetPrivate::sendPendingMoveAndResizeEvents()
- #18 0x7f0e5cdb11b3 QWidgetPrivate::show_helper()
- #19 0x7f0e5cdb4375 QWidget::setVisible()
- #20 0x7f0e5ec88fb6 QtWebEngineCore::WebContentsAdapter::initialize()
- #21 0x7f0e5ec8b21e QtWebEngineCore::WebContentsAdapter::load()
- #22 0x7f0e5ec8bb50 QtWebEngineCore::WebContentsAdapter::load()
- #23 0x561d697d10ac rstudio::desktop::SessionLauncher::launchFirstSession()
- #24 0x561d697d255b rstudio::desktop::SessionLauncher::onLaunchFirstSession()
- #25 0x7f0e5be6a801 QObject::event()
- #26 0x7f0e5cd76b3c QApplicationPrivate::notify_helper()
- #27 0x7f0e5cd7dd30 QApplication::notify()
- #28 0x7f0e5be3de28 QCoreApplication::notifyInternal2()
- #29 0x7f0e5be40857 QCoreApplicationPrivate::sendPostedEvents()
- #30 0x7f0e5be95bb3 postEventSourceDispatch()
- #31 0x7f0e531b8417 g_main_context_dispatch
- #32 0x7f0e531b8650 <unknown>
- #33 0x7f0e531b86dc g_main_context_iteration
- #34 0x7f0e5be951ef QEventDispatcherGlib::processEvents()
- #35 0x7f0e5be3c78a QEventLoop::exec()
- #36 0x7f0e5be45190 QCoreApplication::exec()
- #37 0x561d69790a0f main
- #38 0x7f0e59d16b97 __libc_start_main
- #39 0x561d69793d8a _start
- r8: 0000000000000000 r9: 00007ffe1b93c140 r10: 0000000000000008 r11: 0000000000000246
- r12: 00007ffe1b93c470 r13: 0000561d6b165400 r14: 0000561d6b165400 r15: 00007ffe1b93c9e0
- di: 0000000000000002 si: 00007ffe1b93c140 bp: 0000561d6b165400 bx: 00007f0e5bf60e80
- dx: 0000000000000000 ax: 0000000000000000 cx: 00007f0e59d33e97 sp: 00007ffe1b93c140
- ip: 00007f0e59d33e97 efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
- trp: 0000000000000000 msk: 0000000000000000 cr2: 0000000000000000
- [end of stack trace]
- Calling _exit(1). Core file will not be generated.
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-33362576491/message.log <==
- DEBUGNOTE[07:56:09,630]: storeinfo(): cmdexitcode=1
- DEBUGNOTE[07:56:10,086]: watchpidlist(): PID 143360 has terminated
- DEBUGNOTE[07:56:10,090]: time to say goodbye (watchpidlist 143360)
- DEBUGNOTE[07:56:10,096]: time to say goodbye (watchpidlist)
- DEBUGNOTE[07:56:10,097]: time to say goodbye (main)
- DEBUGNOTE[07:56:10,102]: Terminating x11docker.
- DEBUGNOTE[07:56:10,107]: time to say goodbye (finish)
- DEBUGNOTE[07:56:10,143]: finish(): Checking pid 143360 (pid1pid): (already gone)
- DEBUGNOTE[07:56:10,179]: finish(): Checking pid 143925 (dockerstopshell): 143925 pts/6 00:00:00 bash
- DEBUGNOTE[07:56:10,216]: finish(): Checking pid 142834 (containershell): (already gone)
- DEBUGNOTE[07:56:10,255]: finish(): Checking pid 141931 (watchmessagefifo): 141931 pts/6 00:00:00 bash
- DEBUGNOTE[07:56:10,292]: finish(): Checking pid 141917 (watchpidlist): (already gone)
- DEBUGNOTE[07:56:11,386]: termpid(): Terminating 141931 (watchmessagefifo): 141931 pts/6 00:00:00 bash
- DEBUGNOTE[07:56:11,516]: x11docker exit code: 0
- DEBUGNOTE[07:56:11,530]: CMD exit code: 1
Advertisement
Add Comment
Please, Sign In to add comment