Note

One some Linux distributions, for example Debian, Samba is compiled with the –disable-avahi flag. This will allow you to create the file below in /etc/avahi/services. You can also opt to enable enable advertising directly from the samba daemon by recompiling samba and specifying –enable-avahi instead of –disable-avahi. However, by doing that you will have both samba and avahi advertising and samba will take priority which may not make the icon appear on OSX.

Code

samba.service
<?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=Macmini4,1</txt-record>
 </service>
</service-group>