X11docker: MSYS2 issue: startup failure and no logfile

Created on 19 Feb 2020  路  6Comments  路  Source: mviereck/x11docker

Coming from #219:

Short summary:
In MSYS2 x11docker fails to start the container.
Command:

/t/x11docker/x11docker --runx --no-auth x11docker/xfce xfce4-terminal

Error message:

C:\Program Files\Docker\Docker\resources\bin\docker.exe: Error response from daemon: file does not exist.
See 'C:\Program Files\Docker\Docker\resources\bin\docker.exe run --help'.

Generated docker command:

 docker.exe run --tty --rm --detach \
  --name x11docker_X3178_x11docker-xfce-xfce4-terminal_11809315510 \
  --user 197609:197121 \
  --env USER=eine \
  --userns host \
  --cap-drop ALL \
  --security-opt no-new-privileges \
  --security-opt label=type:container_runtime_t \
  --init \
  --tmpfs /run --tmpfs /run/lock \
  --volume '/c/msys64//home/eine/.cache/x11docker/x11docker-xfce-xfce4-terminal-11809315510/share':'/x11docker':rw \
  --workdir '/tmp' \
  --entrypoint env \
  --env 'container=docker' \
  --env 'XAUTHORITY=/x11docker/Xauthority.client' \
  --env 'DISPLAY=10.0.75.1:3178' \
  --env 'XDG_RUNTIME_DIR=/tmp/XDG_RUNTIME_DIR' \
  -- x11docker/xfce  /bin/sh - /x11docker/containerrc

Latest x11docker master does not give a logile in ~/.cache/x11docker.

MS Windows bug

All 6 comments

I tried to copy the generated command as is, but it seems that paths need to be escaped:

C:\Program Files\Docker\Docker\resources\bin\docker.exe: Error response from daemon: the working directory 'C:/msys64/tmp' is invalid, it needs to be an absolute path.
See 'C:\Program Files\Docker\Docker\resources\bin\docker.exe run --help'

So, //c/msys64//home/eine/.cache/x11docker/x11docker-xfce-xfce4-terminal-11809315510/share, //x11docker, //tmp, etc.

it seems that paths need to be escaped:

x11docker runs export MSYS2_ARG_CONV_EXCL='*' before running docker. That disables MSYS2 path conversion and // is not needed.

If we could have the log saved to some other location (say cwd/pwd), that would help us understand which commands are being passed. However, it's odd because a folder is properly created and removed in ~/.cache/x11docker/*

I've added an option --keepcache that preserves the cache folder. In its subfolder share is the logfile.

If that does not give anything useful, x11docker could be started with bash -x x11docker .... That gives a bunch of output, but maybe helps.

x11docker runs export MSYS2_ARG_CONV_EXCL='*' before running docker. That disables MSYS2 path conversion and // is not needed.

Ok. With this, I get the expected but unwanted error:

# export MSYS2_ARG_CONV_EXCL='*'

#  docker run --tty --rm --detach \
>   --name x11docker_X3178_x11docker-xfce-xfce4-terminal_11809315510 \
>   --user 197609:197121 \
>   --env USER=eine \
>   --userns host \
>   --cap-drop ALL \
>   --security-opt no-new-privileges \
>   --security-opt label=type:container_runtime_t \
>   --init \
>   --tmpfs /run --tmpfs /run/lock \
>   --volume '/c/msys64//home/eine/.cache/x11docker/x11docker-xfce-xfce4-terminal-11809315510/share':'/x11docker':rw \
>   --workdir '/tmp' \
>   --entrypoint env \
>   --env 'container=docker' \
>   --env 'XAUTHORITY=/x11docker/Xauthority.client' \
>   --env 'DISPLAY=10.0.75.1:3178' \
>   --env 'XDG_RUNTIME_DIR=/tmp/XDG_RUNTIME_DIR' \
>   -- x11docker/xfce  /bin/sh - /x11docker/containerrc

C:\Program Files\Docker\Docker\resources\bin\docker.exe: Error response from daemon: file does not exist.
See 'C:\Program Files\Docker\Docker\resources\bin\docker.exe run --help'.

Actually, replacing /c/msys64//home with /c/msys64/home seems to fix the issue.

Actually, replacing /c/msys64//home with /c/msys64/home seems to fix the issue.

Great news! I did a fix for this. Hopefully there will be no missing / somewhere else.

To verify: Does cygpath.exe -u "c:/" give a path with / at its end?

Great news! I did a fix for this. Hopefully there will be no missing / somewhere else.

It works! I tried both syntaxes, and both are correct now. At the same time, x11docker.log contains relevant content again!

To verify: Does cygpath.exe -u "c:/" give a path with / at its end?

It does:

# MSYS2

# cygpath.exe -u "c:/"
/c/

# Cygwin

$ cygpath.exe -u "c:/"
/cygdrive/c/

It works!

What a relief! At first it looked like a much bigger issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mviereck picture mviereck  路  9Comments

vincent-163 picture vincent-163  路  9Comments

SamLex picture SamLex  路  7Comments

mviereck picture mviereck  路  6Comments

eine picture eine  路  5Comments