Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Replace SMB Server with open source version in Mac OS X Lion Server OS X Server
I have had nothing but trouble with SMB (Windows Sharing) services in Mac OS X Server 10.7. These problems were supposedly solved in 10.7.3, but my particular issues seem to still be there in several cases (Windows XP name browsing not working, Guest access not working, performance issues, dropped connections), and may be related to the Windows XP (versus Windows Vista/7) clients I'm dealing with. All of these were working fine with Mac OS X Server 10.5.8 when a string of hardware failures required replacement with the current version, which is working well for the Mac OS X clients.

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 username
This 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.netbiosd
This turns off Apple's WINS services.
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.netbiosd.plist
This prevents Apple's WINS services from launching at startup of the computer.
sudo launchctl load /Library/LaunchDaemons/org.samba.smbd.plist
This starts the Samba3 SMB server, or it will start on startup of the computer.
sudo launchctl load /Library/LaunchDaemons/org.samba.nmbd.plist
This 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).
    •    
  • Currently 1.66 / 5
  You rated: 5 / 5 (64 votes cast)
 
[36,029 views]  

Replace SMB Server with open source version in Mac OS X Lion Server | 10 comments | Create New Account
Click here to return to the 'Replace SMB Server with open source version in Mac OS X Lion Server' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Replace SMB Server with open source version in Mac OS X Lion Server
Authored by: wheelsx2 on Apr 03, '12 07:58:50AM

Is you want a UI for Samba, you might try webmin. http://www.webmin.com/osx.html

The install notes look a bit out of date, but webmin is very well supported on linux and makes samba admin quite simple.



[ Reply to This | # ]
Replace SMB Server with open source version in Mac OS X Lion Server
Authored by: leamanc on Apr 04, '12 07:55:45AM

Webmin support for OS X has never been that great, and the last time I tried it, it had not been updated for the new directory-based password and login mechanism that OS X uses. I installed Webmin and tried to change a user password with it, and it really borked that user account.

Now, this was almost a year ago and YMMV. But I gotta say I love Webmin on Linux but not so much with OS X, even before the above problem I had.



[ Reply to This | # ]
Replace SMB Server with open source version in Mac OS X Lion Server
Authored by: chewitt on Apr 03, '12 10:28:19AM

http://eduo.info/apps/smbup <= does all of this for you, only nicely packaged and with a GUI



[ Reply to This | # ]
Replace SMB Server with open source version in Mac OS X Lion Server
Authored by: markuswarren on Apr 03, '12 11:48:46AM
I had previously followed the information here: http://www.johnlarge.co.uk/2011/07/19/osx-lion-samba-smb-shares-broken-xbmc-not-working
This was, as the title of the link suggests, XBMC on various devices not being able to connect to my Lion machine via SMB.
The information you provide is excellent, especially indicating how to stop Apple's implementation from interfering with the new setup.

I've just had a look at the comments on the aforementioned link, and found there is reference to SMBUp which seems to be a nice all-in-one solution to this problem. have a look here: http://eduo.info/apps/smbup
Edited on Apr 03, '12 11:54:32AM by markuswarren


[ Reply to This | # ]
Replace SMB Server with open source version in Mac OS X Lion Server
Authored by: Hooner on Apr 03, '12 08:25:27PM

An easier option to replace the Samba server in MacOS with the open source version that includes a relatively simple GUI is SMBUp. This free program will install the open source Samba software and provides a quick interface to get things up and running quickly.

http://eduo.info/apps/smbup



[ Reply to This | # ]
Replace SMB Server with open source version in Mac OS X Lion Server
Authored by: desepticon on Apr 03, '12 09:32:39PM

Would this work in regular (non-server) lion? I always have windows sharing issues. Im guessing it would work but I'm not sure why you specified this was a Lion Server specific hint.



[ Reply to This | # ]
Replace SMB Server with open source version in Mac OS X Lion Server
Authored by: markuswarren on Apr 04, '12 10:01:58AM

wow, I missed 'server' in the title. Yes SMBUp will work on the nomad non-server Lion install, or it does or me.



[ Reply to This | # ]
Replace SMB Server with open source version in Mac OS X Lion Server
Authored by: ppp on Apr 04, '12 10:08:09AM

Yes, this would work for regular Lion, not just the Server, but the steps to stop the Apple services would not be needed. It looks like SMBUp is a much better solution for doing all of this, and doesn't require XCode (maybe) and MacPorts installation (very time consuming). Wish I'd known of it beforehand, but glad I started the conversation.



[ Reply to This | # ]
Replace SMB Server with open source version in Mac OS X Lion Server
Authored by: havoc on Jul 17, '12 07:56:47PM

Hi ppp,

Thanks for putting this hint together - I like the idea of doing it the long way - having the smb.conf file and plist's just gives me peace of mind... I tried this in 10.7.4 w/ server however and the smbd fails to start. Any thoughts as to why that might happen? Nmbd does start and I have Xcode, macports and all the fancy bits done right - to be sure I re-did it on a clean install of 10.7.4 w/ server.

Thanks again,

H

---
mac admin



[ Reply to This | # ]
Replace SMB Server with open source version in Mac OS X Lion Server
Authored by: eduo on Sep 21, '12 03:24:46PM

Hi.

I'm SMBUp's developer. I wish I had seen this thread before :)

A small clarification:

I made SMBUp to help people avoid having to install XCode and MacPorts, both of which I love but which are overkill for something like this. I kept waiting for someone to come up with a simple installer for Samba binaries (my money was on Liyanage, who'd made similar things in the past) but after a year I just gave up and made SMBUp.

SMBUp mainly does two things:
-Installs Samba
-Helps configure basic options for Samba

The Samba installation performed is *exactly* the same one made by macports, just right the instructions ubiquous on the internet explain. I made it this way so people that had installed it manually could still use the front-end.

So, for people who've installed MacPorts' version SMBUp should work as if it had installed Samba itself.

---
Eduo



[ Reply to This | # ]