Samba - How To Access Mounted Network Drive On Windows Linux Subsystem - Super User
Samba - How To Access Mounted Network Drive On Windows Linux Subsystem - Super User
- Super User
57 samba windows-subsystem-for-linux
Share Improve this question edited Dec 2, 2019 at 9:58 asked Sep 27, 2016 at 4:14
Sorted by:
7 Answers
Highest score (default)
[Update -- apparently this feature is available in build 16176. I haven't tried it yet.]
34 No, though there may be some trick I haven't discovered. Windows Subsystem for Linux does
not mount network drives. A Microsoft employee says here (in a comment):
We only “mount” fixed drives at this time. USB/removable/network drives are not
handled at this time. This capability is on our backlog, but it’s not on the cards
anytime soon.
The link works just fine in "normal" Windows (cmd.exe, PowerShell, file explorer, etc.), but is
https://superuser.com/questions/1128634/how-to-access-mounted-network-drive-on-windows-linux-subsystem/1261563#1261563 1/6
16/6/22, 12:28 samba - How to access mounted network drive on Windows Linux Subsystem? - Super User
invisible to WSL:
$ ls -ld /mnt/c/some/directory
/mnt/c/some/directory not found
For my own use, this limitation is a show-stopper. I have things on network drives that I'm not
willing to move. There are alternatives; I'm using Cygwin.
Share Improve this answer Follow edited Jan 30, 2019 at 21:41 answered Oct 18, 2016 at 21:43
Joseph Thvedt
613 5 5
Agreed, this is a showstopper for me too - I just installed msys2 for this.
– Ela782
Apr 7, 2017 at 17:55
7 Details: blogs.msdn.microsoft.com/wsl/2017/04/18/…
– bleater
May 3, 2017 at 0:34
6 This answer is not useful. The highest rated answer explains how to do it.
– mbomb007
Nov 19, 2020 at
20:17
Confirming: network share strategy into WSL currently works for me, thanks for answer.
– amateur barista
Mar 18, 2021 at 20:54
277
Mounting DrvFs
In order to mount a Windows drive using DrvFs, you can use the regular Linux mount
command. For example, to mount a removable drive D: as /mnt/d directory, run the
following commands:
Now, you will be able to access the files of your D: drive under /mnt/d. When you
wish to unmount the drive, for example so you can safely remove it, run the following
command:
Your privacy
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose
Mounting network locations
information in accordance with our Cookie Policy.
Note the single quotes around the UNC path; these are necessary to prevent the
need to escape the backslashes. If you don't surround the UNC path with single
quotes, you need to escape the backslashes by doubling them (e.g.
\\\\server\\share ).
WSL does not have any way to specify which credentials to use to connect to a
network share. If you need to use different credentials to connect to the server,
specify them in Windows by navigating to the share in File Explorer, using the
Windows Credential Manager, or the net use command. The net use command can
be invoked from inside WSL (using net.exe use) via interop. Type net.exe help use for
more information on how to use this command.
Share Improve this answer Follow edited Jun 12, 2020 at 13:48 answered Oct 23, 2017 at 10:20
Community Bot gman
1 4,374 3 23 26
6 totally worked for my "bash for windows 10"! Thank you so much!
– Ying Zhang
Jan 26, 2018 at 0:55
25 The correct answer should be changed to this one as it directly answers the question.
– Tomek
Jan 31,
2018 at 2:43
6 This mounts the share, but everything is owned by root, and some files are unreadable (even with sudo,
and even if the permissions inside WSL are 777). I can read the files from windows file explorer. Adding
any mount options ( -o ) gives me "wrong fs type, bad option, bad superblock" error.
– Jay K
Nov 13,
2018 at 17:46
WSL2 supports CIFS (SMB) protocol. You may need to specify your network server version
when mounting. E.g. on Ubuntu 20.04:
15
$ sudo apt install cifs-utils
$ sudo mount -t cifs -o user=joe,pass=shmo,vers=1.0 //server/share /mnt/share
I just ran across this issue recently where I have a Mac host running a vmware fusion with
Accept all cookies
windows Customize
10 installed settings
as a guest OS. I installed WSL (ubuntu) in the windows 10. I am sharing a
13 folder on my Mac (~/Public) with all my fusion guest O/S, and it works seemlessly with any
linux/bsd guest OSes On Windows 10 the network drive for the shared folder is \vmware
https://superuser.com/questions/1128634/how-to-access-mounted-network-drive-on-windows-linux-subsystem/1261563#1261563 3/6
16/6/22, 12:28 samba - How to access mounted network drive on Windows Linux Subsystem? - Super User
linux/bsd guest OSes. On Windows 10, the network drive for the shared folder is \vmware-
host\Shared Folder\Public\ and is accessible from the windows 10, and is also mounted on Z:
drive as well.
Its funny how you can use none-windows filesystem drives in windows, but in wsl/linux, you
can only see windows filesystem drives....
as long as the network drive is using native windows filesystem (ntfs, fat*).
Share Improve this answer Follow edited Mar 25, 2020 at 7:35 answered Dec 4, 2019 at 16:04
Community Bot Marcus Yoo
1 161 1 2
see https://github.com/Microsoft/WSL/issues/2999#issuecomment-455835951
4 Here is a way to mount GFS in WSL based on Getting `sshfs` working on WSL or finding an
alternative The trick is to use https://www.nsoftware.com/sftp/netdrive/ to ssh to GFS from
Your Windows
privacy and convert it to a filesystem that can be mounted under WSL.
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose
1. Install
information OpenSSH
in accordance Server
with underPolicy
our Cookie Win10
Win10
. Settings -> Apps -> Manage optional
features -> Add feature -> OpenSSH Server
restart if necessary
open Services ->
Accept allOpenSSH
cookies ->Customize
Properties -> Startup Type -> Automatic (delayed)
settings
2. Install and run SFTPNetDrive, right click on icon in hidden icons -> Main window (or
maybe already open) > Profile > new profile ( server: localhost user: * pwd:* Drive
https://superuser.com/questions/1128634/how-to-access-mounted-network-drive-on-windows-linux-subsystem/1261563#1261563 4/6
16/6/22, 12:28 samba - How to access mounted network drive on Windows Linux Subsystem? - Super User
maybe already open) -> Profile -> new profile ( server: localhost, user: * pwd:* Drive
Letter: F (or another)
Advanced -> ( Protocol -> uncheck compression; Specified folder:
G:\ ) )
I'm not sure how stable it is, but I was able to open files in WSL.
Share Improve this answer Follow answered Jan 20, 2019 at 12:01
Christopher Crawford
161 1 3
0 1. The Bash that comes with WLS (when installing Linux on Windows 10 from Windows Store
or other sources)
2. Git-Bash on Windows
Git-Bash has access to network folders (install git-bash > go to the network folder > right-
click > "Git Bash Here" > run pwd to see the path).
If you have to use the WLS version of bash, then you can call Git-Bash from WLS bash as
follows:
Share Improve this answer Follow edited Dec 11, 2018 at 1:27 answered Dec 11, 2018 at 0:21
LoMaPh
163 5
1 WSL non-windows net drives don't work, this git-bash answer is the only answer that did. Question
shouldn't be negative, please vote up.
– Gringo Suave
Dec 11, 2019 at 21:09
The answer looks like it's trying to tell how to use bash, before saying why. Maybe it should be
rewritten. Anyway, it's now 2021, and network drives can be mounted. (Also, my Git bash just crashed
when I tried the "Git Bash Here" trick, so I'm not sure it even works.)
– Tom Hundt
Feb 9, 2021 at 20:21
0 https://www.public-health.uiowa.edu/it/support/kb48568/
Your privacy
All instructions below from that source.
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose
information in accordance with our Cookie Policy.
Ensure the folder exists for the mount target (e.g. /mnt/m)
Accept
Openall cookies
/etc/fstabCustomize
and addsettings
a line such as the following:
Your privacy
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose
information in accordance with our Cookie Policy.
https://superuser.com/questions/1128634/how-to-access-mounted-network-drive-on-windows-linux-subsystem/1261563#1261563 6/6