Fixing SMB issues with OSX Lion

Update: THIS DOES NOT APPLY TO MOUNTAIN LION. The technique mentioned here does not work on Mountain Lion

I use a Linksys NAS200 as a file share device at home. This uses Samba – an open-source port of Microsoft’s SMB file share protocol – for sharing files to other computers. This worked fine from my Mac when I was using Snow Leopard.

At some point after I upgraded to Lion (not exactly sure when, but I don’t think it was on upgrade day…), I tried to access the share and could connect. It turns out that Apple have discontinued support for older versions of the SMB protocol (pre-Windows XP versions, to be precise). Of course, that’s the exact version used by my NAS.

I found lots of suggestions on line to fix this, but the simplest one is just to re-enable the support. Apple have only turned it off by default, and you can turn it back on. I used the instructions I found in an Apple support notice to turn it on temporarily, like so:

sudo sysctl -w net.smb.fs.kern_deprecatePreXPServers=0
And this let me connect to my file server. Yay!
Unfortunately, this is only temporary. The command changes  a setting in the kernel (the foundation layer of the operating system), but it’s transient – it will get forgotten the next time you start the computer. A little bit of googling later, and I found how to make it permanent.

You need to edit the file /etc/sysctl.conf – the file may not exist, but if it does you probably want to back it up first. Add the setting from above into the file.

My sysctl.conf file ended up looking like this – I added a couple of extra settings I found while searching for this that significantly speed up transferring files, so a win all around (or so it seems):

# Re-enable smb support for my old LinkSys NAS200
# Maybe make NAS faster?

(The tip about delayed_ack came from this post over at Reasonably fine to do on a home network, but probably not a good idea on a busy network)

If you found this useful, please let me know. 🙂

Author: Robert Watkins

My name is Robert Watkins. I am a software developer and have been for over 20 years now. I currently work for people, but my opinions here are in no way endorsed by them (which is cool; their opinions aren’t endorsed by me either). My main professional interests are in Java development, using Agile methods, with a historical focus on building web based applications. I’m also a Mac-fan and love my iPhone, which I’m currently learning how to code for. I live and work in Brisbane, Australia, but I grew up in the Northern Territory, and still find Brisbane too cold (after 22 years here). I’m married, with two children and one cat. My politics are socialist in tendency, my religious affiliation is atheist (aka “none of the above”), my attitude is condescending and my moral standing is lying down.

5 thoughts on “Fixing SMB issues with OSX Lion”

  1. I found it *very* useful, was getting tired of constantly setting that flag on every restart. Thanks!

  2. This no longer works with Mountain Lion. Terminal comes back with “Class is not implemented”

    Anybody know how to do this in Mountain Lion? The annoying part is my Sonos system is doing just fine, but Mountain Lion won’t mount my huge Teraserver Pro NAS.

    1. Well, that’s what we get for poking around under the covers. 😉 I haven’t tried my NAS since I went to Mountain Lion – I’ll give it a go tonight and see what happens.

      FWIW – these “preXp” Samba servers will have problems with Windows 8 as well. I understand that Microsoft has removed the SMB 1.0 support entirely (SMB 2 was introduced with Windows Vista in 2006).

      1. I’m willing to have to upgrade hardware now and then. But it’s annoying when access is cut off to an older format abruptly, making it impossible to transfer to a new device. Any tech insight into why this is necessary? Sounds like a business opportunity to make some software that can mount ANY older format storage…

    2. Well, I can confirm that my settings have been reverted – OTH, my SMB shares still work, so I’m not as bad off as I was before.

      The kern_deprecatePreXPServers switch has been removed, unfortunately. That’s not too surprising, really – Apple was very clearly moving away from this.

      The technical reasons have to do with issues with the SMB 1.0 spec and the CIFS spec that predated SMB. It was never formally published, which means that every implementation is slightly different (though most are based on the Linux Samba project these days). There are some problems, particularly with authentication – it’s not very secure. As SMB 2 has been out for six years (and there are other alternatives as well), Apple has dropped it (as is, apparently, MS with Win8). About all I can suggest is looking to see if there’s a firmware patch that provides a more recent version of SMB support.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: