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
net.smb.fs.kern_deprecatePreXPServers=0
# Maybe make NAS faster?
net.inet.tcp.delayed_ack=0

(The tip about delayed_ack came from this post over at MacWorld.com. 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. :)

About these ads

5 thoughts on “Fixing SMB issues with OSX Lion

  1. triathlon

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

    Reply
  2. Mel Malinowski

    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.

    Reply
    1. Robert Watkins Post author

      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).

      Reply
      1. Mel Malinowski

        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. Robert Watkins Post author

      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.

      Reply

Leave a Reply

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

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s