How can I get libreoffice to open files over a windows/samba connection with a /run/usr/1000/gvfs path?

This is the only way I can open smb files with emacs org-mode links, as far as I can tell. smb: file paths do not seem to work.

This method (/run/usr/1000/gvfs) works with evince (pdf) files. This suggests that this is an issue with libreoffice rather than with emacs org-mode (aside from smb: file paths not working).

I am able to use org-mode links to local libreoffice files in org files just fine, eg:


My .emacs file has

    ((auto-mode . emacs)
     ("\\.odt\\'" . "/usr/bin/libreoffice %s")
     ("\\.pdf\\'" . "/usr/bin/evince %s")


From a terminal (outside of emacs), the following will work for LO:

/usr/bin/soffice smb://

However if I try the org-mode link:


emacs asks if I want to create a new header. So emacs org-mode does not play well with smb: file paths.

If I try an org-mode link to the /run/usr/1000/gvfs mount point:


I get a general I/O error: “General input/output error while accessing /run/user/1000/gvfs/smb-share:server=,share=server_name_1/Documents/foo.odt.”

This is the same error I get from a terminal with LibreOffice if I try

/usr/bin/soffice /run/user/1000/gvfs/smb-share:server=,share=server_name_1/Documents/foo.odt

(or another symbolic link to this).

But this method opens pdf (evince) files from emacs org-mode links:


In a terminal, this path also works for evince, with quotes:

evince "/run/user/1000/gvfs/smb-share:server=,share=server_name_1/Documents/foo.pdf"

Adding quotes to the path for the odt file in a terminal does not help for LibreOffice. I get the same I/O error. That is in a terminal,

/usr/bin/soffice "/run/user/1000/gvfs/smb-share:server=,share=server_name_1/Documents/foo.odt"

also fails

I have the same issue with vanilla Ubuntu 17.10 : LibO will not use the /run/user/etc. link, although it works when mounting as a Samba share, and no other piece of software that opens files (text editors, GIMP, etc.) have a problem with the gvfs version. (And now my “samba share” is borked, but that’s another story.)

I had same problem, tried some suggested fixes and workarounds, did not want to mount permanent share, decided to try LibreOfficeDev_6.0.0.0.beta1_Linux_x86-64 - which can be installed alongside regular stable LibreOffice (5.1 in my case), and it WORKED :slight_smile: Linux flavour is Xubuntu LTS 16.04.03, kernel 4.10.0-40-generic. Download LibO beta here Download LibreOffice | LibreOffice - Free Office Suite - Based on OpenOffice - Compatible with Microsoft
Hope that helps.

You need to mount the samba share permanently, and use that location rather than the /run/usr/1000/gvfs version. That link (in preceding sentence) should give most information needed, but I had to supplement it with some information (about uid and gid) from AskUbuntu.