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

Symlinks to a unix socket are not handled properly #3910

Closed
simonferquel opened this issue Mar 11, 2019 · 7 comments
Closed

Symlinks to a unix socket are not handled properly #3910

simonferquel opened this issue Mar 11, 2019 · 7 comments
Labels

Comments

@simonferquel
Copy link

Please fill out the below information:

  • Your Windows build number: (Type ver at a Windows Command Prompt)

Microsoft Windows [Version 10.0.17763.348]

  • What you're doing and what's happening:

Now that Windows support Unix sockets and that golang 1.12 expose the feature, we are trying to improve WSL experience with Docker Desktop.
As part of that we have POC where Docker Desktop creates a Unix Socket in a win32 process in C:\ProgramData\Docker\docker.sock.
From WSL, doing docker -H unix://$(wslpath c:\\ProgramData\\Docker\\docker.sock) version works properly. But if we create a symlink (like ln -s /var/run/docker.sock $(wslpath c:\\ProgramData\\Docker\\docker.sock)) using this symlink with docker -H /var/run/docker.sock version does not work: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

  • What's wrong / what should be happening instead:

Docker CLI should be able to connect to the UNIX socket trough the symlink

@simonferquel simonferquel changed the title Symlinks to a unix socket are not handled properlt Symlinks to a unix socket are not handled properly Mar 11, 2019
@therealkenc
Copy link
Collaborator

Real symlinks or the fake junction kind? What does win32 dir on the directory with docker.sock look like.

@simonferquel
Copy link
Author

The link is created within wsl, (with ln -s) and lives in a non-windows path (`/var/run/docker.sock).
Win32 dir on c:\ProgramData\Docker says:

 Volume in drive C has no label.
 Volume Serial Number is 2E2C-55F4

 Directory of c:\ProgramData\Docker

03/11/2019  03:26 PM    <DIR>          .
03/11/2019  03:26 PM    <DIR>          ..
03/11/2019  04:02 PM                 0 docker.sock
               1 File(s)              0 bytes
               2 Dir(s)  427,628,781,568 bytes free

can't run it in /var/run/ though, as it is not a "windows visible dir". ls -al /var/run/ says:

simon@DESKTOP-3AH8IK2:/windir/c/ProgramData/Docker$ ls -al /var/run/
total 0
drwxr-xr-x 1 root root 4096 Mar 11 17:59 .
drwxr-xr-x 1 root root 4096 Mar  8 18:30 ..
lrwxrwxrwx 1 root root   40 Mar 11 17:59 docker.sock -> /windir/c/ProgramData/Docker/docker.sock
drwxrwxrwt 1 root root 4096 Jan  1  1970 lock
drwxr-xr-x 1 root root 4096 Mar 11 17:58 resolvconf
drwxrwxrwt 1 root root 4096 Jan  1  1970 shm
drwx--x--x 1 root root 4096 Mar 11 17:59 sudo
drwxr-xr-x 1 root root 4096 Jan  1  1970 user

@therealkenc
Copy link
Collaborator

can't run it in /var/run/ though, as it is not a "windows visible dir".

Yeah sorry I could have been clearer. Something like (in cmd.exe):

cd %localappdata%\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\run

Note that's ....\rootfs\run not rootfs\var\run because /var/run is also a symlink (causing it's own heartache by default).

Or cutting to the chase, do you have Developer mode enabled in Settings->Update&Security->For developers.

@Biswa96
Copy link

Biswa96 commented Mar 11, 2019

Running wsl.exe as administrator can run sudo service docker start, which can create /var/run/docker.sock.

@simonferquel
Copy link
Author

@therealkenc here is the dir result:

 Volume in drive C has no label.
 Volume Serial Number is 2E2C-55F4

 Directory of C:\Users\simon\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\run

03/08/2019  05:56 PM    <DIR>          .
03/08/2019  05:56 PM    <DIR>          ..
03/08/2019  05:56 PM    <DIR>          grub
03/08/2019  05:56 PM    <DIR>          lock
               0 File(s)              0 bytes
               4 Dir(s)  428,924,440,576 bytes free

Can't see my link here.

@Biswa96 this is not what I want to achieve. The goal is to expose the engines managed by Docker Desktop (either the windows docker engine, or the one running in our LinuxKit VM) both in the win32 world and wsl. We can workaround this by modifying user's ~/.profile file, but we'd prefer to create a symlink at the default path (/var/run/docker.sock) pointing to where we create the win32 unix socket ($(wslpath c:\\ProgramData\\Docker\\docker.sock)) lives.

@therealkenc
Copy link
Collaborator

Can't see my link here.

That's weird. Look at /run on the WSL side simultaneously and see if that listing makes sense. In short, poke around. It's gotta be somewhere. You didn't answer the question: "do you have Developer mode enabled". Occam says you are looking at variation #3611. Or, you're supposition is correct and there is something wrong with symlinks to unix sockets. Possible. CLI repro steps would confirm (docker isn't the repro you want).

Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

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

No branches or pull requests

4 participants