3

When I try to mount with the following command:

mount -v -t cifs //<storageaccount>.file.core.windows.net/<sharename> <localfolder> -o username=<myuser>,password=<storageaccountkey>,dir_mode=0777,file_mode=0777,vers=3.0

It works perfectly if I run it from an Azure Ubuntu VM or my Windows machine with the equivalent command.

Trying to run the same command on my Linux box I get the following error:

mount error(13): Permission denied

And this from dmesg:

[ 9421.865985] Status code returned 0xc0000022 STATUS_ACCESS_DENIED

[ 9421.865994] CIFS VFS: Send error in SessSetup = -13

[ 9421.866098] CIFS VFS: cifs_mount failed w/return code = -13

I have the same version of CIFS as the VM: 6.4.

I enabled SMB2-SMB3-SMB3.1.1 (experimental) in my kernel (4.4.21-gentoo).

I have samba installed as well (and it doesn't work with smbclient either) but it is my understanding they are unrelated.

1
  • 1
    Running into the same issue. No luck so far :( Apr 5, 2017 at 7:39

6 Answers 6

3

Unfortunately, you can't yet. Atm only Windows 8, 10 and Window Server 2012 (R2) are supported if mounting outside Azure Datacenter.

The Linux SMB client doesn’t yet support encryption, so mounting a file share from Linux still requires that the client be in the same Azure region as the file share. However, encryption support for Linux is on the roadmap of Linux developers responsible for SMB functionality. Linux distributions that support encryption in the future will be able to mount an Azure File share from anywhere as well.

More Info:

https://azure.microsoft.com/en-us/documentation/articles/storage-how-to-use-files-linux/#overview

2
  • Thank for the response; as I wrote below, my kernel now has SMB3.1.1 enabled, should this support encryption? Do I need to get a newer version of cifs-utils or samba to interact with the kernel module? Oct 18, 2016 at 17:44
  • 1
    I'm trying to find the release notes for this version, but I remember reading something about encryption still being on the to-do list, so the answer would be, no. I'll see If I can find it again. Oct 18, 2016 at 18:56
2

I would definitely recommend you to spawn a Windows-based virtual machine to do the job. I am doing a different story on Windows when I need a reliable NFS server/client on Windows.

1
  • Doesn't make sense in my case, I need to get files onto my Linux machine. In addition, a Ubuntu VM in Azure can use it. Oct 19, 2016 at 22:05
1

Does it work for you with smbclient?

This works for me, while "mount -t cifs -overs=3.0"... does not.

smbclient //foo.file.core.windows.net/test -mSMB3 -e -Ufoo%longkeyhere==
3
  • It doesn't work; it surprises me it works for you, are you using it on an Azure VM? Jan 24, 2017 at 15:33
  • Nope, that's from a remote non-Azure current Arch Linux VM. Mar 12, 2017 at 2:29
  • 1
    smbclient and mount.cifs are divergent
    – Jeff
    Jun 25, 2017 at 19:17
1

Here is the case for me....

When I tried with in Azure (My VM is on Azure and My Storage account is also on the same region) with SMB 3.0, I have been getting mount errors. But when I changed the SMB Version to 2.1, it got succeed. See Below with Examples

Eg:

Failing Command (with SMB 3.0 version) with in Azure

sudo mount -t cifs //storageaccountname.file.core.windows.net/shared /mnt/mount -o vers=3.0,username=xxxxxxx,password=xxxxxxxx,dir_mode=0777,file_mode=0777

Result:

mount error(11): Resource temporarily unavailable Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

Working Command (with SMB 2.1 version) with in Azure

sudo mount -t cifs //storageaccountname.file.core.windows.net/shared /mnt/mount -o vers=2.1,username=xxxxxxx,password=xxxxxxxx,dir_mode=0777,file_mode=0777

Result:

It got mounted successfully

0
1

Recently I was facing same problem. I was trying to mount Azure file service to Azure Linux VM. After multiple attempts, it mounted.

In the last attempt (RHEL 7.4), I upgraded Kernel and added Samba-client, samba-client-libs.

yum install kernel-3.10.0-862.el7.x86_64 yum install samba-client samba-client-libs

I believe the issue was with either, it used samba client rather cifs-util or kernel version was not had some bug.

0

According to your description, I test it again. Unfortunately, we can’t mount File Share outside the Azure VMs. You could use commands to check the installed packages and OS’s kernel for your VMs.

enter image description here

Even though the VM’s packages and OS’s kernel are the same, we could not mount Azure File Share on on-premises VMs. Actually, Linux server hosted in Azure VM will work is because Azure File Storage accept SMB2.1 connection if the client is in the same Azure region as the file share.

However, when you try mount from on-premises, Azure File Storage request SMB 3.0 with Encryption enforced from client, but SMB 3.0 Encryption is something Linux doesn’t support yet, so it won’t work at this moment even your specified SMB 3.0 in your commands.

1
  • Thank for the response; I did actually enable the experimental support for SMB3 in my kernel (CONFIG_CIFS_SMB311) should this be able to use encryption then? Oct 18, 2016 at 17:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .