How to Use LibreOffice Reliably on SMB Shares
Working with LibreOffice documents directly over Server Message Block (SMB) network shares can sometimes result in slow performance, document locking conflicts, and failed save operations. This guide outlines the essential LibreOffice configurations, operating system mounting techniques, and network settings required to establish a stable and responsive workflow when opening and saving files across SMB shares.
1. Mount Shares at the Operating System Level
Directly opening files via network pathways can bypass native filesystem caching and locking mechanisms. Mount the share at the OS level instead of accessing it through temporary runtime paths.
Windows: Map the SMB share to a designated drive letter (e.g.,
Z:) rather than accessing files via UNC paths (e.g.,\\server\share). Ensure Reconnect at sign-in is checked.Linux: Mount the SMB share using
cifsvia/etc/fstaborsystemd.mountrather than user-space protocols (such as GVFS in GNOME or KIO in KDE). When usingcifs, use thenobrlmount option if byte-range locking causes file freezes://server/share /mnt/smb cifs credentials=/path/to/creds,iocharset=utf8,nobrl,file_mode=0777,dir_mode=0777 0 0
2. Adjust LibreOffice Save and Recovery Settings
Aggressive automatic background saves can cause LibreOffice to stutter over high-latency networks.
- Open LibreOffice and navigate to Tools > Options (or LibreOffice > Preferences on macOS).
- Go to Load/Save > General.
- Increase the interval for Save AutoRecovery information every from the default 10 minutes to 15 or 20 minutes, or ensure Save AutoRecovery information is not set to an excessively frequent interval.
- Ensure Always create backup copy is evaluated based on your bandwidth. If enabled, LibreOffice writes an extra copy over the network during every save, which can slow down operations on larger files.
3. Manage File Locking in Expert Configuration
LibreOffice creates hidden lock files
(.~lock.filename.odt#) in the same directory as the open
file. If network latency or permission issues prevent the lock file from
being created or cleared, adjust the internal lock settings.
- Navigate to Tools > Options > LibreOffice > Advanced.
- Click Open Expert Configuration.
- Search for
UseLocking. - Locate
org.openoffice.Office.Common > Misc > UseLocking. - Set the boolean value to
trueto prevent multi-user overwrites. If your SMB server does not support POSIX locks or crashes when managing lock states, toggle this tofalseas a temporary workaround.
4. Optimize SMB Server Configuration (Samba)
If you have administrative access to the SMB/Samba server hosting the
files, add the following parameters to the [global] or
specific share definition in /etc/samba/smb.conf:
# Enforce modern SMB dialect
min protocol = SMB2_10
# Optimize locking behavior for desktop office suites
oplocks = yes
level2 oplocks = yes
kernel oplocks = no
posix locking = yesReload the Samba service after making changes:
sudo systemctl restart smbd5. Exclude Network Drives from Local Antivirus Real-Time Scanning
Real-time antivirus scanning on client machines can intercept temporary file creation during LibreOffice’s atomic save process. Configure your client-side security software to exclude the mapped network drive letters or SMB mount points from real-time read/write scanning, and rely on scheduled server-side scans instead.