Search code examples
debiansambaxfceavahinetwork-shares

Thunar can't access (samba) shares throught "Browse Network"


x86_64 Debian Stretch kernel version is 4.7.8-1 with XFCE

I wasn't able to open shares (samba) with Thunar in Browse Network (network:///). In location bar I could saw bad dns-sd names, when I tried to access shares. Names look like this:

network:///dnssd-domain-tetris%2520-%2520SMB%255CsCIFS._smb._tcp

  • where tetris is name of my server

So I guessed problem is in special characters (spaces etc.).


Solution

  • I searched dns-sd name is created by service avahi. Then I just edit file on my server: /etc/avahi/services/smb.service and replace string with single word (name) of my server. (Or you could use "%h" which automatically insert your server name)

    Before:

    <?xml version="1.0" standalone='no'?>
    <!DOCTYPE service-group SYSTEM "avahi-service.dtd">
    <service-group>
      <name replace-wildcards="yes">%h - _SMB/CIFS</name>
      <service>
        <type>_smb._tcp</type>
        <port>445</port>
      </service>
    </service-group>
    

    After:

    <?xml version="1.0" standalone='no'?>
    <!DOCTYPE service-group SYSTEM "avahi-service.dtd">
    <service-group>
      <name replace-wildcards="yes">tetris_smb-cifs</name>
      <service>
        <type>_smb._tcp</type>
        <port>445</port>
      </service>
    </service-group>
    

    Now Thunar works fine.