Sign inSign up

fabiosoft/samba-avahi-multiarch

By fabiosoft

•Updated almost 6 years ago

samba (SSDP / ZeroConf Service Discovery)

Image
0

332

fabiosoft/samba-avahi-multiarch repository overview

source⁠

⁠SSDP / ZeroConf Service Discovery

For auto-discovery on Linux and OSX machines, we can use the multicast-based mDNS and DNS-SD protocls (also known as Bonjour) using Avahi daemon.

The main use-case for this project is for a standalone, personal or small workgroup file server with a majority of clients on OSX or Linux. I've made a choice to not support legacy protocols, including NetBIOS, WINS, and the old Samba port 139. Some of the issues with NetBIOS include excessive broadcast packets, lack of IPV6 support, and easy spoofing.

Because of this, it means:

  • For Windows clients, your Samba server won't be shown under network browsing. Microsoft has been adding support for DNS-SD functionality recently, so it's possible they will eventually support finding Samba shares using mDNS and DNS-SD. In the meantime, you can still connect directly to the IP or hostname to use the shares.

  • Samba can act as a domain controller or join an NT domain but that is not supported with this configuration. I may put together a separate project that supports NetBIOS/WINS and can either join or act as a domain controller.

⁠Configuring Avahi Services

To announce Samba on your network, setup a file called smb.services (below) in a new folder services/. You can announce more services here, such as SSH or SFTP.

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
 <name replace-wildcards="yes">%h</name>
 <service>
   <type>_smb._tcp</type>
   <port>445</port>
 </service>
 <service>
   <type>_device-info._tcp</type>
   <port>0</port>
   <txt-record>model=RackMac</txt-record>
 </service>
</service-group>
⁠Running
docker run -d \
  -v $PWD/services:/etc/avahi/services \
  --net=host \
  --name=avahi \
  --restart=always \
  stanback/alpine-avahi

It's possible to not use --net=host, and instead specify the port mapping -p 5353:5353/udp and optionally giving your Docker container a hostname with --hostname=myhostname but I haven't gotten it to work correctly.

⁠Client Configuration

Nothing special should need to happen on your clients, below are some settings that may be tweaked.

⁠OSX

Disable writing .DS_Store files on network shares:

defaults write com.apple.desktopservices DSDontWriteNetworkStores true

Disable netbios (be careful with this one):

sudo launchctl disable system/netbiosd

Tag summary

Content type

Image

Digest

Size

3 MB

Last updated

almost 6 years ago

docker pull fabiosoft/samba-avahi-multiarch