1

The documentation to mount ext4 drive into Windows using WSL is clearly explain here (https://learn.microsoft.com/en-us/windows/wsl/wsl2-mount-disk)

However, anytime I close my WSL2 session, I lose access to the drive from within windows... as expected.

Is there a workaround to keep WSL running in the background so that my mounted drive(s) continue to be accessible from within Windows?

1 Answers1

1

I found a way to keep a mounted drive available in Windows even after closing the WSL2 window. After having the drive properly mounted in WSL and accessible via Windows explorer, the trick was to keep the WSL2 Ubuntu instance running in the background.

That can be done by creating a CMD script (i.e. wsl_bg.cmd) in in the Windows startup folder: (crl+r -> shell:startup)

wsl_bg.cmd:

wsl bash -c "nohup bash -c 'while true; do sleep 1h; done &' &>/dev/null "