Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

How to make SMB shares on FreeNAS with Mac clients smoking fast! OS X solved

Allan Wilmath

FreeNAS Aware
Joined
Nov 26, 2015
Messages
99
Thanks
19
#1
I spend the day trying stuff and researching, thought I'd make a post with what I found that solved my problem.

The two solutions I found on the internet, and I should have thought ahead so I could credit their authors, are:

Go in to the advanced settings for each Windows share using the advanced button at the bottom of the share configuration window in the FreeNAS web GUI. Move the 'fruit' VFS object over to the right on each share you access with a Mac.

The second is to turn of client signing on Mac, the command line to do this in the terminal is:

sudo printf "[default]\nsigning_required=no\n" | sudo tee /etc/nsmb.conf >/dev/null

With these two changes I can now transfer between FreeNAS using SMB and a Mac above the theoretical max of gigabit, making SMB the highest performing network file transfer protocol. The connecting to and browsing of network shares is now equal to Windows. The transfers are actually faster than Windows, though to be fair I am using Windows 10 in a virtual machine.

The server is built from the recommended list, the same hardware the FreeNAS developers use to virtualize on ESXi. It's all enterprise stuff, so it was frustrating why the poor performance. The test file was a DVD iso image. I'm sure small files will still be slower, but I am seeing around 90MB/s for moving a folder of small pictures from the server. All speeds are for copying files FROM FreeNAS. I am using macOS beta, macOS current, and El Capitan. FreeNAS is on the latest 9.10 production.
 
Last edited by a moderator:

tvsjr

FreeNAS Guru
Joined
Aug 29, 2015
Messages
943
Thanks
316
#2
Just keep in mind this leaves you vulnerable to a man-in-the-middle attack. If you operate in a regulated environment, this change will likely displease the auditors.
 
Joined
Jan 25, 2017
Messages
3
Thanks
0
#3
I've been looking for this for months, finally someone found the solution. Allan, you ROCK man!
 
Last edited by a moderator:

tvsjr

FreeNAS Guru
Joined
Aug 29, 2015
Messages
943
Thanks
316
#4
Sir, if you would read my post in greater detail, you would notice I stated "regulated environment". Making this change is just fine for your home storage box, or for your FreeNAS system as Joe's Server Hosting and Bait Shop. If you are in the government/military/defense, financial services, or other such industries, this change would get you hauled in front of the auditors to justify why you did what you did.
 
Last edited by a moderator:

anodos

Belly-button Lint Extraordinaire
iXsystems
Joined
Mar 6, 2014
Messages
5,280
Thanks
1,431
#6
SMB signing is pretty well known to cause performance issues for Mac OSX clients. FYI, make sure that you have streams_xattr enabled for shares as well. If you are using "Fruit", then it will need to be enabled for ALL samba shares because the server's ability to handle SMB2AAPL extensions is negotiated during the first SMB tree connection (i.e. connection to the server), which can lead to inconsistent behavior in an environment with different vfs settings for different shares.
 
Joined
Sep 9, 2016
Messages
74
Thanks
2
#7
Anybody could confirm that this solution works on FreeNAS Corral and elaborate on how to apply it please ? I tried adding a "fruit" value in the "VFS objects" section of the share without success. Client signing has already been disabled on my Mac before.

I've had this issue for ever, tried tons of stuff, forgot about it for a while (tired of wasting time with "tricks" that didn't seem to work 100% of the time). But I dived into it again, found this "Fruit" thing somewhere else and here, and I really believe that this is the long awaited solution... I also read that it was related with Samba 4, but can't seem to find the presence of it on Corral ("Services > Sharing > SMB > Server maximal protocol" seems to only go up to SMB3).
 

Allan Wilmath

FreeNAS Aware
Joined
Nov 26, 2015
Messages
99
Thanks
19
#8
Actually, I am using Corral and have not had to change anything to get it working great like I did with FreeNAS 9.10 I went ahead and used the automatic dataset creation in Corral and moved all of my files from directories in to the data sets created by the SMB shares in Corral.

I have not checked to see if the terminal command on the Mac is still necessary.
 
Joined
Sep 9, 2016
Messages
74
Thanks
2
#9
all right, that's a good sign. Could you tell me exactly what's showed in your share settings please ? I don't understand why Corral didn't keep the list of suggestions for VFS objects : now you have to know exactly what to write (I guess).
 

Allan Wilmath

FreeNAS Aware
Joined
Nov 26, 2015
Messages
99
Thanks
19
#10
I just used the defaults when I made new shares in Corral since my originals didn't import. I just checked and the additional VFS objects section is on a share under advanced in Corral and it is clear. By default when you create a SMB share in Corral it also creates a data set with Windows permissions to be used for that SMB share.

The version of SMB is 3 in Corral/FreeNAS9,10, not to be confused with Samba version 4. My understanding is that the vfs_fruit deals with permissions, and Unix systems have a different permissions scheme than Windows systems, ZFS can use either, but you need to specify when you create the data set. My original setup had everything in a Unix style permsiosn data set, with each share using a folder in the same data set. Now I have a data set for each share with Windows permission for those data sets. I use Unix permissions for my Time Machine dataset. I don't keep anything in the root data set any more.
 
Joined
Sep 9, 2016
Messages
74
Thanks
2
#11
Well, all my datasets are using Windows permissions just like yours, and even though I didn't create them through the share creation process, I'm pretty sure that it all ends up being the same. So if you say that your VFS section is clear, I honestly don't see what the major difference is between your setup and mine that makes that your shares react fine with macOS clients and mine don't (really slow files/directories listing and 30/40% slower transfer speeds than with Windows clients).

Are you sure there's nothing in your settings (shares' and/or SMB service's specific settings) that could be different than the default ones ? There's got to be something...

Maybe you could send some screenshots of the different sections (if you don't mind of course). That could help us determine if indeed your settings are the default ones with Corral or if there's any residue linked to your previous configuration, that you might not have noticed after the upgrade.
 
Joined
Dec 20, 2013
Messages
57
Thanks
6
#12
@anodos When creating a dataset for both Windows and Apple machines - should the share type be Windows or Unix? I also saw you mentioned that you could use both AFP and SMB at the same time if you use cross-protocol locking. Can you explain this?
 

anodos

Belly-button Lint Extraordinaire
iXsystems
Joined
Mar 6, 2014
Messages
5,280
Thanks
1,431
#13
@anodos When creating a dataset for both Windows and Apple machines - should the share type be Windows or Unix? I also saw you mentioned that you could use both AFP and SMB at the same time if you use cross-protocol locking. Can you explain this?
vfs_fruit has a configuration option to basically convert samba locks into netatalk locks and vice-versa. https://www.samba.org/samba/docs/current/man-html/vfs_fruit.8.html

I added some rudimentary detection and auto-configuration when datasets have AFP and SMB shares in master (11.3).
 
Top