8

I'm trying to connect to an Azure file share from my Mac running High Sierra 10.13.6 using the following command:

mount_smbfs -d 0777 -f 0777 //dolphins:PASSWORDHERE@dolphins.file.core.windows.net/models /Users/b3020111/Azure

However I keep getting the error:

mount_smbfs: server connection failed: No route to host

I have turned off packet signing in /etc/nsmb.conf:

[default] signing_required=no

After looking around the web I seem to be at a loss as to where to go, any help is appreciated.

Trotts
  • 111
  • 2
  • 5

7 Answers7

13

I got it working with azure provided connection example.

mount_smbfs -d 777 -f 777 //user:key@storageurl/folder ~/mountfolder

Folder in file share needed after url and mountfolder must exist.

But the main reason for "No route to host" was because the access key had forward slash in it! I did a rebuild of key1 until I got a key without forward slash.

BUT! Be aware, rebuilding key will kill all mounts and connections to that storageaccount.

Spinevans
  • 161
  • 1
  • 8
  • The above worked for me. Mount folder must exist and folder/share name after storage url. – Richard McKenna Mar 16 '20 at 10:06
  • 1
    I had the same problem with the forward slash in the key... I wonder how you escape this? – Kevin Smith May 13 '20 at 14:27
  • 3
    You need to urlencode the password. For me, it was replacing the forward slashes with %2f. – Patrick Gardella May 13 '20 at 19:59
  • same error! Worked with a different password that did NOT have a # (pound sign) at the end of the password! This had nothing to do with azure, just a Windows file share. When trying with a different password (and user) it worked. Wild. – AdamE May 25 '22 at 22:03
4

Came across this issue myself today. Do double check that your ISP does not block SMB port 445. In my case, AT&T does actually block this port. I found this in their guide http://about.att.com/sites/broadband/network

The solution for me was to connect with a VPN which I'm already hosting on Azure. Additionally as others have mentioned in this thread, escape any / with %2f. Also, add the share name in the connection URL. For example, if your share name is my-data then the connection URL should contain xxx.file.core.windows.net/my-data.

This is omitted for some reason in the Azure docs/UI and was required for successful connection on OSX.

JohnB
  • 1,743
  • 5
  • 21
  • 40
  • Thanks for '/' escape hint! – Madman Jan 13 '21 at 10:17
  • THIS. I figured this out independently, but wished I had seen this earlier. Many networks (Comcast, the Microsoft corporate network) block 445 traffic. What I found does work is using my T-Mobile iPhone tethered to my computer for testing this code path in my lib. Setting up a VPN is a lot more of a pain, but I'll have to automate that in the future as well. Thanks! – John Lam Nov 16 '21 at 20:05
4

"mount(2) system call failed no route to host "

  • while mounting azure file share on linux vm we can have this error. In my case One package was missing which is - cifs-utils So, I have used below command "sudo yum install cifs-utils -y" to resolv the issue.
Kripa Mishra
  • 331
  • 3
  • 5
2

It was the "/" after all. I had to regenerate the key over ten times till I get a key that doesn't have the "/" character and then it worked fine through the terminal.

Mpro
  • 21
  • 1
  • good catch. I had to regenerate the keys as well to get a key without a `/`. and with that one it finally worked. – omoser Oct 21 '20 at 18:48
1

It should work using the following syntax:

mount_smbfs //<storage-account-name>@<storage-account-name>.file.core.windows.net/<share-name> <desired-mount-point>

Without adding the permissions.

Via Finder:

enter image description here

Source can be found here

  • Hey, I have tried both through Finder and Terminal, and am still not able to connect. mount_smbfs //dolphins@dolphins.file.core.windows.net/dolphin-recognition /Users/b3020111/Azure mount_smbfs: server connection failed: Operation timed out – Trotts Aug 28 '18 at 09:48
0

Important to allow port 445 (TCP) to smb communication. If you don't access it, your firewall block it! Please enable it and try it again.

István Döbrentei
  • 948
  • 10
  • 20
0

I ran into this same problem, and while I was never able to get it working through the terminal I did manage to get it resolved in finder.

Essentially the same instructions as @Adam Smith-MSFT, however one key difference.

I created a directory via Azure's web interface, and after that I was able to connect by adding /<directory-name> to the connection string. Without a directory this would not work at all.

stewbert
  • 51
  • 1
  • 5