XBMC will be renamed to Kodi for v14. Read here for more details

Avahi Zeroconf

From Kodi
Jump to: navigation, search

Contents

1 General

1.1 What is Avahi (Zeroconf)

Avahi is a system which facilitates service discovery on a local network via the mDNS/DNS-SD protocol suite. This enables XBMC to recognize media sources inside your local network without knowing where the sources are located and what protocol is used. Compatible technology is found in Apple MacOS X (branded Bonjour and sometimes Zeroconf). Avahi is available for linux and derivates (BSD) afaik.

For more details have a look at avahi.org.

1.2 Installing

Since the Installation of Avahi depends on the used operating system please realise that this page only covers the configuration of static service announcements (for services which don't have avahi support included). For installation instructions just use a www search engine with the keywords "install avahi on <enter operting system here".

2 Services supported by XBMC

XBMC can receive service announcements for the following protocols. samba, FTP, HTSP, WebDAV, NFS and SFTP (ssh server).

The most HTSP, samba (minimum version 3.3.x), WEBDAV and iTunes (DAAP) servers are supposed to have support for zeroconf built in. This means that these services should be announcent automatically when avahi is installed. No static service announcement configuration should be needed then.

3 Static service announcement

3.1 What about it?

For services which don't support zeroconf registration there is an easy possibility to make avahi announce them. For each service which should be announced there has to be a configuration file. Normally these files should reside in /etc/avahi/services and end with the file extension ".service". The XBMC zeroconf browser supports txt-records. This means that it can parse some of the official DNS-SD keys (see ServiceTypes under "Defined TXT keys"). XBMC parses the "path","u"(username) and "p"(password) keys. This allows to specify a complete service including the path and account information for accessing it.

The Avahi daemon has to run on the same server which hosts the services which should be announced.

The section below has some sample configurations which would allow static announcements for the supported protocols. For general information according to the config files see the official man page.

3.2 Sample service configurations

3.2.1 NFS service (/etc/avahi/services/nfs.service)

The following configuration would announce a NFS server (with the nfs default port 2149) with the exported path /path/to/nfsexport. XBMC Zeroconf browser would show this entry as NFS server at <name of server>. The "%h" gets substituted by the hostname of the server. When clicking this entry - XBMC would show the available path on that service with /path/to/nfsexport. Clicking on that one would generate the following url: nfs://<ip of server>:2049/path/to/nfsexport/


 <?xml version="1.0" standalone='no'?>
 <!DOCTYPE service-group SYSTEM "avahi-service.dtd">
 <service-group>
   <name replace-wildcards="yes">NFS server at %h</name>  
   <service>
     <type>_nfs._tcp</type>
     <port>2149</port>
     <txt-record>path=/path/to/nfsexport</txt-record>
   </service>
 </service-group>

3.2.2 WEBDAV service (/etc/avahi/services/webdav.service)

The following configuration would announce a WebDAV server (e.x. apache at port 80) with the accessible path /webdav/path. XBMC Zeroconf browser would show this entry as WebDav on <name of server>. The "%h" gets substituted by the hostname of the server. When clicking this entry - XBMC would show the available path on that service with /webdav/path. Clicking on that one would generate the following url: dav://<ip of server>:80/webdav/path/.

 <?xml version="1.0" standalone='no'?>
 <!DOCTYPE service-group SYSTEM "avahi-service.dtd">
 <service-group>
   <name replace-wildcards="yes">WebDav on %h</name>  
   <service>
     <type>_webdav._tcp</type>
     <port>80</port>
     <txt-record>path=/webdav/path</txt-record> 
   </service>
 </service-group>

3.2.3 SFTP service (/etc/avahi/services/sftp.service)

The following configuration would announce a sftp/ssh server (on default port 22) with the accessible path /path/to/be/accessed, the user sshuser and the password sshpass. XBMC Zeroconf browser would show this entry as SFTP on <name of server>. The "%h" gets substituted by the hostname of the server. When clicking this entry - XBMC would show the available path on that service with /path/to/be/accessed. Clicking on that one would generate the following url: sftp://sshuser:sshpass@<ip of server>:22/path/to/be/accessed/.

 <?xml version="1.0" standalone='no'?>
 <!DOCTYPE service-group SYSTEM "avahi-service.dtd">
 <service-group>
   <name replace-wildcards="yes">SFTP on %h</name>
   <service>
     <type>_sftp-ssh._tcp</type>
     <port>22</port>
     <txt-record>path=/path/to/be/accessed</txt-record>
     <txt-record>u=sshuser</txt-record>
     <txt-record>p=sshpass</txt-record>  
   </service>
 </service-group>

3.2.4 FTP service (/etc/avahi/services/ftp.service)

The following configuration would announce a FTP server (on default port 21) with the accessible path /ftppath, the user ftpuser and the password ftppass. XBMC Zeroconf browser would show this entry as FTP on <name of server>. The "%h" gets substituted by the hostname of the server. When clicking this entry - XBMC would show the available path on that service with /ftppath. Clicking on that one would generate the following url: ftp:/ftpuser:ftppass@<ip of server>:21/ftppath/.

 <?xml version="1.0" standalone='no'?>
 <!DOCTYPE service-group SYSTEM "avahi-service.dtd">
 <service-group>
   <name replace-wildcards="yes">FTP on %h</name>
   <service>
     <type>_ftp._tcp</type>
     <port>21</port>
     <txt-record>path=/ftppath</txt-record>
     <txt-record>u=ftpuser</txt-record>
     <txt-record>p=ftppass</txt-record>
   </service>
 </service-group>

3.2.5 SAMBA service - pre 3.3.x (/etc/avahi/services/smb.service)

The following configuration would announce a SAMBA server (on default port 139). XBMC Zeroconf browser would show this entry as SAMBA on <name of server>. The "%h" gets substituted by the hostname of the server. When clicking this entry - XBMC would show the available shares on that samba server.

 <?xml version="1.0" standalone='no'?>
 <!DOCTYPE service-group SYSTEM "avahi-service.dtd">
 <service-group>
   <name replace-wildcards="yes">SAMBA on %h</name>
   <service>
     <type>_smb._tcp</type>
     <port>139</port>  
   </service>
 </service-group>
Personal tools
Namespaces

Variants
Actions
Navigation
Wiki help
Toolbox