-
Notifications
You must be signed in to change notification settings - Fork 380
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
docker-for-win: Use runx to provide X on MS Windows #165
Comments
@1138-4eb could you please run some tests? So far I tested So far I assume It would be nice if you check some of the possible setups:
Setups with entry |
Sure. I've been quite busy lately, but I can give it a try. First off, thanks a lot for the example commands and the table. I was just going to ask you to create some test list. This table will make it much easier. Let's go for it:
*1 *2 *3 Compared to running x11docker alone, runx show an additional message *4: eine@DESKTOP-E1ER43H:~$ /mnt/d/data-dev/github/runx//runx -- /mnt/d/data-dev/github/x11docker/x11docker x11docker/check
runx note: MSYS2 does not provide xauth to create a cookie.
Fallback: Enabling discouraged option --no-auth.
runx ERROR: No X server found for MSYS2.
Please install X server VcXsrv:
https://sourceforge.net/projects/vcxsrv *5: eine@DESKTOP-E1ER43H:~$ /mnt/d/data-dev/github/runx//runx --xwin -- /mnt/d/data-dev/github/x11docker/x11docker x11docker
/check
runx note: MSYS2 does not provide xauth to create a cookie.
Fallback: Enabling discouraged option --no-auth.
runx note: runx in MSYS2 does not support --xwin.
Fallback: Enabling option --vcxsrv.
runx ERROR: No X server found for MSYS2.
Please install X server VcXsrv:
https://sourceforge.net/projects/vcxsrv |
Much thanks for the test runs! WSL seems to be misdetected as MSYS2. That might be fixed now, compare #157.
ok, that is not obvious. x11docker runs its own instance of xwin and does not use the one provided by runx. You could use the runx-xwin with option
I had some trouble with
It is invalid, indeed. What does |
As commented in #157,
With In both cases, an Xwin server is started but not closed.
As long as it does not conflict with a another running server, I think it is ok for it to be random.
# docker --version
Docker version 18.09.2, build 6247962 EDIT runx and x11docker in cygwin still create two X servers. |
Your xpra version is quite old:
Probably x11docker sets an xpra option that is not recognized.
Should be fixed now. Old WSL versions did not terminate Windows processes after a
It is not a nice solution, but will fail less often than
That is right. x11docker does not use the X server from runx if it can run XWin itself.
Should be fixed now. |
Yes. The WSL I am using is Debian Stretch: https://packages.debian.org/search?keywords=xpra&searchon=names&suite=stretch§ion=all
Yes, it seems to be fixed now.
I think that the random number is not a devil at all. There are some other docker features that are mapped randomly, so it is coherent. As said, I'm just worried if there is some possibility of conflict.
I would expect to be the other way: x11docker should create another X server if it cannot use the one provided by runx. Actually, it can be avoided with
It is.
*1 It fails because of xpra, as commented above. But *2 It works, but two X servers are started, as commented above. However, it can be avoided with *3 runx shows the following note:
and then x11docker shows:
I think that some of these should not be shown. E.g. 'xauth' does exist, I believe, but it is not used because runx sets *4 |
We have a dedicated wiki page explaining why using the Debian (Stretch) package(s) is a bad idea: Broken Distribution Packages |
Thanks. I am aware of that, and I do not use it as a regular tool. However, in this issue we are testing some common setups. If any user installs WSL Debian, this is the behaviour they will get. I do not remember installing |
speed up xpra start with improved logfile check #167
I've installed debian stretch with same xpra version in WSL.
It will conflict is the random display number is already in use. If you run to instances of
A core concept of x11docker is to run additional X servers.
MSYS2 does not provide an
MSYS2 does not provide any of xpra, nxagent etc. So it does not apply to MSYS2, but to Cygwin and WSL. I would not like to suppress the messages with an MSYS2 specific check. I want to keep x11docker as general as possible and to reduce system specific checks. I'd say, if xpra works now in Debian Stretch-WSL, everything is fixed now, and runx and x11docker behave as expected. |
I will try.
Well, it's low enough. Is there any comment about this in the docs?
The point is: what do the additional servers created by x11docker provide to a context created by runx? Using
My bad. Nonetheless, my comment was related to x11docker checking the authentication at all, if runx was started without authentication. Does the user need to provide
I think this can be 'fixed' without any additional logic. Just add some word to the comment. E.g., instead of |
This runx note:
In general, running additional X servers avoids some X security leaks. This is much more important on native Linux systems than on MS Windows. Example: One could run a desktop with
It is only MSYS2 where x11docker cannot run an additional X server. If available, x11docker will run XWin, xpra, nxagent or Xephyr in WSL or Cygwin.
x11docker automatically falls back to
Good idea, I'll think about it. |
I now tried
IMHO, runx should set some specific environment variable or write some config file, so that x11docker can be aware if the X server was started with runx.
In this context (Cygwin), what's the difference between doing so or running
XWin is not supported in WSL, nxagent or Xephyr are not installed, and the version of xpra fails. That's probably why I assumed that no additional X server is created in WSL, i.e., because the only working solution ATM is |
improve xauth check, regard X over IP with --hostdisplay #165
x11docker still would not know if other applications are running on the runx X server, e.g. a desktop or a file manager, that could be accessed from container applications.
There is no point to use runx in Cygwin for x11docker (except XWin is not installed but VcXsrv is).
I found a bug, the unix socket hasn't been shared. Is fixed now.
xpra is not part of Debian by default. You've probably installed it for one of #125 #123 #122 #121 #118 #117 where we looked how to provide Xvfb for xpra on Windows. |
@1138-4eb Could you please run a final check if xpra works on WSL?
|
It does not:
|
Thank you for the test!
Surprisingly, it look like xpra starts well but the container stops immediatly for no obvious reason. Does
Maybe check with another image, e.g.
|
I'm not using kaptain. If you mean the kaptain inside the container, I think it is not even started.
Yes, it works. However, an error is shown when the window is closed: $ /mnt/d/data-dev/github/runx/runx -- /mnt/d/data-dev/github/x11docker/x11docker --hostdisplay x11docker/check
runx note: Using random X display number :2471.
If this display number is already in use, X server startup will fail.
You can specify a display number N with option '--display N'.
runx 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: https://github.com/mviereck/x11docker/issues/108
runx note: If you get application error messages like 'Cannot open display'
or 'Invalid MIT-MAGIC-COOKIE', the X authentication cookie might be broken.
You can remove old cookies and stop running X servers with: runx --cleanup
DISPLAY=10.0.75.1:2471 XAUTHORITY=/home/eine/runx_Xauthority
x11docker WARNING: Option --hostdisplay allows less security hardening.
It is recommended to use another X server option like --xpra or --nxagent.
Error: No such object: f4462090a785fbd3c1dfe8cec2f0c5096c4a25060ddf4aff7a4e15aa94ec744f
SUCCESS: The process with PID 21432 has been terminated.
$ /mnt/d/data-dev/github/runx/runx -- /mnt/d/data-dev/github/x11docker/x11docker --xpra x11docker/xfce xfce4-terminal
runx note: Using random X display number :1221.
If this display number is already in use, X server startup will fail.
You can specify a display number N with option '--display N'.
runx 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: https://github.com/mviereck/x11docker/issues/108
runx note: If you get application error messages like 'Cannot open display'
or 'Invalid MIT-MAGIC-COOKIE', the X authentication cookie might be broken.
You can remove old cookies and stop running X servers with: runx --cleanup
DISPLAY=10.0.75.1:1221 XAUTHORITY=/home/eine/runx_Xauthority
x11docker note: Your xpra version 'xpra v0.17.6' is out of date. It is
recommended to install at least xpra v1.0. Look at: www.xpra.org
x11docker WARNING: Request of Windows path to path within WSL:
/tmp/.X11-unix/X100
Write access from Windows host to WSL files can damage the WSL file system.
Read-only access is ok.
Option --share: You can add :ro to the path to allow read-only access.
Example: --share='/tmp/.X11-unix/X100:ro'
x11docker WARNING: Request of Windows path to path within WSL:
/tmp/.X11-unix/X100
Write access from Windows host to WSL files can damage the WSL file system.
Read-only access is ok.
Option --share: You can add :ro to the path to allow read-only access.
Example: --share='/tmp/.X11-unix/X100:ro'
Error: No such object: 9158d9c7786b559b63a1a8a0ad77e76ab81adc3184c6a8066fd1063c9efeffbb
SUCCESS: The process with PID 41408 has been terminated. |
Thank you for the tests and the log. It is confusing that it shows no obvious error. Xpra seems to run well. A guess: Maybe the container entirely crashes without a message when the X application tries to access the shared unix socket. The latest commit sets up an X over IP connection in WSL like runx does for VcXsrv and XWin. Could you please try again?
Yes, I mean |
@1138-4eb Could you please run a check in WSL with
I hope it works now with X over IP. Edit: Meanwhile I've changed runix behaviour on MSYS2: It fails without |
I've been side-tracked, and I'm trying to test the latest updates (x11docker 0470946 and runx 8882b5b6).
Unfortunately, runx and x11docker seem not to work together: In WSL, the server and the container are started, but no window is shown. The firewall is disabled, just in case. In MSYS2, the X server is started, but the container is not. When terminating the execution with Ctrl+C, the logfile is empty: # /t/runx/runx --no-auth -- /t/x11docker/x11docker --debug --no-auth --hostdisplay x11docker/checkrunx note: Using random X display number :2834.
If this display number is already in use, X server startup will fail.
You can specify a display number N with option '--display N'.
runx 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: https://github.com/mviereck/x11docker/issues/108
runx WARNING: Option --no-auth: Cookie authentication is disabled!
SECURITY RISC!
Your X server vcxsrv listens on TCP connections without any protection.
Others could try to access your system through network connections.
Please use option --no-auth for debugging only.
DISPLAY=10.0.75.1:2834
DEBUGNOTE[17:03:04,603]: check_parent_sshd(): Failed to check for sshd. ps -p not supported.
DEBUGNOTE[17:03:04,769]: check_host(): ps can watch root processes: yes
DEBUGNOTE[17:03:07,228]: storeinfo(): cache=/home/eine/.cache/x11docker/x11docker-check-51383732488
DEBUGNOTE[17:03:07,336]: storeinfo(): stdout=/home/eine/.cache/x11docker/x11docker-check-51383732488/share/stdout
DEBUGNOTE[17:03:07,444]: storeinfo(): stderr=/home/eine/.cache/x11docker/x11docker-check-51383732488/share/stderr
DEBUGNOTE[17:03:07,649]: storeinfo(): x11dockerpid=7759
DEBUGNOTE[17:03:07,913]:
x11docker version: 6.3.1-beta
docker version: Docker version 19.03.4, build 9013bf5
Host system:
Command: '/t/x11docker/x11docker' '--debug' '--no-auth' '--hostdisplay' 'x11docker/check'
Parsed options: --debug --no-auth --hostdisplay -- 'x11docker/check'
DEBUGNOTE[17:03:07,976]: Dependency check for --hostdisplay: 0
DEBUGNOTE[17:03:08,040]: Dependencies of --hostdisplay already checked: 0
DEBUGNOTE[17:03:08,104]: Dependencies of --hostdisplay already checked: 0
DEBUGNOTE[17:03:08,167]: storeinfo(): xserver=--hostdisplay
x11docker WARNING: Option --hostdisplay allows less security hardening.
It is recommended to use another X server option like --xpra or --nxagent.
DEBUGNOTE[17:05:56,971]: Received SIGINT
DEBUGNOTE[17:05:57,028]: storeinfo(): error=130
DEBUGNOTE[17:05:57,124]: Terminating x11docker.
DEBUGNOTE[17:05:57,180]: time to say goodbye (finish)
DEBUGNOTE[17:05:57,447]: x11docker exit code: 130 Fortunately, I can just source runx and pass # source /t/runx/runx --no-auth
runx note: Using random X display number :2043.
If this display number is already in use, X server startup will fail.
You can specify a display number N with option '--display N'.
runx WARNING: Option --no-auth: Cookie authentication is disabled!
SECURITY RISC!
Your X server vcxsrv listens on TCP connections without any protection.
Others could try to access your system through network connections.
Please use option --no-auth for debugging only.
DISPLAY=10.0.75.1:2043
# echo $DISPLAY
10.0.75.1:2043
# docker run --rm -e DISPLAY=$DISPLAY x11docker/check This is undesired, tho, because I cannot use x11docker's security features and options.
I'd prefer if providing it to runx was enough. I.e., if runx set some envvar to tell x11docker that the X server open (e.g. |
Thank you for testing and giving new feedback! WSL:
The log shows this error although the file exists:
I've changed x11docker accordingly, it will now use the path MSYS2:
That should be enough already. x11docker will drop a warning if the X server runs without a cookie, but should continue. x11docker does not need an additional
That is odd. Could you please try with Cygwin: |
It seems to hit some other issue now: x11docker.log
My bad. Since it fails just after printing the warning, I thought that it was an error. You are correct.
With
I will try after ensuring that WSL and MSYS2 work as expected. |
In both cases the cache base folder seems to be the critical point. The WSL log shows the long path again although it should not:
It looks a bit like the code was not updated. In the
It looks like |
I'm downloading both x11docker and runx through git. I pulled the latest commit, but it is still not working: x11docker.log.
Executing this in MSYS2 returns an interactive cmd. I think that # cmd.exe /C 'echo %userprofile%'
Microsoft Windows [Version 10.0.18362.418]
(c) 2019 Microsoft Corporation. All rights reserved.
D:\data-dev\aptman\dbhi-hub\vunit>exit
exit
# cmd.exe //C 'echo %userprofile%'
C:\Users\eine |
Oh, yes, I forgot about the path conversion of MSYS2. This code works now (tested in VM).
Hm. Now the log shows the desired pathes for running in WSL. The three different pathes are right:
But the GUI fails with an X connection error:
It is probably not a cookie issue, that normally shows something like
I currently have no real idea what is going wrong, as everything in the setup looks right now.
Please try also |
Just a thought: You run
Than:
And compare with:
|
I don't know what happened (I run
And these work on MSYS:
I tested Cygwin too, and x11docker works ok without runx. Hence, I guess that this issue can be closed for now. |
Great! What a relief.
Thank you for testing and reporting! |
Current master version of x11docker drops option
--vcxsrv
on MS Windows.x11docker can be started with runx.
Example:
runx -- x11docker x11docker/check
.Alternatively, it is possible to source
runx
in~/.bashrc
.xinit
xauth
andxwininfo
.xauth
andxwininfo
/x11-utils
.Xephyr
,nxagent
orxpra
are installed in WSL, x11docker will use them additionally.--xwin
in Cygwin/X without needingrunx
.xinit
,xauth
,xwininfo
.runx
can be used.EDIT:
runx
can run VcXsrv or XWin in WSL and Cygwin.In MSYS2 it can only run VcXsrv.
This thread aims to announce this change and to ask for feedback / test results.
@1138-4eb would you please have a look?
The text was updated successfully, but these errors were encountered: