Let Mac OS auto-discover your SMB shares

Mac OS can mount and read SMB shares. But with Samba only, you have to tell the Mac where there are. With avahi-daemon, SMB shares will be automatically discovered.

Install the Avahi service discovery suite. Chances are it was already installed by dependancies magic. If not, package is easy to find.

Once installed, find the location for configuration files and locate the “services” directory. On FreeBSD 11, go to /usr/local/etc/avahi/services. From there, create the following file:

# cat smb.service
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
 <name replace-wildcards="yes">%h</name>

Configure the automatic start and launch avahi-daemon.

On the Mac, go to Network and… tada, here are the SMB shares. You already did install & configure Samba, didn’t you?

Bonus: you can set various value for txt-record. This will lead to a specific icon in the Finder.
Some options are :

  • Xserve
  • PowerBook
  • PowerMac
  • Macmini
  • iMac
  • MacBook
  • MacBookPro
  • MacBookAir
  • MacPro
  • AppleTV1,1
  • AirPort

Et voilà. So that’s what the daemon does… Among others things.

Author: Joel Carnat

@work Technical Architect and SysAdmin ; @home OpenBSD and FOSS, Karate, Kobudō, Jōdō, Bodyweight workout, Photography & Music

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.