Bash on Ubuntu on Windows Mount Network Share

12

4

I have updated Windows 10 and installed the new bash on windows.

However on both PC's I have tried I am unable to mount a network share.

I've tried many different ways to mount the share:

sudo mount -t cifs -o username=xx,password=xx //192.168.x.x/Share /mnt/s

When running the above command it looks like it has worked, no errors (even with the --verbose option) However going to /mnt/s shows nothing and mount shows: //192.168.x.x/Share on /mnt/s type cifs (rw).

I am able to browse all the files/folders on the share using smbclient

user3906878

Posted 2016-08-16T18:50:58.107

Reputation: 121

1I'm running into the same problem. Even if you mount the share from Explorer it won't be listed under /mnt/ (unlike the other internal or external drives). I think this is a limitation of the current implementation but really would love to hear more about this. – Astaar – 2016-08-28T13:39:15.943

@Astarr Same, I have the share mounted in Windows as a "drive" however bash is only showing "real" drives. I can't see anything online about this or track any progress when it might be fixed. If you find any information about this issue I would very much appreciate it. – user3906878 – 2016-08-28T15:58:40.993

1

There's an issue open ob their Github. That's all I could find: https://github.com/Microsoft/BashOnWindows/issues/214

– Astaar – 2016-08-28T21:23:43.190

@Astarr great thanks! will keep an eye on the github issue aswell. – user3906878 – 2016-08-29T21:49:09.750

1

See this article https://www.howtogeek.com/331053/

– Biswapriyo – 2017-11-10T10:20:38.820

Answers

4

WSL has been under heavy development and it now supports mounting network shared folders:

sudo mkdir /mnt/s
sudo mount -t drvfs '\\192.168.x.x\Share' /mnt/s
cd /mnt/s
git init

Old answer

I'm actually answering your comment here:

I'm looking for a solution or workaround to the issue (such as another program) that will allow me to run git inside a folder on the share.

Use Cygwin:

net use V: \\\\192.168.x.x\\Share
cd /cygdrive/v
git init

Or cmder:

net use V: \\192.168.x.x\Share
V:
git init

Or git-scm.

simlev

Posted 2016-08-16T18:50:58.107

Reputation: 3 184

There is no need for cygwin. Use git for windows (https://git-scm.com/download/win) and mount remote drive with net use (or Windows Explorer) as usual.

– FractalSpace – 2017-11-09T15:44:10.743

@FractalSpace Yes, git-scm is just as good. – simlev – 2017-11-10T09:42:52.327

0

The Windows Subsystem for Linux is still in beta, and some features are not fully implemented. Other features that are could still have bugs.

For example, I had a problem with ln on some machines seemingly linking directories properly, but there were issues cding to subdirectories in the target.

Since mounting a drive uses a similar folder redirection transparency, that may be the cause of the issue. The fact that it's a network share probably introduces a number of quirks by itself.

PC Luddite

Posted 2016-08-16T18:50:58.107

Reputation: 230

Thanks for the reply, I understand that it's in beta however I'm looking for a solution or workaround to the issue (such as another program) that will allow me to run git inside a folder on the share (even looked for a github issue so I could track if it's fixed or not). – user3906878 – 2016-08-19T20:07:59.973

0

I used:

sudo mount -t drvfs \\path\to\server\share /mnt/u

Where /mnt/u had already been created.

Since I log connect to bash with my domain credentials, no need for adding creds nanoto command. Read and write works with my permissions.

Now to get it to mount using fstab...

Ken S

Posted 2016-08-16T18:50:58.107

Reputation: 11

This seems to be your first contribution. Please, read other answers before yours, as you posted the same command that was posted in 2017. Thanks for joining our community :D – DGoiko – 2019-05-10T19:53:28.750