cd /news/open-source/setting-up-samba-for-linux-macos · home topics open-source article
[ARTICLE · art-10366] src=gist.github.com ↗ pub= topic=open-source verified=true sentiment=· neutral

Setting up SAMBA for Linux / MacOS

The article describes configuring Samba on AlmaLinux 9.x for file sharing with macOS 15.x, replacing Netatalk. The author provides their `/etc/samba/smb.conf` configuration, highlighting the need to enable `kernel oplocks = yes` to resolve "text file busy" errors when editing scripts on a Mac and executing them on Linux. Additionally, the author includes their `/etc/nsmb.conf` settings for the Mac client to optimize SMB behavior.

read5 min views20 publishedNov 15, 2022

I recently (re)switched from using Netatalk to Samba for file access from macOS (15.x) to linux (AlmaLinux 9.x). Obviously the Samba is a great resource, on the Samba Wiki the Configure Samba to Work Better with Mac OS X was invaluable for setting up the /etc/samba/smb.conf file, and the vfs fruit man page contains documentation for all the options. Here is the /etc/samba/smb.conf file I use:

#

#

#

#

#

[global] workgroup = LINUX server string = linux.internal (Samba) security = user bind interfaces only = yes interfaces = 10.0.1.150/24 passdb backend = tdbsam inherit acls = yes create mask = 0664 directory mask = 0775 min protocol = SMB3 ea support = yes vfs objects = fruit streams_xattr

fruit:metadata = stream
fruit:model = MacSamba
fruit:veto_appledouble = no
fruit:nfs_aces = no

fruit:wipe_intentionally_left_blank_rfork = yes

fruit:delete_empty_adfiles = yes
fruit:posix_rename = yes
fruit:zero_file_id = yes
[homes]

comment = Home Directories valid users = %S, %D%w%S browseable = no writeable = yes

#[printers]
#[print$]

There is an option worth noting, Apple changed something with their SMB client in Ventura and I needed to add the 'kernel oplocks = yes' options because MacOS would place opportunitics locks on the files I was editing and I would get a 'text file busy' error on the linux side when I tried to run scripts. Setting 'kernel oplocks = yes' helped to work around this. Setting this option is only useful if you edit code on a Mac and execute this code on the Linux machine. I also made some changes to '/etc/nsmb.conf' on the Mac, here is the version I use:

#

#

#

#

#

#

#

#

[default] protocol_vers_map=4 port445=no_netbios signing_required=yes #soft=yes mc_on=no mc_prefer_wired=yes #file_ids_off=yes dir_cache_off=yes dir_cache_max_cnt=0 #aapl_off=false

── more in #open-source 4 stories · sorted by recency
── more on @samba 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/setting-up-samba-for…] indexed:0 read:5min 2022-11-15 ·