-
Notifications
You must be signed in to change notification settings - Fork 860
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
Bind mounting /mnt/c to /mnt/wsl/c breaks other distros #6196
Comments
As always, I'm available for any additional info / would gladly help anyway I can |
dmesg output:
I can't see anything related. ConfigApplyLibPath seem to trigger an error in distros without a /etc/ls.so.conf.d dir (as Alpine which does not ship with a glibc anyway). |
ConfigApplyWindowsLibPath function is not related to mounting |
Thanks for reporting this @simonferquel. Looking at the commands in the original post, this seems normal as /mnt/c is only bind mounted from the Ubuntu distro and it's not mounted from the Alpine distro. For context: /mnt/wsl is shared between all distros, but /mnt isn't. Does that make sense ? |
@OneBlue automount is enabled on both distros, and automount root is set as To give a little context here, I am working on Docker Desktop. In our setup, we run the |
@simonferquel: I've had a deeper look, and here's the root cause: When init is about to mount a drive, it searches So when you bind mount I've made a code change to only skip a mount if the both source drive AND the mount point are the same, which should solve your scenario. |
@OneBlue thanks a lot ! |
@simonferquel: Unfortunately no, we won't be able to backport the fix for this. The fix has made it to insider so closing this. |
Environment
Note also applies to all WSL2 versions (Windows 10 2004 and the backport to 1903 / 1909) - running the test cas in Docker Desktop CI reproduces the issus in all versions.
Steps to reproduce
You need 2 distros to reproduce the issue.
I'll do the repro script with an Ubuntu + Alpine environment
/mnt/c
to/mnt/wsl/c
: (/mnt/wsl/
prefix is important, it is to make sure it is present in all mount namespaces that mounts the/mnt/wsl
shared tmpfs):(note that Alpine at this point has not been started, WSL has not initialized its mount namespace)
/mnt/c
:(it is empty)
/mnt/wsl/c
:Note that the c drive is indeed mounted in
/mnt/wsl/c
but wsl init process "forgot" to mount it into/mnt/c
WSL logs:
Not sure how to grab the /init logs for a given distro (that would really help to know that btw).
Expected behavior
My C drive in Alpine should be accessible from
/mnt/c
(as well as from/mnt/wsl/c
as it has been bind-mounted there from Ubuntu - it is the intended goal of/mnt/wsl
: share partial filesystem view accross distros by using bind mounts and shared propagationActual behavior
My C drive in Alpine is only accessible from
/mnt/wsl/c
, not from/mnt/c
.This was discovered by trying to fix docker/for-win#9364
The text was updated successfully, but these errors were encountered: