Skip to content

Instantly share code, notes, and snippets.

@jperkin
Last active February 18, 2020 20:30
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jperkin/ae8166d5871c66501d5e to your computer and use it in GitHub Desktop.
Save jperkin/ae8166d5871c66501d5e to your computer and use it in GitHub Desktop.

Share a ZFS file system over SMB/CIFS and advertise it via mDNS so that it shows up in the OS X Finder. Assumes SmartOS, but should work fine on any illumos distribution.

# Allow guest access to a trusted subnet
zfs set sharesmb=ro=192.168.1.0/25,guestok=true,name=store zones/store

# Advertise the SMB service, it will now show up in Finder
dns-sd -R "Loft Server" _smb._tcp local 445 &

# Give it a pretty icon.  If you want something different, choose from the list in
# /System/Library/CoreServices/CoreTypes.bundle/Contents/Info.plist (use plutil to
# '-convert json -o /tmp/out.json' first).
dns-sd -R "Loft Server" _device-info._tcp local 445 model=RackMac &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment