ubuntu-wsl2-systemd-script icon indicating copy to clipboard operation
ubuntu-wsl2-systemd-script copied to clipboard

Linux binds aren't seen in Windows/Docker

Open zeidoo opened this issue 4 years ago • 0 comments

Hi,

After installing this script bind mounts aren't visible in windows and docker/kubernetes anymore.

sudo mkdir /mnt/wsl/somedir
sudo mount --bind /some/folder/withfiles/ /mnt/wsl/somedir
ls /mnt/wsl/somedir
<shows files>

Windows explorer: \\wsl$\<distro>\mnt\wsl\somedir
<no files shown>

In bash.bashrc comment out:

# Start or enter a PID namespace in WSL2
#source /usr/sbin/start-systemd-namespace <-- this line

Restart WSL:

powershell: wsl --shutdown

Repeat these steps:

sudo mkdir /mnt/wsl/somedir
sudo mount --bind /some/folder/withfiles/ /mnt/wsl/somedir
ls /mnt/wsl/somedir
<shows files>

Windows explorer: \\wsl$\<distro>\mnt\wsl\somedir
<shows files> <-- this now works

Any ideas?

zeidoo avatar Mar 29 '21 18:03 zeidoo