How to mount a WSL2 folder as a Network Drive in Windows 10+?

Federico Navarrete 616 Reputation points
2022-08-22T14:49:29.26+00:00

I have created a shared folder in my WSL2 instance (Ubuntu 20.04.4 LTS) which seems to be accessible and working. I created the folder in the /mnt/wsl location. After that, I can access the new folder in Windows File Explorer using *\wsl$*.

233560-w84sn.png

Everything seems to be perfect. However, my main challenge is that I must access the folder ae-games from a .NET App. We are trying to mount it as a Network Drive, but when we try it says the path doesn't exist:

preview2

233525-tiwka.png

We are trying to mount the drive because the folder contains thousands of files that we are analyzing coming from an EFS Shared Drive in AWS.

Our current workaround is copying the files from EFS to Windows every couple of hours. However, this is problematic because the shared drive is massive, and S3 is not an option because of ECS and Fargate limitations.

Does anyone know if this is a WSL2 limitation that we can't mount as a Network Drive? Or can someone guide me and tell me what I'm doing wrong?

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,195 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Karlie Weng 16,431 Reputation points Microsoft Vendor
    2022-08-30T08:47:48.433+00:00

    Hello @Federico Navarrete

    That seems by design, but mount root folder is possible .

    These 2 thread address the same issue:

    Could not mapping path \wsl$\<distro_name> to network drive · Issue #3854 · microsoft/WSL · GitHub
    Mapping network drive to \wsl$\path does not work · Issue #3996 · microsoft/WSL · GitHub

    I would suggest to post WSL related issue in GitHub - microsoft/WSL: Issues found on WSL

    Best Regards
    Karlie

    0 comments No comments