This post shows students and new users steps to mount or map a network drive or folder in Windows Subsystem for Linux (WSL). In Windows 11, users can map network drives and folders with ease. If you know the path to a shared folder, and you have access to the location, you should be able to map it easily.
Similarly, user can mount or map network locations in WSL environments. Any network location one can reach from within Windows can be mounted or mapped in WSL Linux shell.
In a WSL environment, users can mount network locations two or more ways. One way is to map a network folder similar to mounting a removeable drive in WSL. Once the drive is mounted with a drive letter, you can then use the mount command to map the drive to a mount point in Linux.
The commands below can be used to mount a network drive assigned letter F in WSL environment.
sudo mkdir /mnt/f sudo mount -t drvfs F: /mnt/f
Mapping a network folder follows similar approach.
How to map a network folder in Windows Subsystem for Linux
As mentioned above, any network location you can reach from within Windows can be mounted or mapped from the Linux shell.
If you know the UNC (Universal Naming Convention) path for a particular folder or drive, and you have access to the location, you can mount it in WSL shell environment.
For example, if the path to the network share is \\server\documents, you can run the commands below to mount it in WSL.
First, create a mount point in Linux to where you’d want to map the shared network folder. Run the commands below to create a mount point if it’s not already created.
sudo mkdir /mnt/documents
Once the mount point is created, run the commands below to mount the network share.
sudo mount -t '\\server\documents' /mnt/documents
If the network location is password protected, you may have to use the net use command to map the location instead.
For example, you can use the net use command to mount the network path \\server\documents with the username Jdoe and the password MyPassword to map it to your F: drive.
net.exe use f: \\server\documents /user:Jdoe MyPassword
That should mount the network location mapped to the F drive in WSL. To unmount, simply run the commands below.
sudo umount /mnt/documents
That should do it!
The post below also shows you how to mount a removable drive in WSL.
This post showed you how to mount a network folder or share in Window Subsystem for Linux. If you find any error above or have something to add, please use the comment form below.