Solved How to connect LibreOffice to remote nfs server ?

Hi forum
I'm having some bother with LibreOffice accessing documents on a remote NFS server, in a small office environment.

NFS server is running on linux CentOS host, serving a directory of thousands of documents.
Multiple users having LibreOffice workstations on linux, which I'm hoping to change to FreeBSD. (Also currently some windoze connecting by samba.)
All users can read and write the documents as normal.
Documents can be opened read-only when another user already has access.
This has been working reliably for many years.

I have a fresh FreeBSD 13.2 workstation, running KDE-plasma and LibreOffice, all installed from packages.
The remote NFS share is successfully mounted as /mnt/nfs.
From the command line of FreeBSD workstation, I can read and write files in the remote /mnt/nfs directory as normal.
But LibreOffice is not so happy.

/etc/rc.conf includes the following lines :

Code:
# Enable NFS
nfs_client_enable="YES"
nfs_client_flags="-n 4"

/etc/fstab includes the following lines :

Code:
# Remote nfs share
192.168.0.88:/nfs /mnt/nfs nfs rw 0 0

# For LibreOffice
fdesc /dev/fd fdescfs rw 0 0
proc /proc procfs rw 0 0

On the CentOS NFS server, /etc/exports includes the following line :

Code:
/nfs 192.168.0.0/24(rw,sync,no_wdelay,all_squash,anonuid=99,anongid=100)

Yes, the FreeBSD host is in the above subnet.
When I try to use LibreOffice on FreeBSD to open any file in /mnt/nfs, I gets a message :
"The file has been locked by another user. You can open it read only, etc".
This message is repeated for every file, including files that are NOT being open by any other user.
Also, LibreOffice from FreeBSD cannot write a new file to /mnt/nfs. "Error writing file."

LibreOffice on FreeBSD can happily read and write documents to $HOME directory, so the issue seems to caused by remoteness.
How do I get LibreOffice to open the nfs remote files correctly ?
It seems I'm having some issues with access rights and permissions, or NFS file locking ?

Pleases and thankyous for any clues to flatten this wrinkle, and help to get my LibreOffice on FreeBSD working as intended.
 
This sounds similar:

 
Thanks for reply.
I had seen some similar comments, and previously tried commenting out # export SAL_ENABLE_FILE_LOCKING
in the soffice script, but without success.
So, I edited the soffice script again, and rebooted, and now it seems to work. (More thorough testing needed.)
Strange that on a linux host, the file locking does NOT need to be disabled in soffice.
More of life's little mysteries.
Also, I can't find any relevant or useful comments in any logfiles, which is unusual for unix/linux systems.
 
I have NFSv3 locking problems with FreeBSD client to Linux server, too. In my case there are no locks available. That might translate into the same error if LO's message is imprecise. It might not be able to attain a lock and "think" that is because the lock is held.
 
I guess with Samba this will work without special settings.
Thanks for the suggestion, however I'm hoping to avoid samba when connecting *nix hosts.
ChatGPT gave me this clue:
In terms of efficiency, NFS is generally considered to be faster than Samba for file sharing, especially when it comes to large numbers of small files.
This is because NFS uses a more efficient protocol and has less overhead than Samba.
 
You can use the mount option "nolockd" on the client side. That will likely clear the error, although as the option name implies you don't get locking over NFS anymore.

I don't know whether Samba has server-tracked locking.

Otherwise the only solution I found so far is running FreeBSD on the NFS server. Then NFSv3 locks work with FreeBSD clients.
 
Otherwise the only solution I found so far is running FreeBSD on the NFS server. Then NFSv3 locks work with FreeBSD clients.
This is certainly my goal, and should be marked as the-right-answer.

Since the IBM/Redhat takeover of CentOS, we're planning to migrate all existing linux systems to FreeBSD.
Migration of our NFS/Samba server might need to be granted a higher priority.
Thanks for the backfeed.
 
Any reason you don't use nfsv4?
Filelocking works a lot better on nfsv4 and firewall rules are a lot simpler as well.
 
Back
Top