Make Arch File Share Mac Friendly

I want to share the home folder of an Arch Linux install and make it work well with Macs on my network. We’ll call the Arch system the server and the Mac system the client. For the sake of a few examples where it might be necessary the user is “stevemartin” and the server is “murders.local” so find and replace from there.

Install samba and avahi on the server.
Create the config file and put contents in it.

> sudo pacman -Syu samba avahi > sudo mkdir -p /etc/samba > sudo nano /etc/samba/smb.conf

[global]
workgroup = WORKGROUP
server string = Samba Server
server role = standalone server
security = user
map to guest = never
min protocol = SMB2
multicast DNS register = no

# macOS compatibility
vfs objects = fruit streams_xattr
fruit:aapl = yes
fruit:metadata = stream
fruit:model = Macmini
fruit:nfs_aces = no
fruit:veto_appledouble = no
fruit:wipe_intentionally_left_blank_rfork = yes
fruit:delete_empty_adfiles = yes
fruit:posix_rename = yes

[Home Directory]
path = /home/stevemartin
browseable = yes
read only = no
guest ok = no
valid users = stevemartin
create mask = 0664
directory mask = 0775

The samba system needs a password for itself that won’t sync with the accounts on the rest of the system. I like to try to keep these manually the same as my system but it isn’t necessary.

> sudo smbpasswd -a stevemartin

Create a reference for Mac systems to reference for how things are displayed in the Finder.

> sudo nano /etc/avahi/services/samba.service

<?xml version=”1.0″ standalone=’no’?>
<!DOCTYPE service-group SYSTEM “avahi-service.dtd”>
<service-group>
<name replace-wildcards=”yes”>Arch Server</name>
<service>
<type>_smb._tcp</type>
<port>445</port>
</service>
<service>
<type>_device-info._tcp</type>
<port>0</port>
<txt-record>model=Macmini</txt-record>
</service>
</service-group>

Validate the services and enable and restart just to be safe.

> sudo testparm -s > sudo systemctl enable --now smb avahi-daemon > sudo systemctl restart smb avahi-daemon

I’m not sure if I need to define the model in both the avahi and samba configs but it at the very least it doesn’t seem to hurt. If I setup a new server at some point I’ll try some other configs.

Leave a Comment