Skip to content

Attempts to execute a symlink to Windows executable does nothing #3424

Closed

Description

Please fill out the below information:

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

10.0.17723.1000 (Insiders Preview, Fast ring)

  • What you're doing and what's happening: (Copy&paste specific commands and their output, or include screen shots)

Within Ubuntu (16.04):

luis@Nostromo:~/bin$ which docker-machine.exe
/mnt/c/ProgramData/chocolatey/bin/docker-machine.exe

luis@Nostromo:~/bin$ docker-machine.exe version
docker-machine.exe version 0.15.0, build b48dc28d

luis@Nostromo:~/bin$ /mnt/c/ProgramData/chocolatey/bin/docker-machine.exe version
docker-machine.exe version 0.15.0, build b48dc28d

luis@Nostromo:~/bin$ ln -s /mnt/c/ProgramData/chocolatey/bin/docker-machine.exe docker-machine
luis@Nostromo:~/bin$ which docker-machine
/home/luis/bin/docker-machine

luis@Nostromo:~/bin$ file docker-machine
docker-machine: symbolic link to /mnt/c/ProgramData/chocolatey/bin/docker-machine.exe

luis@Nostromo:~/bin$ ./docker-machine version
luis@Nostromo:~/bin$ echo $?
1
  • What's wrong / what should be happening instead:

I expected, as previous versions, that symlink executable gets properly executed. It appears something broke with 17723 and these symlinks no longer work (it worked on previous version)

  • Strace of the failing command, if applicable: (If some_command is failing, then run strace -o some_command.strace -f some_command some_args, and link the contents of some_command.strace in a gist here).
$ strace -ff docker-machine version
execve("/home/luis/bin/docker-machine", ["docker-machine", "version"], [/* 33 vars */]) = 0
arch_prctl(ARCH_SET_FS, 0x61c0b8)       = 0
set_tid_address(0x61c0f0)               = 9026
getpid()                                = 9026
brk(NULL)                               = 0xb1e000
brk(0xb1f000)                           = 0xb1f000
getcwd("/home/luis/bin", 4096)          = 15
uname({sysname="Linux", nodename="Nostromo", ...}) = 0
open("/dev/lxssclient", O_RDWR)         = 3
ioctl(3, _IOC(0, 0x00, 0x2f, 0x22), 0x7fffcb943e40) = 0
open("/home/luis/bin/docker-machine", O_RDONLY|O_NOFOLLOW|O_PATH) = 5
ioctl(3, _IOC(0, 0x00, 0x3f, 0x22), 0x7fffcb943cc0) = -1 EINVAL (Invalid argument)
close(5)                                = 0
close(3)                                = 0
close(4)                                = 0
exit_group(1)                           = ?
+++ exited with 1 +++
  • Contents of /etc/wsl.conf:
[automount]
enabled = true
options = "metadata"

Thank you for making WSL!
❤️ ❤️ ❤️

Activity

  1. benhillis commented on Jul 30, 2018

    @benhillis
    Member

    Luis Lavena (@luislavena) - Looks like this was regressed when #2909 was "fixed". Since this is a behavior change that is potentially breaking, I'll add a wsl.conf option to opt into the new behavior.

  2. luislavena commented on Jul 30, 2018

    @luislavena
    Author

    Thank you Ben Hillis (@benhillis) for the promptly response and indication of the source! ❤️ ❤️ ❤️

  3. benhillis commented on Jul 30, 2018

    @benhillis
    Member

    Working on a fix now that will not require a wsl.conf entry.

  4. benhillis commented on Aug 14, 2018

    @benhillis
    Member

    Luis Lavena (@luislavena) - This should be fixed in 17738, please let me know if you have any more issues.

  5. luislavena commented on Aug 16, 2018

    @luislavena
    Author

    Hello Ben Hillis (@benhillis), I just upgraded to 17738 and can confirm this is working as expected:

    $ which docker-machine
    /home/luis/bin/docker-machine
    
    $ file `which docker-machine`
    /home/luis/bin/docker-machine: symbolic link to /mnt/c/ProgramData/chocolatey/bin/docker-machine.exe
    
    $ docker-machine version
    docker-machine.exe version 0.15.0, build b48dc28d

    Thank you!
    ❤️ ❤️ ❤️

  6. davidovich commented on Oct 5, 2018

    @davidovich

    Hello, what is the conf entry that you are talking about? Is it the [interop] section? I have the same error when trying to symlink docker.exe to docker:

    # docker -> /mnt/c/Program Files/Docker/Docker/resources/bin/docker.exe
    $ ./docker
    ./docker: Invalid argument
    

    This is on Windows 1809 (Microsoft Windows [Version 10.0.17763.1])

  7. bbulkow commented on Apr 25, 2019

    @bbulkow

    I have exactly this pathology a year later.
    Windows 10.0.18362.53 ( slow ring )
    Ubuntu 16.04 and 18.04 WSL
    I have a soft link which I've defined to my windows editor ( sublime ) so I can just type "subl" in WSL and the file pops up. It's invaluable and has worked great until just the last few weeks.

    bin$ which "/mnt/c/Program Files/Sublime Text 3/sublime_text.exe" /mnt/c/Program Files/Sublime Text 3/sublime_text.exe bin$ file "/mnt/c/Program Files/Sublime Text 3/sublime_text.exe" /mnt/c/Program Files/Sublime Text 3/sublime_text.exe: PE32+ executable (GUI) x86-64, for MS Windows bin$ ls -l total 0 lrwxrwxrwx 1 root root 52 Apr 25 12:28 subl3 -> '/mnt/c/Program Files/Sublime Text 3/sublime_text.exe' bin$

    Executing subl3 doesn't pop up a window, but executing the command directly does.

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions