In this brief article, I share the core details for how to configure Linux and WSL so that you can connect to a network drive on windows.
Step 1. Open the CMD on Windows 10. If press the Windows logo key + R, and then type in cmd to search for Command Prompt, you can open CMD.
Step 2. In the CMD that opens, type these commands below so that it can mount a network drive on Windows 10.
net use z: "\\domainname" [password] [/user:domainname\username]
Note: This example is we mount a network drive to Z drive.
Ubuntu on Windows 10(WSL)
Step 1. Create a new directory on Windows 10 with WSL.
mkdir /mnt/z mount -t drvfs z: /mnt/z
After that, you can access a network drive from WSL.
If you want to access to that, please type a command below.
Step 2. the following command so that it can access the network drive all the time when you open a new shell.
echo "echo UserPassword" | sudo -S mount -t drvfs z: /mnt/z >> ~/.bashrc
If you want to know more details, please comment on this article.