
Apr 03, '12 07:30:00AM • Contributed by: ppp
I have found that replacing the Apple supplied services with the open source Samba version (dropped by Apple in Mac OS X Lion for apparent licensing issues) has solved these problems, and provided faster performance. Unfortunately setup isn't well documented, takes a while, and has no GUI tool (SharePoints I miss you!).
In hopes that I can give someone a head start for doing this if they need to, I've cobbled together a recipe from various sources. There are likely some flaws, and it is probably missing some details and options. Please feel free to add or update in the comments.
Steps to install and configure samba3 replacement for Apple Mac OS X Server 10.7.x SMB services.
1. Install XCode 4.3.3 from the App Store
2. Download XCode Command Line Tools (in Preferences of XCode - requires Developer ID)
3. Download and Install MacPorts 2.0.4 (http://www.macports.org/install.php)
4. Install samba3 (in Terminal type "sudo port install samba3")
5. Create and edit the config and startup files in these locations: /opt/local/etc/samba3/smb.conf This needs to be customized for your specific circumstances. There is a smb.conf.sample file in the folder, which you can copy to smb.conf, then change the server and workgroup names, comment out the [homes] and [printers] sections, then add your shares at the bottom like this:
[Office Admin]
comment = Office Admin
path = /Volumes/Server Data RAID/Office Admin
available = yes
guest ok = yes
create mask = 644
directory mask = 755
read only = no
/Library/LaunchDaemons/org.samba.smbd.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.samba.smbd</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/opt/local/sbin/smbd</string>
<string>-F</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceDescription</key>
<string>samba</string>
</dict>
</plist>
/Library/LaunchDaemons/org.samba.nmbd.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.samba.nmbd</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/opt/local/sbin/nmbd</string>
<string>-F</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceDescription</key>
<string>netbios</string>
</dict>
</plist>
Enter these commands in Terminal to deactivate the Apple SMB server and activate the samba3 server:
sudo smbpasswd -a usernameThis will create an SMB username and ask you for the password. You will need to use this to log on. More complicated user, group and permission setups are not covered here.
sudo chown root:wheel /Library/LaunchDaemons/org.samba.* sudo chmod 744 /Library/LaunchDaemons/org.samba.*This makes sure the permissions are correct for the server startup config files.
sudo launchctl stop com.apple.netbiosdThis turns off Apple's WINS services.
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.netbiosd.plistThis prevents Apple's WINS services from launching at startup of the computer.
sudo launchctl load /Library/LaunchDaemons/org.samba.smbd.plistThis starts the Samba3 SMB server, or it will start on startup of the computer.
sudo launchctl load /Library/LaunchDaemons/org.samba.nmbd.plistThis starts the Samba3 WINS server, or it will start on startup of the computer. References:
I didn't find all of this documented in one place, but here's a pretty good reference to other people trying to do this. The MacPorts samba3 page. The Official Samba HOWTO (see sections 11 and 16).