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.

2. Adjust LibreOffice Save and Recovery Settings

Aggressive automatic background saves can cause LibreOffice to stutter over high-latency networks.

  1. Open LibreOffice and navigate to Tools > Options (or LibreOffice > Preferences on macOS).
  2. Go to Load/Save > General.
  3. 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.
  4. 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.

  1. Navigate to Tools > Options > LibreOffice > Advanced.
  2. Click Open Expert Configuration.
  3. Search for UseLocking.
  4. Locate org.openoffice.Office.Common > Misc > UseLocking.
  5. Set the boolean value to true to prevent multi-user overwrites. If your SMB server does not support POSIX locks or crashes when managing lock states, toggle this to false as 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 = yes

Reload the Samba service after making changes:

sudo systemctl restart smbd

5. 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.