# HELP:  Cannot get Avahi to advertise SMB services

## theosib

I would like my SMB services to show up as zeroconf services.  I looked up how to do this on these two pages:

http://www.askbjoernhansen.com/2007/10/27/setup_samba_for_bonjour_networking_with_os_x_105_l.html

http://en.gentoo-wiki.com/wiki/Avahi

So in /etc/avahi/services/samba.service, I put this:

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->

<!DOCTYPE service-group SYSTEM "avahi-service.dtd">

<service-group>

    <name replace-wildcards="yes">%h filer</name>

    <service>

        <type>_smb._tcp</type>

        <port>139</port>

        <host-name>compute0_smb</host-name>

    </service>

</service-group>

(And then restarted Avahi.)  Doing this sort of thing works for other services, like http and afp.  But not smb.  Other machines can see every service but this one.  What am I doing wrong here?

BTW, I am aware that Samba can be compiled with avahi support, and I'll do that.  But I would like to understand why this isn't working.

Thanks.

----------

## theosib

I looked in the log, and when I had restarted Avahi, this message was produced:

Failed to add service 'compute0 filer' of type '_smb._tcp', ignoring service group (/services/samba.service): Invalid host name

Ideas?

----------

## theosib

I changed the config file to this:

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->

<!DOCTYPE service-group SYSTEM "avahi-service.dtd">

<service-group>

    <name replace-wildcards="yes">compute0_smb</name>

    <service>

        <type>_smb._tcp</type>

        <port>139</port>

    </service>

</service-group>

The service appeared, but I couldn't mount.  So I looked to see what the other samba services were advertising as their port, and it's 445.  So I changed to that, and voila, it works!

----------

