Skip to content

Executing a symlink to a windows executable does nothing #3999

Closed

Description

Hello, the pathology I am seeing is identical to that reported in the following:
#3424
Except it's a year later and clearly a different underlying issue. I have added a report to that issue, but it's closed, so I thought I would open a new issue. I don't know if you'd prefer to proceed in one or the other. This was working for me as recently as a few weeks ago ( say, 3/31/19 ).

I am running 10.0.18362.53

Please fill out the below information:

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

  • What you're doing and what's happening: (Copy&paste the full set of specific command-line steps necessary to reproduce the behavior, and their output. Include screen shots if that helps demonstrate the problem.)
    I have a windows executable installed in program files
    cd /usr/local/bin
    bin$ sudo ln -s "/mnt/c/Program Files/Sublime Text 3/sublime_text.exe" subl
    bin$ ls -l
    total 0
    lrwxrwxrwx 1 root root 52 Apr 25 12:28 subl -> '/mnt/c/Program Files/Sublime Text 3/sublime_text.exe'
    bin$ ./subl

---> this should pop up a windows window, it doesn't

  • What's wrong / what should be happening instead:
    Executing the soft link should execute the windows program.
    If I execute the command directly, it works fine

  • Strace of the failing command,
    ---> there's an EBADF near the bottom that shows there's a problem instead of a reasonable launch
    ---> sorry about the bad formatting. Not sure what I'm falling afoul of. Carriage returns and line feeds, I expect.

bbulk$ cat subl3.strace                                                                                                                                  2329  execve("/usr/local/bin/subl3", ["subl3"], 0x7fffeb0744e8 /* 26 vars */) = 0                                                                        2329  arch_prctl(ARCH_SET_FS, 0x293820) = 0                                                                                                              2329  set_tid_address(0x293858)         = 2329                                                                                                           2329  brk(NULL)                         = 0xd11000                                                                                                       2329  brk(0xd12000)                     = 0xd12000                                                                                                       2329  sched_getaffinity(0, 128, [0, 1, 2, 3, 4, 5, 6, 7]) = 64                                                                                           2329  uname({sysname="Linux", nodename="ASPARTAME", ...}) = 0                                                                                            2329  getpid()                          = 2329                                                                                                           2329  getcwd("/mnt/c/Users/bbulk", 4096) = 19                                                                                                            2329  open("/dev/lxss", O_RDWR)         = 3                                                                                                              2329  ioctl(3, _IOC(0, 0, 0x2f, 0x22), 0x7fffe43e54c8) = 0                                                                                               2329  getcwd("/mnt/c/Users/bbulk", 4096) = 19                                                                                                            2329  open("/proc/self/mountinfo", O_RDONLY) = 5                                                                                                         2329  readv(5, [{iov_base="", iov_len=0}, {iov_base="2 2 0:2 / / rw,noatime - lxfs ro"..., iov_len=1024}], 2) = 932                                      2329  readv(5, [{iov_base="", iov_len=0}, {iov_base="", iov_len=1024}], 2) = 0                                                                           2329  close(5)                          = 0                                                                                                              2329  getcwd("/mnt/c/Users/bbulk", 4096) = 19                                                                                                            2329  open("/proc/self/mountinfo", O_RDONLY) = 5                                                                                                         2329  readv(5, [{iov_base="", iov_len=0}, {iov_base="2 2 0:2 / / rw,noatime - lxfs ro"..., iov_len=1024}], 2) = 932                                      2329  readv(5, [{iov_base="", iov_len=0}, {iov_base="", iov_len=1024}], 2) = 0                                                                           2329  close(5)                          = 0                                                                                                              2329  ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0                                                                                          2329  ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0                                                                                          2329  ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0                                                                                          2329  ioctl(0, TIOCGPGRP, [2327])       = 0                                                                                                              2329  getpgid(0)                        = 2327                                                                                                           2329  fstat(0, {st_mode=S_IFCHR|0660, st_rdev=makedev(4, 1), ...}) = 0                                                                                   2329  fstat(1, {st_mode=S_IFCHR|0660, st_rdev=makedev(4, 1), ...}) = 0                                                                                   2329  fstat(2, {st_mode=S_IFCHR|0660, st_rdev=makedev(4, 1), ...}) = 0                                                                                   2329  ioctl(0, TIOCGWINSZ, {ws_row=30, ws_col=120, ws_xpixel=0, ws_ypixel=0}) = 0                                                                        2329  ioctl(0, SNDCTL_TMR_START or TCSETS, {B38400 -opost -isig -icanon -echo ...}) = 0                                                                  2329  dup(0)                            = 5                                                                                                              2329  ioctl(4, _IOC(0, 0, 0xb7, 0x22), 0x7fffe43e5478) = 0                                                                                               2329  ioctl(4, _IOC(0, 0, 0xb7, 0x22), 0x7fffe43e5478) = 0                                                                                               2329  ioctl(4, _IOC(0, 0, 0xb7, 0x22), 0x7fffe43e5478) = 0                                                                                               2329  write(4, "\0\0\0\0\301\0\0\0\16\0\0\0\0\0\0\0\17\0\0\0\0\0\0\0\20\0\0\0\0\0\0\0"..., 193) = 193                                                    2329  close(0)                          = 0                                                                                                              2329  close(1)                          = 0                                                                                                              2329  close(2)                          = 0                                                                                                              2329  rt_sigprocmask(SIG_BLOCK, [INT WINCH], NULL, 8) = 0                                                                                                2329  signalfd4(-1, [INT WINCH], 8, 0)  = 0                                                                                                              2329  poll([{fd=4, events=POLLIN}, {fd=0, events=POLLIN}], 2, -1) = 1 ([{fd=4, revents=POLLIN}])                                                         2329  read(4, "\10\0\0\0 \0\0\0\26\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 32) = 32                                                              2329  writev(2, [{iov_base="/usr/local/bin/subl3: Invalid ar"..., iov_len=39}, {iov_base=NULL, iov_len=0}], 2) = -1 EBADF (Bad file descriptor)          2329  close(3)                          = 0                                                                                                              2329  close(4)                          = 0                                                                                                              2329  ioctl(5, SNDCTL_TMR_START or TCSETS, {B38400 opost isig icanon echo ...}) = 0                                                                      2329  close(5)                          = 0                                                                                                              2329  exit_group(1)                     = ?                                                                                                              2329  +++ exited with 1 +++                                                                                                                              bbulk$                                   `                                                                                                                                     

Activity

  1. YihaoPeng commented on Apr 29, 2019

    @YihaoPeng

    I have the same issue in my Win10 version 1903 build 18362.53.

    I have been running docker.exe via a symbolic link on build 1809, and it doesn't work after upgrading to 1903.

    On 1809:
    1809

    On 1903:
    1903


    A simply repro:

    whereis cmd.exe
    ln -s /c/Windows/system32/cmd.exe ./cmd
    ./cmd
    

    This should get you into cmd but nothing happens after running, and the program doesn't have any output.

  2. YihaoPeng commented on Apr 29, 2019

    @YihaoPeng

    Instead, I now need to write a startup shell script.
    vim /usr/local/bin/docker

    exec '/c/Program Files/Docker/Docker/Resources/bin/docker.exe' $*
    

    This is a problem when the argument is a string with spaces. change to this

    exec '/c/Program Files/Docker/Docker/Resources/bin/docker.exe' "$@"
    

    Or you may use /mnt/c/Program Files/Docker/Docker/Resources/bin/docker.exe if you have a default mount point.

  3. cybtachyon commented on May 4, 2019

    @cybtachyon

    I am able to reproduce with Windows Version 10.0.17758.4 as well.

    WSL + Ubuntu 18.04 LTS

    Easy repro: Follow https://docksal.io/installation#windows-virtualbox on this setup

  4. bbulkow commented on May 5, 2019

    @bbulkow
    Author

    Given we've got multiple simple repros on the most common Ubuntu WSL installation, how can we get the prioritity raised? This is a big one for me... there's only one symlink I have but I use it a lot :-) NO assignees no tags no nothing is a bit sad-face

  5. bbulkow commented on May 9, 2019

    @bbulkow
    Author

    The workaround worked for me of creating a file with an exec. Although there's a typo there, you need to start with '/mnt/c/Program Files/' the MNT was missing.

  6. scorchedegg commented on May 11, 2019

    @scorchedegg

    Brian Bulkowski (@bbulkow) Not a typo. Most people just change their mount root to / to be more inline with the paths used by Docker, etc.

  7. zl3one6 commented on May 21, 2019

    @zl3one6

    Same issue on win10 1903 18362.116 with ubuntu 18.04.2

  8. LuoZhongYao commented on May 23, 2019

    @LuoZhongYao

    Instead, I now need to write a startup shell script.
    vim /usr/local/bin/docker

    exec '/c/Program Files/Docker/Docker/Resources/bin/docker.exe' $*
    

    This is a problem when the argument is a string with spaces. change to this

    exec '/c/Program Files/Docker/Docker/Resources/bin/docker.exe' "$@"
    
  9. benhillis commented on May 26, 2019

    @benhillis
    Member

    Working on a fix for this. Will also attempt to get the fix backported to 1903.

  10. gdh1995 commented on May 27, 2019

    @gdh1995

    I find that absolute file paths in cmd arguments are also not translated...

    As a result, I have to add a prefix of env.exe from Git for Windows to translate them - e.g. env.exe notepad.exe /e/my/file.txt.

  11. benhillis commented on May 28, 2019

    @benhillis
    Member

    I've identified the issue, it's related to us now supporting the 9P paths (\wsl$\distro) in wslpath and am drafting a fix.

  12. igieon commented on Jun 13, 2019

    @igieon

    I have same issue after upgrade to 1903. I get error what is interesting when i execute symlink as sudo everything works.

    igi@igi-inspiron:~$ ~igi/bin/minikube
    igi@igi-inspiron:~$ sudo ~igi/bin/minikube
    Minikube is a CLI tool that provisions and manages single-node Kubernetes clusters optimized for development workflows.
    
  13. 2 remaining items

  14. jstangroome commented on Aug 6, 2019

    @jstangroome

    Will also attempt to get the fix backported to 1903.

    Ben Hillis (@benhillis) Do you know yet whether a backport to 1903 is possible/likely? I assume it would be delivered through standard Windows Update patching.

  15. bbulkow commented on Aug 11, 2019

    @bbulkow
    Author

    Working great on the insider builds.

  16. taviso commented on Nov 21, 2019

    @taviso

    This is still broken in the 1909 update, it used to work in 1809. Frustrating that it just stopped working, and hasn't been fixed for months. Is there any chance a fix can be cherry picked for stable?

  17. Clovel commented on Jan 21, 2020

    @Clovel

    This is still broken in the 1909 update, it used to work in 1809. Frustrating that it just stopped working, and hasn't been fixed for months. Is there any chance a fix can be cherry picked for stable?

    I too am on 1909, and this doesn't work w/ Ubuntu 18.04 WSL. Either the fix has not been published, or it is broken again.

  18. benhillis commented on Jan 21, 2020

    @benhillis
    Member

    Unfortunately the Windows servicing team would not take this fix to 1903 / 1909. Fixed in builds 18917 and later.

  19. oferze commented on Feb 3, 2020

    @oferze

    As of now, the latest OS build released is 18363.628 (and I'm not daring installing Windows Insider builds) so this feature is broken. Heavily.

  20. alexander-nolan commented on Sep 20, 2020

    @alexander-nolan

    This still isn't working for me on 2004...

  21. therealkenc commented on Sep 21, 2020

    @therealkenc

    This issue is closed. If people are experiencing difficulties on 2004 aka 19041 or better, please spawn a new issue following the template.

    image

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions