January 1, 2013

Fixing Samba on Ubuntu 12.04 Precise for Mac and Windows Clients

Filed under: Technical — Tags: , , — James Bunton @ 7:51 pm

After upgrading my file server from Ubuntu 10.04 Lucid to Ubuntu 12.04 Precise I had a few problems with Samba. Mac OS X 10.6 clients were very very slow. A 1MB file would take several minutes to transfer completely, making browsing photos and general use impractical. Windows (Vista and 7) clients could not connect at all, the file server did not appear in the browse list and typing the name manually did not work either. Unsurprisingly, Linux Samba clients worked perfectly.

I suspected the problem was related to the Samba upgrade from version 3.4.7 to 3.6.3, although I never really confirmed this. I was able to resolve the issues by making configuration changes to the [global] section of /etc/samba/smb.conf.

The problem with Windows clients was fixed by enabling Samba’s experimental SMB2 protocol implementation. I added this line:
max protocol = SMB2

This still left the speed issue for Mac clients, the solution for me was to remove this line:
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
This was a non-default setting that I’d carried around for many years because it apparently made Samba much faster. I’d never bothered to measure it, so I don’t know if this was true in previous versions. In any case, with this version after removing it transfers are now very fast again.

Problem solved! :)

2 comments

Simon says:

THANKS a lot for taking the time to post this, I had the exact same symptoms and your fix worked for me too.

Pooch says:

Godsend… on Mavericks OSX 10.9 I needed that max protocol = SMB2 to get proper speed. Without it I was maxing out around 50MB/s R+W now I’m at 90+MB/S R+W on my Gig Lan. Oddly enough it’s still not as fast as AFP for me using Netatalk (108MB/s) but it’s much better.

Comments are closed.