Mounting network drive in Windows 10 bash?
In my windows 10 command prompt, when I need to set the drive to some network shared drive I just use
net use V: //192.168.xxx.xxx/folder
I added Bash on Ubuntu on Windows in my Windows 10, and I'd like to have access to my network drives from the terminal as well, so I tried mounting it
sudo mount -t cifs -o username=myusername //192.168.xxx.xxx/folder /mnt/new_folder
where I created my new_folder
in the /mnt
folder, but I get the error
sudo: cannot find computer COMPUTER NAME
Where COMPUTER NAME
is the actual name of my computer that I can see in the Explorer as well.
What am I doing wrong and how can I mount network drives in my windows bash?
EDIT:
I got it to work partially, by adding my computer name in the hosts file in etc/hosts
127.0.1.1 COMPUTER NAME
But I still cannot mount the network drive
Support for WSL accessible mounting of network drives (as well as removable local drives) was announced April 2017. Not sure which build exactly was the first to include it but my guess is around 15063.250 and above should be recent enough. If you do have support then you can now run:
sudo mount -t drvfs '\\192.168.xxx.xxx\folder' /mnt/new_folder
(Note that the network path must be in expressed in backslashes and thus has to be quoted to stop the shell automatically turning them into forward slashes.)