If you have Windows 11 anda recent WSL release from the Microsoft StoreMicrosoft Store then systemdSystemd can be used. Once eacha WSL instance is running systemdSystemd, create a mount file such as:
/etc/systemd/system/mnt-wsl-instances-${WSL_DISTRO_NAME}
[Unit]
Description=WSL Instances
[Mount]
What=/
Where=/mnt/wsl/instances/${WSL_DISTRO_NAME}
Type=none
Options=defaults,bind,X-mount.mkdir
[Install]
WantedBy=multi-user.target
And then enable the mount:
sudo systemctl daemon-reload
sudo systemctl enable mnt-wsl-instances-${WSL_DISTRO_NAME}.mount --now
All WSL files are available at /mnt/wsl/instances
.