Skip to content

Instantly share code, notes, and snippets.

@TyrfingMjolnir
Forked from jperkin/zfs-mdns.md
Last active March 29, 2019 14:30
Show Gist options
  • Save TyrfingMjolnir/a24201eacb10a1310f11 to your computer and use it in GitHub Desktop.
Save TyrfingMjolnir/a24201eacb10a1310f11 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.

# Create volume
zfs create zones/store

# Allow guest access to a trusted subnet
zfs set sharesmb=rw=10.10.1.0/22,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