Avahi Installation On Linux
“Avahi is a fully LGPL framework for Multicast DNS Service Discovery.
It allows programs to publish and discover services and hosts
running on a local network with no specific configuration. For
example you can plug into a network and instantly find printers to
print to, files to look at and people to talk to.”
First, if you don’t have recent backups, create them now. You will be doing this install on all the machines that will make up your network.
When the backup is done, run this command:
sudo apt-get install avahi-daemon avahi-discover avahi-utils libnss-mdns mdns-scan
The above installs the base avahi-daemon, and a few other helpful additions.
[1] Make sure avahi-daemon is running on both machines:
sudo service avahi-daemon start
[2] Make sure port 5353 is open: avahi expects it to be open. If you are not sure just disable the firewall if you are using one:
sudo ufw disable
[3] Create an avahi samba service file:
sudo nano /etc/avahi/services/samba.service
[4] Then copy and paste the following into that file:
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h SMB</name> ## Display Name
<service>
<type>_smb._tcp</type>
<port>445</port>
</service>
</service-group>
Please note: The very first line cannot have any leading spaces in front of it or else it won’t work.
[5] You don’t need to do this but just in case restart avahi:
sudo service avahi-daemon restart
When you use Nemo on either machine and select “Network” you should see the other machine as “hostname SMB”
Also: You are using an avahi samba.service file. Samba does the equivalent by itself without requiring that file since Mint 19. You can keep the samba.service file if you want ( since it allows you to change the display name ) but if you do I would suggest disabling the way samba does it by adding the following line in /etc/samba/smb.conf in the [global] section:
multicast DNS register = no
Then restart samba.
Samba done the Linux way. No more workgroups. No more netbios names. No more name resolve orders. No more nmbd or any other Windows specific services required.
Use the editor of your choice, but take note of getting the samba service file correct!
Now, go to the file manager (Nemo, in my case) and share the folders in question. As mentioned above, I simply share the whole /home/(user) folder.
When you first access one of these newly shared folders, the password window will popup, but just hit the “connect” button.