-
Notifications
You must be signed in to change notification settings - Fork 379
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
[Cygwin] Interactive mode does neither gracefully fail nor work #217
Comments
The log file shows the successful start of
|
My bad. I run it twice now: |
Thanks! Another issue I see is that the log file shows many entries multiple times. This does not happen on Linux but on Windows only. I have no good idea why that happens. |
I see the message, but it stops there, instead of finishing. $ /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.
x11docker note: Option -i, --interactive: On MS Windows you need 'winpty'
to run x11docker in interactive mode. MSYS2 provides winpty as a package.
On Cygwin it can be compiled from source. WSL isn't supported yet.
Fallback: disabling option --interactive.
DEBUGNOTE[00:51:25,645]: Received SIGINT
DEBUGNOTE[00:51:26,495]: storeinfo(): error=130
DEBUGNOTE[00:51:28,276]: Terminating x11docker.
DEBUGNOTE[00:51:29,149]: time to say goodbye (finish)
DEBUGNOTE[00:51:32,780]: finish(): Checking pid 2679 (containershell): (already gone)
DEBUGNOTE[00:51:35,367]: finish(): Checking pid 1725 (watchmessagefifo): 1725 1183 1183 223208 pty0 197609 00:37:25 /usr/bin/bash
DEBUGNOTE[00:51:37,576]: finish(): Checking pid 1708 (watchpidlist): (already gone)
DEBUGNOTE[00:51:39,361]: finish(): Container still running. Executing 'docker stop'.
Will wait up to 15 seconds for docker to finish.
DEBUGNOTE[00:51:43,055]: finish(): Container terminated successfully
DEBUGNOTE[00:51:46,278]: termpid(): Terminating 1725 (watchmessagefifo): 1725 1183 1183 223208 pty0 197609 00:37:25 /usr/bin/bash
DEBUGNOTE[00:51:48,649]: x11docker exit code: 130 |
This is expected behaviour: bash is running, so x11docker does not terminate. bash is not accessible because Alternatively, x11docker could exit with an error instead of giving a note only. What do you think? |
I believe it should exit. The user is requesting an unsupported configuration which the app (x11docker) cannot handle. It can exit with an error or just a warning, that's up to you. However, not existing is misleading because it might seem that something can be done, and it is not the case. What's the behaviour with other similar contexts? For example, if I want to use |
In similar situations, x11docker gives a note that an option is not possible. It either enables a fallback, if possible (and tells about it), or it disables the option at all, like here with
|
I knew that it would try to fall back for most options, but I thought that it would always exit with error if no suitable solution is found. In this sense, having a different behaviour for Alternatively, it would be possible to change the "last resort" exit code for all options. x11docker could have three valid exit codes: 0 (success), 1 (fail), -1 (warning). Anyway, I understand that this discussion goes beyond the issue. |
Now x11docker exits for
In general x11docker tries to return the exit code of the container application. From
Closing the ticket because all seems to be fixed. Thank you for testing and reporting! |
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.
|
That's interesting. Maybe that VS terminal could run Cygwin and/or WSL1, too. |
Agree. I know that VSCode can WSL through Remote - WSL. However, I am not sure about using either WSL or Cygwin as the terminal. Also, note that I mean VSCode, not VS. Anyway, as you say, it is possible to use xterm, terminator or any other terminal as the first argument to the container. Alternatively, it is possible to start the container with command Actually, I've thought about writing a kind of "Docker command helper extension" for VSC, mostly meant to make using x11docker easier. It would allow to easily write/save/modify commands such as |
Maybe Are you aware that |
I guess the tricky part is how/where to save the list of preset commands so that it is easy to use and modify. Once that is available, I'm not specially concerned about using a GUI to do so. It would be handy, but not a requirement. My main issue now is that I don't want to maintain a separate and tiny script that would need to be installed explicitly. Ideally, I want to have the feature upstreamed to either x11docker or VSC's docker extension. Unfortunately, there seems not to be enough demand for VSC developers to give it a try (microsoft/vscode-docker#1001). BTW, there is an interesting screencast in microsoft/vscode-docker#1496 (comment) Actually, I think this would be a nice CLI feature for x11docker: x11docker --preset interactive_as_root IMAGE
x11docker --preset as_root IMAGE xterm
x11docker --preset interactive_as_root_port5000 IMAGE
x11docker --preset interactive_as_root -p 5000 IMAGE Unfortunately, because x11docker is written in Bash, I think it won't be easy to handle optional CLI arguments that override the defaults defined in each preset. I believe that either JS/TS or Python are better suited for this task.
I know. But I do use MSYS2 terminal more than I do need docker with GUI features. Moreover, I normally use multiple terminals at the same time. Hence, on the one hand I don't want to have unauthenticated servers running when I don't need them. On the other hand, it is difficult to remember where did I start the X server or which port number I used. |
Let's discuss this in #218 |
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.x11docker.log
The text was updated successfully, but these errors were encountered: