Ubuntu – How do applications open from/save to smb shares

gvfssmb

When, in different applications, using the menu to open/save files, the dialog that appears might offer different choices. A lot of them lacks the ability to browse the network and connect to (in my case) a smb (samba) share on my NAS. My question: where is it going wrong ? Or which packages are buggy ?

I have samba installed on my machine (Xubuntu 12.10), and also gvfs and its backends.

With Thunar (1.5.3), I can easily access shares by:
  – clicking the 'Browse Network' shortcut in the Side Pane,
  – using self-made shortcuts directing to a folder on the share
  – typing a path such as 'smb://datastore/action/Pictures'
When a share is not mounted yet, a dialog appears to enter my credentials.

Thunar adds the self-made shortcuts to the file ~/.gtk-bookmarks, and to be sure I linked it with .config/gtk-3.0/bookmarks.

In LibreOffice ( 3.6.2.2) I find the same shortcuts as in Thunar, only 'Browse Network' is missing. Shortcuts to a smb share do work but only for browsing. Typing in a path works as long as I end it with a '/' ('smb://datastore/action/' does work, 'smb://datastore/action' not).
When entering 'smb://datastore/' all shares are shown, but clicking them results in an error message "Not a directory".
When at last I click the Save button, I get an error-message stating "Path to the file does not exist". If I try to open a file, the dialog closes and nothing happens.

The erroneous behavior only seems to be associated with the dialog. Opening a LibreOffice file on the smb share by clicking it in Thunar does work, as does saving it by clicking the save button on the LibreOffice toolbar.

I tested Archive Manager (3.6.1.1), gThumb (3.0.2), Gimp (2.8.2) Inkscape (0.48.3.1) and Gnome MPlayer (1.0.6). They act similar to LibreOffice, although opening a file might work.

Looking at Firefox (17.0), Leafpad (0.8.18.1) and Audacity (2.0.1), I find no way to access smb shares. All shortcuts referring to a smb share are missing, typing a path that starts with 'smb://' yields no result.

So, where is the cause ?  Is it gvfs, gtk, samba, the applications themselves, some packages missing ?  And what about applications that rely on java, python, perl, … Do they need additional packages to access smb shares ?  Is this a problem only for smb shares ?  Or is it common to all type of network shares ?  Maybe it has to do with the recent change of mounting point (~/.gvfs/ -> /run/user/$USER/gvfs/) and its awful mappings ?

Anymore insight information is more than welcome !

Best Answer

The problem is the applications themselves aren't necessarily using gvfs to do their I/O. Using smb:// should work in Firefox though, but not work by using the File Open dialog. Typing the URL directly into the location bar should work though, assuming that Firefox wasn't recompiled without the "GNOME" integration support.

Apps which do not use gvfs directly to do file I/O will need to open the file via the gvfs mount point (~/.gvfs/ or /run/user/$USER/gvfs/) to be able to interact with it. Opening a file in Libreoffice from within Thunar probably works because it's using the mount point path, rather than an smb:// URL to the file.

Related Question