You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
🤯 WSL symlink is different from Native Linux (VM/Container) symlink #3611
Symlinks interoperability is a must ! Creating symbolic links files either on WSL or from other Linux distributions should be able to work between them (not mentioning Windows OS, only Linux distributions, i.e. VM/Container with shared files with WSL host machine).
It is really weird that for allowing Windows Subsystem for Linux symlinks to work with Windows OS symlinks, interoperability is dropped for Native Linux Kernel. A huge bottleneck for adopting WSL and subsequently Windows for development.
Personally I'm on the verge of switching to a Linux setup for development and dropping Windows as development/user OS altogether, was using Cygwin & Bash.exe till now. It seems that there will always be issues that requires days of searching for a solution, but this one was enough for me (wish I could find this mentioned in the docs before attempting to change my setup).
Use case:
Working with node_modules/.bin/<symlinks> that where installed with WSL or using native Linux. In such case NPM/Yarn on Linux creates relative symlinks for the .bin scripts.
Symlinks support between WSL, Native Linux, Windows OS:
○ WSL created symlink:
WSL - ✔️ Symlink
Docker container - ❌permission denied (No such file or directory).
Ubuntu Hyper-V VM - ❌ shows as a text file.
Windows - ✔️ Symlink
○ Linux Container/VM created symlink:
WSL - ❌ shows as a text file.
Docker container - ✔️ Symlink
Ubuntu Hyper-V VM - ✔️ Symlink
Windows - ❌ shows as a text file.
○ Windows created symlink:Regular soft symbolic link (not Junction)
WSL - ✔️ Symlink
Docker container - ❌permission denied (No such file or directory).
Ubuntu Hyper-V VM - ❌ shows as text file.
Windows - ✔️ Symlink
Versions:
Windows 10 Pro 1803, OS build 17134.345, Developer mode turned on.
WSL Debian GNU/Linux 9.5 (stretch)
Docker for Windows 2.0.0.0-beta1-win75 (19925) edge 915f68b
MobyLinuxVM kernel 4.9.125-linuxkit
Docker Engine: 18.09.0-ce-beta1
Container - any Linux container.
Hyper-V VM Ubuntu 18.04.1
😟 Will symlinks ever be supported between WSL and native Linux ?
Reacted by Simon Wikstrand, ericrousse, Arman Shahinyan, Hokwang Lee, imekachi, Oleg, Yves Chevallier, Steve Meierhofer, fughur, Chen and 3 more
changed the title [-]🤯 WSL symlink is different from VM/Container Linux symlink[/-][+]🤯 WSL symlink is different from Native Linux symlink (VM/Container)[/+]on Oct 12, 2018
changed the title [-]🤯 WSL symlink is different from Native Linux symlink (VM/Container)[/-][+]🤯 WSL symlink is different from Native Linux (VM/Container) symlink [/+]on Oct 12, 2018
therealkenc I experience exactly the same issue as Pierrick Bignet (@RDeluxe) using build 17134.376. #1475 (comment) mentions that fix is included in 17046, so I assume it should already have it. Or is it not the case?
If the fix is already included, please, consider re-opening this issue as at least part of it is still not working as desired.
Anyway here are steps to reproduce the issue without Node/Npm and Docker Compose:
Install Docker for Windows and configure Docker client inside WSL to connect to it (guide).
Open WSL bash and follow the steps:
WSL $ cat 1.sh
#!/bin/sh
echo 1
WSL $ chmod +x 1.sh
WSL $ ln -s ./1.sh 2.sh
WSL $ ls -la
total 0
drwxrwxrwx 1 kushtrim kushtrim 4096 Nov 6 12:58 .
drwxrwxrwx 1 kushtrim kushtrim 4096 Nov 6 11:57 ..
-rwxrwxrwx 1 kushtrim kushtrim 18 Nov 6 12:57 1.sh
lrwxrwxrwx 1 kushtrim kushtrim 6 Nov 6 12:58 2.sh -> ./1.sh
# Both work under WSL
WSL $ ./1.sh
1
WSL $ ./2.sh
1
WSL $ docker run -it --rm -v `pwd`:/opt/test alpine sh
/ # cd opt/test/
/opt/test # ls -la
total 5
drwxrwxrwx 2 root root 0 Nov 6 11:58 .
drwxr-xr-x 3 root root 4096 Nov 6 12:03 ..
-rwxr-xr-x 1 root root 18 Nov 6 11:57 1.sh
ls: ./2.sh: cannot read link: No such file or directory
l--------- 1 root root 0 Nov 6 11:58 2.sh
# Symlink does not work when run inside Docker container being mounted as a volume
/opt/test # ./1.sh
1
/opt/test # ./2.sh
sh: ./2.sh: not found
Activity
[-]🤯 WSL symlink is different from VM/Container Linux symlink[/-][+]🤯 WSL symlink is different from Native Linux symlink (VM/Container)[/+][-]🤯 WSL symlink is different from Native Linux symlink (VM/Container)[/-][+]🤯 WSL symlink is different from Native Linux (VM/Container) symlink [/+]therealkenc commentedon Oct 12, 2018
#1475
safizn commentedon Oct 12, 2018
therealkenc Have you even looked at the issue ? It is not fixed.
Symlinks created by WSL cannot be opened on native Linux (like in containers or VMs).
RDeluxe commentedon Oct 21, 2018
I think this issue should be still opened.
I'm encountering the exact same issue:
npm installin WSL (creates symlinks in node_modules/.bin/)docker-compose upmounts my app in a volume in a alpine containerIn this case, I'm not quite sure who to blame : WSL or Docker.
devoto13 commentedon Nov 6, 2018
therealkenc I experience exactly the same issue as Pierrick Bignet (@RDeluxe) using build 17134.376. #1475 (comment) mentions that fix is included in 17046, so I assume it should already have it. Or is it not the case?
If the fix is already included, please, consider re-opening this issue as at least part of it is still not working as desired.
Anyway here are steps to reproduce the issue without Node/Npm and Docker Compose:
therealkenc commentedon Nov 6, 2018
Yaroslav Admin (@devoto13) - do you have developer mode enabled in your Windows 10.
devoto13 commentedon Nov 7, 2018
therealkenc Yes, enabling developer mode fixes the symlink problem. Sorry for the false alarm.