x11docker: [Cygwin] Interactive mode does neither gracefully fail nor work

Coming form mviereck/runx#2

Executing /cygdrive/t/x11docker/x11docker x11docker/xfce xfce4-terminal works as expected. However, when option -i is used, x11docker errors while waiting for “xinitrc” to be ready.

$ /cygdrive/t/x11docker/x11docker -i x11docker/xfce bash
x11docker note: Using X server option --xwin

x11docker note: Windows firewall settings can forbid application access
  to the X server. If no application window appears, but no obvious error
  is shown, please check your firewall settings. Compare issue #108 on github.

ls

x11docker ERROR: waitforlogentry(): dockerrc: Timeout waiting for entry "xinitrc is ready" in xinit.log
  Last lines of xinit.log:
winPointerWarpCursor - Discarding first warp: 1920 1080
(--) 5 mouse buttons found
(--) Setting autorepeat to delay=500, rate=31
(--) Windows keyboard layout: "0000040A" (0000040a) "Spanish", type 4
(--) Found matching XKB configuration "Spanish (Spain,Traditional Sort)"
(--) Model = "pc105" Layout = "es" Variant = "none" Options = "none"
Rules = "base" Model = "pc105" Layout = "es" Variant = "none" Options = "none"
winInitMultiWindowWM - DISPLAY=:2453.0
winMultiWindowXMsgProc - DISPLAY=:2453.0
winProcEstablishConnection - Clipboard is not enabled, returning.

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

x11docker.log

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Actually, I think this would be a nice CLI feature for x11docker:

Let’s discuss this in #218

Now x11docker exits for -i without winpty in MSYS2/Cygwin/WSL1. In WSL2 -i might work without winpty, that’ll need a check.

Actually, I use VSCode on Windows, and I have configured the Terminal to use MSYS2. Interestingly, when I start docker from a terminal inside VSC I do NOT need to use winpty. However, if I execute the same command from a regular MSYS2 terminal (outside of VSC) I do need to use winpty. Honestly, I doubt that VSC is silently using MSYS2’s winpty. Instead, I’d say that VSC has some built-in fake tty implemented in JavaScript/TypeScript.

In general x11docker tries to return the exit code of the container application. From x11docker --help:

  0:     Success
  64:    x11docker error
  130:   Terminated by ctrl-c
  other: Exit code of command in container

<strike>Yes. The numbers were made up. My proposal is to add another item to that list, which is x11docker caution. This is when x11docker is able to exit cleanly, but cannot fulfil the options requested by the user. Alternatively, the caution code might be +256, so that it is meaningful even if the container was executed but it exited with a non-zero code.</strike> I realised that codes must be 8bit. Never mind.