WSL: Executing a symlink to a windows executable does nothing
Hello, the pathology I am seeing is identical to that reported in the following: https://github.com/Microsoft/WSL/issues/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
verat 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$ `
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 19
- Comments: 21 (4 by maintainers)
Commits related to this issue
- Fixed issues flashing on WSL. WSL needs /c not //c, and symlinks are fully resolved before calling .exes due to this bug: https://github.com/microsoft/WSL/issues/3999 — committed to aarchangel64/qmk_firmware by aarchangel64 7 years ago
- win,runtime: Fix problem when win32yank was a symbolic link in WSL [skip ci] (#12124) On some versions of Windows, WSL is unable to execute symbolic links to Windows executables (microsoft/WSL#3999)... — committed to neovim/neovim by erw7 7 years ago
This is a problem when the argument is a string with spaces. change to this
I’ve identified the issue, it’s related to us now supporting the 9P paths (\wsl$\distro) in wslpath and am drafting a fix.
@benhillis Do you know yet whether a backport to 1903 is possible/likely? I assume it would be delivered through standard Windows Update patching.
Instead, I now need to write a startup shell script.
vim /usr/local/bin/dockerOr you may use
/mnt/c/Program Files/Docker/Docker/Resources/bin/docker.exeif you have a default mount point.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 have the same issue in my
Win10 version 1903 build 18362.53.I have been running
docker.exevia a symbolic link on build 1809, and it doesn’t work after upgrading to 1903.On 1809:
On 1903:
A simply repro:
This should get you into cmd but nothing happens after running, and the program doesn’t have any output.
This still isn’t working for me on 2004…
This issue is closed. If people are experiencing difficulties on 2004 aka 19041 or better, please spawn a new issue following the template.
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.
Unfortunately the Windows servicing team would not take this fix to 1903 / 1909. Fixed in builds 18917 and later.
Working great on the insider builds.
I am able to reproduce with Windows Version
10.0.17758.4as well.WSL + Ubuntu 18.04 LTS
Easy repro: Follow https://docksal.io/installation#windows-virtualbox on this setup