Bash on Ubuntu on Windows Mount Network Share

11,395

Solution 1

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.

Solution 2

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...

Share:
11,395

Related videos on Youtube

user3906878
Author by

user3906878

Updated on September 18, 2022

Comments

  • user3906878
    user3906878 over 1 year

    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

    • Astaar
      Astaar over 7 years
      I'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.
    • user3906878
      user3906878 over 7 years
      @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.
    • Astaar
      Astaar over 7 years
      There's an issue open ob their Github. That's all I could find: github.com/Microsoft/BashOnWindows/issues/214
    • user3906878
      user3906878 over 7 years
      @Astarr great thanks! will keep an eye on the github issue aswell.
    • Biswapriyo
      Biswapriyo over 6 years
      See this article howtogeek.com/331053
  • user3906878
    user3906878 over 7 years
    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).
  • Shawn
    Shawn over 6 years
    There is no need for cygwin. Use git for windows (git-scm.com/download/win) and mount remote drive with net use (or Windows Explorer) as usual.
  • simlev
    simlev over 6 years
    @FractalSpace Yes, git-scm is just as good.
  • DGoiko
    DGoiko almost 5 years
    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