Skip to content
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

crossDistro mount's no longe workr #9472

Closed
1 of 2 tasks
cforce opened this issue Jan 11, 2023 · 5 comments
Closed
1 of 2 tasks

crossDistro mount's no longe workr #9472

cforce opened this issue Jan 11, 2023 · 5 comments

Comments

@cforce
Copy link

cforce commented Jan 11, 2023

Version

Microsoft Windows [Version 10.0.19045.2364]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

Linux version 5.15.79.1-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220)

Distro Version

Ubuntu 22.04 and AmazonLinux2(https://aws.amazon.com/jp/blogs/developer/developing-on-amazon-linux-2-using-windows/,

Other Software

WSL version: 1.0.3.0
Kernel version: 5.15.79.1
WSLg version: 1.0.47
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19045.2364
crossDistro feature since https://learn.microsoft.com/en-us/windows/wsl/release-notes#build-18970

Repro Steps

I was using mounting the distro Ubuntu in the distro Amazon2 by using on both
/etc/wsl.conf

[wsl2]
memory=8GB
processors=2

[network]
generateResolvConf = false

[interop]
enabled = true
appendWindowsPath = false

# Automatically mount Windows drive when the distribution is launched
[automount]
crossDistro = true
enabled = true
root = /

Expected behavior

Allow to access Ubuntu under Amazon2 distro via /mnt/wsl/Ubuntu or vice versa
/mnt/wsl/Amazon2

On Ubuntu:

>findmnt / -o PROPAGATION,TARGET
PROPAGATION TARGET
shared /

>? ll /
total 2.0M
drwxr-xr-x 27 root root 4.0K Jan 9 14:51 ./
drwxr-xr-x 27 root root 4.0K Jan 9 14:51 ../
lrwxrwxrwx 1 root root 7 Feb 20 2021 bin -> usr/bin/
drwxr-xr-x 2 root root 4.0K Feb 20 2021 boot/
drwxrwxrwx 1 root root 4.0K Jan 2 22:19 c/
drwxr-xr-x 3 root root 4.0K Oct 21 17:51 datadog/
drwxr-xr-x 10 root root 3.1K Jan 9 14:55 dev/
drwxr-xr-x 119 root root 12K Jan 9 15:01 etc/
drwxr-xr-x 5 root root 4.0K Dec 7 15:27 git/
drwxr-xr-x 6 root root 4.0K Dec 13 08:49 home/
drwxr-xr-x 9 root root 4.0K Jan 4 11:07 include/
-rwxrwxrwx 1 root root 1.9M Jan 1 1970 init*
lrwxrwxrwx 1 root root 7 Feb 20 2021 lib -> usr/lib/
lrwxrwxrwx 1 root root 9 Feb 20 2021 lib32 -> usr/lib32/
lrwxrwxrwx 1 root root 9 Feb 20 2021 lib64 -> usr/lib64/
lrwxrwxrwx 1 root root 10 Feb 20 2021 libx32 -> usr/libx32/
drwx------ 2 root root 16K Apr 10 2019 lost+found/
drwxr-xr-x 2 root root 4.0K Feb 20 2021 media/
drwxr-xr-x 6 root root 4.0K Jan 28 2022 mnt/
drwxr-xr-x 5 root root 4.0K Dec 15 10:42 opt/
dr-xr-xr-x 252 root root 0 Jan 9 14:51 proc/
drwx------ 24 noroot root 4.0K Jan 9 15:03 root/
drwxr-xr-x 6 root root 200 Jan 9 14:52 run/
lrwxrwxrwx 1 root root 8 Feb 20 2021 sbin -> usr/sbin/
drwxr-xr-x 3 root root 4.0K Jan 4 10:25 share/
drwxr-xr-x 6 root root 4.0K Feb 20 2021 snap/
drwxr-xr-x 2 root root 4.0K Feb 20 2021 srv/
drwxr-xr-x 6 root root 4.0K Jan 4 11:48 staticlibs/
dr-xr-xr-x 11 root root 0 Jan 9 14:51 sys/
drwxrwxrwt 6 root root 12K Jan 9 14:53 tmp/
drwxr-xr-x 14 root root 4.0K Feb 19 2022 usr/
drwxr-xr-x 13 root root 4.0K Feb 20 2021 var/
drwxrwxrwt 5 root root 120 Jan 9 14:52 wsl/
drwxrwxrwt 7 root root 300 Jan 9 14:51 wslg/

? ll /wsl
total 8.0K
drwxrwxrwt 5 root root 120 Jan 9 14:52 ./
drwxr-xr-x 27 root root 4.0K Jan 9 14:51 ../
drwxr-xr-x 4 root root 100 Jan 9 14:52 docker-desktop/
drwxr-xr-x 3 root root 60 Jan 9 14:52 docker-desktop-bind-mounts/
drwxr-xr-x 4 root root 80 Jan 9 14:52 docker-desktop-data/
-rw-r--r-- 1 root root 197 Jan 9 14:51 resolv.conf

? ll /mnt/wsl/
total 12K
drwxr-xr-x 3 root root 4.0K Jan 8 12:30 ./
drwxr-xr-x 6 root root 4.0K Jan 28 2022 ../
drwxr-xr-x 2 root root 4.0K Jan 8 12:30 Ubuntu/

? ll /mnt/wsl/Ubuntu
total 8.0K
drwxr-xr-x 2 root root 4.0K Jan 8 12:30 ./
drwxr-xr-x 3 root root 4.0K Jan 8 12:30 ../

On Apache2:

-bash-4.2# ll /mnt/
c/ wsl/
-bash-4.2# ll /mnt/wsl/
Amazon2/ Ubuntu/
-bash-4.2# ll /mnt/wsl/Ubuntu/
total 0

-bash-4.2# ll /mnt/wsl/Amazon2/
total 0

-bash-4.2# ll /
total 1960
lrwxrwxrwx 1 root root 7 Jun 13 2022 bin -> usr/bin
dr-xr-xr-x 2 root root 4096 Apr 9 2019 boot
drwxrwxrwx 1 root root 4096 Jan 2 22:19 c
drwxr-xr-x 10 root root 3140 Jan 9 14:55 dev
drwxr-xr-x 49 root root 4096 Jan 9 15:04 etc
drwxr-xr-x 2 root root 4096 Apr 9 2019 home
-rwxrwxrwx 1 root root 1939720 Jan 1 1970 init
lrwxrwxrwx 1 root root 7 Jun 13 2022 lib -> usr/lib
lrwxrwxrwx 1 root root 9 Jun 13 2022 lib64 -> usr/lib64
drwxr-xr-x 2 root root 4096 Jun 13 2022 local
drwx------ 2 root root 16384 Apr 10 2019 lost+found
drwxr-xr-x 2 root root 4096 Apr 9 2019 media
drwxr-xr-x 4 root root 4096 Dec 23 09:29 mnt
drwxr-xr-x 2 root root 4096 Apr 9 2019 opt
dr-xr-xr-x 265 root root 0 Jan 9 15:04 proc
dr-xr-x--- 4 root root 4096 Jan 8 12:42 root
drwxr-xr-x 6 root root 120 Jan 9 15:04 run
lrwxrwxrwx 1 root root 8 Jun 13 2022 sbin -> usr/sbin
drwxr-xr-x 2 root root 4096 Apr 9 2019 srv
dr-xr-xr-x 11 root root 0 Jan 9 14:51 sys
drwxrwxrwt 7 root root 4096 Jan 8 13:10 tmp
drwxr-xr-x 13 root root 4096 Jun 13 2022 usr
drwxr-xr-x 18 root root 4096 Jun 13 2022 var
drwxrwxrwt 5 root root 120 Jan 9 14:52 wsl
drwxrwxrwt 7 root root 300 Jan 9 15:04 wslg

-bash-4.2# findmnt / -o PROPAGATION,TARGET
PROPAGATION TARGET
shared /

I also tried
1.) adding this as well to /etc/wsl.conf

[boot]
command="mount --make-rshared /"

2.) manually executing on each Distro

if [ ! -d "/mnt/wsl/$WSL_DISTRO_NAME" ]; then
mkdir "/mnt/wsl/$WSL_DISTRO_NAME"
fi
## If mount point directory is not mounted upon, bind mount fs.
if ! mountpoint -q -- "/mnt/wsl/$WSL_DISTRO_NAME"; then
mount --make-rshared --bind --make-private / "/mnt/wsl/$WSL_DISTRO_NAME"
fi
findmnt / -o PROPAGATION,TARGET

Expected Behavior

On both Distros the other one's file system is read/write mounted (e.g under /mnt/wsl/Ubuntu and /mnt/wsl/Amazon2
It once worked and i don't know what upgrade? broke it.

Actual Behavior

no mount for other distro found

Diagnostic Logs

No response

@elsaco
Copy link

elsaco commented Jan 14, 2023

@cforce please see issue #4654 for what changed!

@cforce
Copy link
Author

cforce commented Jan 14, 2023

Did you read my report completely. As I said I also tried that manual mount approach which was not fixing it -see 2.)

@elsaco
Copy link

elsaco commented Jan 14, 2023

@cforce it does work! It doesn't show up automatically under /mnt/wsl but whatever you mount under this path it pops up in other distors.

@benhillis
Copy link
Member

Sharing state between distros should be done explicitly now, via mounting in /mnt/wsl. Distros are no longer mounted there automatically.

@benhillis benhillis closed this as not planned Won't fix, can't repro, duplicate, stale Jan 17, 2023
@cforce
Copy link
Author

cforce commented Jan 18, 2023

I have run below on both DIstros and still there are no mounts of own and/or other Distros under /mnt/wsl.

if [ ! -d "/mnt/wsl/$WSL_DISTRO_NAME" ]; then
mkdir "/mnt/wsl/$WSL_DISTRO_NAME"
fi
## If mount point directory is not mounted upon, bind mount fs.
if ! mountpoint -q -- "/mnt/wsl/$WSL_DISTRO_NAME"; then
mount --make-rshared --bind --make-private / "/mnt/wsl/$WSL_DISTRO_NAME"
fi

Maybe related to #4139

However it worked formerly as automount

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants