SMB network drive never shows in Firefox file picker

Greetings,

I have installed the Samba and GVFS packages, the usual packages recommended for network drives. I can easily browse my NAS drive in the file manager under ‘Browse Network’ and I have created a shortcut to a folder located upon it in the file manager’s Bookmarks. But I have two problems:

  1. When I try to save a file in Firefox the NAS never appears, even under “Other Locations.”

  2. I can access a bookmarked NAS folder under the file picker in LibreOffice and GIMP, it is different in appearance from the Firefox file picker. But the root of the NAS drive does not appear in this file picker so I can only save to the bookmarked folder.

The first one is more serious, since I frequently save web content on my NAS, this is a bit of a hassle without it being in the file picker. Is it possible to fix this? How could I look about diagnosing the problem? I’m still learning my way with GNU/Linux but I’m not afraid to get my hands dirty with the terminal. I’d appreciate any help.

@Thranos: you may want to check 18.04 Caja doesn't see local network
and https://ubuntuforums.org/showthread.php?t=2384959

What I've done... taking into account my NAS is permanently on while I'm at home:

  • installed gigolo via sudo apt-get install gigolo

  • start gigolo from the menu or via MATE Terminal

  • click Edit Bookmarks in Gigolo

  • click Add and configure each share this way


    When asked for a password for the USER_NAME enter the required password and choose to Remember forever.

  • set up gigolo to start automatically when the PC start (open Control Center -> Startup Applications -> click the Add button => Name: Gigolo; Command: gigolo => click Save

Finally make Network Links visible for File Download (Firefox, Google Chrome) - for GTK 3.0:

  • Open MATE Terminal and enter following commands (one by one):
    ls -d /run/user/$(id -u)/gvfs/*/
    pluma ~/.config/gtk-3.0/bookmarks
  • create entries like this (each on a separate line):
    file:////run/user/1000/gvfs/smb-share:domain=WORKGROUP,server=<NAS_NAME>,share=<SHARE_NAME>,user=<USER_NAME>/ <DISPLAY_NAME>
  • save the file
  • reboot

Gigolo will automatically start and mount your shares.
Due to the entries you've made in the ~/.config/gtk-3.0/bookmarks file, they will be available when downloading a file from the Internet (in the navigator on the left side of the Save as... dialog box).

In order to avoid permanent error messages if gigolo cannot connect to / mount a share, open Gigolo and select Edit -> Preferences -> activate Interface tab and DESELECT Show auto-connect error messages

Hope this helps.

Final note: Keep in mind, you will be able to download directly to the shares, copy, delete, paste files to these shares, BUT you will not be able to modify metadata of files (like tags in Clementine, VLC Media Player). This is an issue because of the way the shares are mounted...

2 Likes

A solution would be to mount the Samba shares from your NAS, so that they’ll be seen as directories and should be browsable from Firefox (or other softwares that can’t browse the network).

I mount my NAS shares with lines like this in my /etc/fstab file:

//192.168.0.15/Videos	/media/qnap-ts128a/videos	cifs	credentials=/etc/nas-credentials,vers=2.0,iocharset=utf8,uid=1000,gid=1000	0	2
  • the first part is the local address of the Samba share to mount
  • the second part is the mount point (you have to create the dir first, of course); note that there are two directories made specifically for mounting: /media (the mount point will automatically appear in the panel of the file manager) and /mnt (it will not appear in the panel)
  • cifs is the filesystem to use for Samba shares; you might have to install the cifs-utils package, I don’t remember if if’s there from the start on Ubuntu
  • the credentials file is a text file containing two lines, username=xxx and password=yyy for the share; you can also specify both options rather than having a file; if your shares are allowed for guest, I don’t think you need this
  • vers=2.0 is an option of CIFS to manage some versions of Samba; depending of the one used by your NAS, it might differ
  • uid and gid are my user id, it means that the share is mounted on a directory as belonging to me; if you have multiple users on your system, this will need to be managed differently
  • 0 and 2 are mount options; keep them like this

Note that when added to the fstab, the shares are mounted during boot. Which means that the network has to be accessible at that time. So if you’re on a laptop (or even a desktop PC) that connects to the network through wi-fi, it won’t work, as the connection will be made after the desktop is loaded and won’t be accessible during boot.

2 Likes

Apologies for the delay in writing back, I was taking some time to get this right. The top solution works well for me. I’m using a laptop so WiFi access is paramount.

Thanks everyone for your clear and helpful replies.