September 28, 2021 at 12:33 AM

Arch and Samba tribulations


I wrote this article after a whole evening of unsuccessful attempts to properly configure Samba on my Arch laptop. No matter what I did, i could not make my shares visible on the network. Also, none of the other shared folders from the networks were visible in Dolphin or any other file manager. In the end I found out the cause. It was the lack of the Avahi daemon from the computer.

Categorie: General
Postat de: oberon

First, you must install Samba and configure it, as described here: Arch Linux Wiki - Samba

Then you must install the Avahi daemon as described here: Arch Linux Wiki - Avahi

Avahi deals with finding and publishing host names and services in the network. Without it, you will be able to connect to network shares only via IP, and you will not be able to browse the network at all. Pay much attention at these two steps, which are also described in the Avahi wiki page:

1. You must first disable the Systemd mDNS implementation. Arch comes with this as default. Edit /etc/systemd/resolved.conf and add the folowing line. You may as well edit the existing, commented line, but it is better to leave it for further reference.

MulticastDNS=no

Then restart the service

sudo systemctl restart systemd-resolved

2. Next we need to take care of the hostname resolution mechanism. Edit /etc/nsswitch.conf and change the "hosts" line. I used what I could find in Ubuntu here, because the explanation from the wiki seemed a bit unclear.


hosts: files mdns4_minimal [NOTFOUND=return] dns


Still, I could see some warnings about this arrangement failing with some "exotic" network configurations. In my case it worked just fine. I could see and browse shares on both sides.