This is an explanation
of one way of sharing files
with Mac OS X 10.11 El Capitan
from FreeBSD 11.0.
It uses Samba,
an implementation of the SMB protocol,
and Apple’s mDNSResponder
for service discovery.
Alternatives are listed at the end.
SMB is the protocol
used for file sharing
between Windows systems.
Mac systems previously used
their own Apple Filing Protocol,
but deprecated it in favour of SMB
with Mac OS X 10.9 Mavericks.
mDNS, or multicast DNS,
is a technology for resolving host names
in a local network.
On top of this,
DNS service discovery, or DNS-SD,
can be used to broadcast available services,
such as SMB.
This is how Finder discovers
hosts to show in “Shared” or “Network.”
First, install Samba.
There are two versions available in FreeBSD.
This is the newer one.
Next, configure it
The manual page
suggests a basic configuration
allowing users to access their home directories.
Additional shared directories can be added,
such as the downloads directory
of the Transmission daemon.
path = /usr/local/etc/transmission/home/Downloads
read only = yes
In order to allow users to log in over SMB,
give them a password with
smbpasswd as root.
Now, enable and start the Samba server.
echo 'samba_server_enable="YES"' >> /etc/rc.conf
service samba_service start
At this point,
it should be possible
to connect manually
from Finder’s “Connect to Server…”
by typing, for example,
and authenticating with username and password.
Apple’s implementation of mDNS and DNS-SD.
pkg install mDNSResponder
Unfortunately, this software is poorly documented
mdnsd binary does not seem to work.
However, the package also provides
which is targeted at embedded systems
and is a bit less opaque.
Given no arguments,
mDNSResponderPosix exits with an error,
/etc/rc.conf to pass it a configuration file.
The format of the file
does not seem to be documented,
but it can be inferred by reading
The function reads newline-separated
service name, type, port, and optional text records.
Each service is separated by a blank line.
To broadcast the SMB service
from a host named “thursday”,
add the following to
Now start the service
and Finder should find the shared directories.
You may have to click “Connect As…”
to enter your credentials the first time.
service mdnsresponderposix start
As a bonus,
it should now be possible
- Netatalk, an AFP implementation:
- AFP is deprecated.
- Litters files and folders everywhere to support resource forks.
netatalk3 depends on Avahi, see below.
- Supported natively by FreeBSD.
- Supported by Finder, but seemingly not through service discovery.
- Bloated, with runtime dependencies such as DBus.
- From the OpenBSD crowd.
- Can only be configured at runtime with