Skip to content
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: Cannot establish any listening sockets - Make sure an X server isn't already running #155

Closed
eine opened this issue May 9, 2019 · 16 comments

Comments

@eine
Copy link
Contributor

eine commented May 9, 2019

I tried to run the checks #145 after updating to the latest master, and I found the following error:

  • Two days ago I started a container in MSYS2 with x11docker 17 commits behind the current master. This container was started with /path/to/x11docker/x11docker --user=0 -i -- -v /$(pwd)://src -- aptman/dbhi:bionic bash. Both the container and the X server are still running and working as expected.
  • In a different MSYS terminal, I fetched and pulled the latest changes from x11docker and I tried to execute ./x11docker --hostdisplay --gpu x11docker/check. I get the following error:

x11check

VCXSrv.100.log
x11docker.log

Then, I closed all the containers and X servers, and tried again. The interface of x11docker/check is now properly shown.

Last, I started the aptman/dbhi container again, and tried to execute x11docker/check after it. It fails again.

So, I'd say that some of the latest changes have broken the possibility to start multiple vcxsrv instances.

@mviereck mviereck added the bug label May 9, 2019
@mviereck
Copy link
Owner

mviereck commented May 9, 2019

Thanks for reporting!

It seems that x11docker somehow does not recognice X display numbers that are already in use. I successfully runs the first X server on display :100, but fails to run second one on :100. It should run the second X server with display number :101.

I'll have a look why the display number check fails.

Meanwhile it should work if you manually specify a different display number with --display 101.

@eine
Copy link
Contributor Author

eine commented May 9, 2019

Meanwhile it should work if you manually specify a different display number with --display 101.

It works. I'm using this now to run the checks.

@mviereck
Copy link
Owner

mviereck commented May 9, 2019

Ok, this one is fixed in latest commit. I did some test runs in a Windows VM, --xwin in Cygwin was affected, too.

@mviereck mviereck closed this as completed May 9, 2019
@eine
Copy link
Contributor Author

eine commented May 9, 2019

I can confirm that it works now.

@eine
Copy link
Contributor Author

eine commented May 17, 2019

I think I'm having this problem in Cygwin:

xwin_err

XWin.100.log
x11docker.log

Note that there is no other Xwin server running, but there is an VcXsrv running at 100.

I can work around this issue with ./x11docker --clipboard --no-auth --display 101 x11docker/check.

@mviereck
Copy link
Owner

Note that there is no other Xwin server running, but there is an VcXsrv running at 100.

I did a test run yet with this setup, and it works.
Maybe you forgot to run x11docker --update-master in Cygwin?

@eine
Copy link
Contributor Author

eine commented May 17, 2019

I did a test run yet with this setup, and it works.
Maybe you forgot to run x11docker --update-master in Cygwin?

x11docker is not 'installed', I clone/pull the git repo and execute the script from there. Note that the command I used is ./x11docker --clipboard --no-auth x11docker/check.

@mviereck
Copy link
Owner

I cannot reproduce the issue, works ok here. xauth (#145) works, too.
My Windows installation just had an update, and my VcXsrv version is the same (1.20.1.4).
I have no more idea what might be different on your machine except a different x11docker version.

@eine
Copy link
Contributor Author

eine commented May 17, 2019

I'm using the latest master. Might it be related to the fact that Cygwin is not installed in C: here?

@mviereck
Copy link
Owner

Might it be related to the fact that Cygwin is not installed in C: here?

I'll look into that, but it is quite unlikely. If started within Cygwin, x11docker checks cygpath to find the location of Cygwin.

I'm using the latest master.

Could you please try an older version? v5.6.0 should have worked previously.

@eine
Copy link
Contributor Author

eine commented May 19, 2019

Could you please try an older version? v5.6.0 should have worked previously.

I tried with v5.6.0, v5.5.2, v5.5.0 and v5.4.0. All of them produce the same result/error. All of them work with --display 101.

@mviereck
Copy link
Owner

mviereck commented May 19, 2019

Thank you.
It seems the check with xwininfo.exe somehow fails on your system.
The code Line is https://github.com/mviereck/x11docker/blob/master/x11docker#L2194

        --vcxsrv|--xwin) grep -q -E 'Authorization|Absolute' <<< "$(xwininfo.exe -display $Hostip:$Newdisplaynumber -root 2>&1)" || break ;;

Of interest is

xwininfo.exe -display $Hostip:$Newdisplaynumber -root 

Can you show me command -v xwininfo.exe?
In Cygwin it should be /usr/bin/xwininfo.exe.

In MSYS2 this probably fails, but this should work:

command -v /c/Program\ Files/VcXsrv/xwininfo.exe

Maybe you can also run a check with xwininfo.exe with correct IP and display number?

@eine
Copy link
Contributor Author

eine commented May 19, 2019

It seems the check with xwininfo.exe somehow fails on your system.

This was it. xwininfo.exe was installed/available in /c/Program\ Files/VcXsrv/xwininfo.exe but not in Cygwin. I installed it explicitly, and everything works as expected now.

Moreover, the authorization issue commented in #145 does not apply to cygwin (either with xwin or vcxsrv). It is still present with MSYS, tho.

@mviereck
Copy link
Owner

mviereck commented May 20, 2019

This was it. xwininfo.exe was installed/available in /c/Program\ Files/VcXsrv/xwininfo.exe but not in Cygwin.

Oh, ok. I thought it would be part of the xinit package. I'll add a dependency note in the wiki and a check for its availability in x11docker.

authorization issue

Does /c/Program\ Files/VcXsrv/xauth.exe exist?
It should be distributed with VcXsrv.

@eine
Copy link
Contributor Author

eine commented May 20, 2019

Oh, ok. I thought it would be part of the xinit package. I'll add a dependency note in the wiki and a check for its availability in x11docker.

Great!

authorization issue

Does /c/Program\ Files/VcXsrv/xauth.exe exist?
It should be distributed with VcXsrv.

Yes, it does exist. The following executables are available in /c/Program\ Files/VcXsrv/: plink, vcxsrv, xauth, xcalc, xclock, xhost, xkbcomp, xlaunch, xrdb and xwininfo.

EDIT

# ./xauth.exe -h
usage:  C:\Program Files\VcXsrv\xauth.exe [-options ...] [command arg ...]

where options include:
    -f authfilename                name of authority file to use
    -v                             turn on extra messages
    -q                             turn off extra messages
    -i                             ignore locks on authority file
    -b                             break locks on authority file
    -n                             do not resolve host names in authority file
    -V                             show version number of xauth

and commands have the following syntax:

    add dpyname protoname hexkey   add entry
    exit                           save changes and exit program
    extract filename dpyname...    extract entries into file
    help [topic]                   print help
    info                           print information about entries
    list [dpyname...]              list entries
    merge filename...              merge entries from files
    nextract filename dpyname...   numerically extract entries
    nlist [dpyname...]             numerically list entries
    nmerge filename...             numerically merge entries
    quit                           abort changes and exit program
    remove dpyname...              remove entries
    source filename                read commands from file
    version                        show version number of xauth
    ?                              list available commands
    generate dpyname protoname [options]  use server to generate entry
    options are:
      timeout n    authorization expiration time in seconds
      trusted      clients using this entry are trusted
      untrusted    clients using this entry are untrusted
      group n      clients using this entry belong to application group n
      data hexkey  auth protocol specific data needed to generate the entry


A dash may be used with the "merge" and "source" to read from the
standard input.  Commands beginning with "n" use numeric format.


eine@DESKTOP-E1ER43H MINGW64 /c/Program Files/VcXsrv
# ./xauth.exe version
C:\Program Files\VcXsrv\xauth.exe:  file C:\msys64\home\eine\.Xauthority does not exist
1.0.10

@mviereck
Copy link
Owner

Closing this one, the origin issue is resolved.

Re: xauth / Authorization issue
@1138-4eb Please let's discuss that in #160

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants