Created
February 26, 2026 13:26
-
-
Save kekneus373/16d97e41f3e594b4e8de51c50fa094a6 to your computer and use it in GitHub Desktop.
[SAMBA] Show mounted shares in file managers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Below is a practical way to have a Samba (CIFS) share that you already mount via /etc/fstab appear automatically in the side‑pane of your file manager (Pcmanfm, GNOME Files, etc.). | |
| The trick is to tell the GVFS layer that the mount point should be treated like a “bookmark” – this is done with the x-gvfs-show mount option. | |
| 1. Edit the fstab entry | |
| Add (or modify) the line for the share so it includes the x-gvfs-show option. | |
| A typical CIFS entry looks like this: | |
| //server.example.com/share /mnt/samba_share cifs credentials=/home/you/.smbcredentials,iocharset=utf8,uid=1000,gid=1000,_netdev 0 0 | |
| Add the two extra options users (so you can mount/unmount as a normal user) and x-gvfs-show: | |
| //server.example.com/share /mnt/samba_share cifs credentials=/home/you/.smbcredentials,iocharset=utf8,uid=1000,gid=1000,_netdev,users,x-gvfs-show 0 0 | |
| Explanation of the added flags | |
| Option Why it helps | |
| users Allows non‑root users to mount/unmount the share (useful for desktop sessions). | |
| x-gvfs-show Informs the GNOME/KDE/Pcmanfm GVFS integration to expose the mount point as a bookmark in side‑panes and file‑picker dialogs. | |
| _netdev Prevents the system from trying to mount the share before the network is up (good practice for network mounts). | |
| Tip: If you already have auto in the options list, you can keep it; the presence of x-gvfs-show is the only thing that makes the bookmark appear. | |
| 2. Reload the fstab configuration | |
| You don’t need to reboot. Either: | |
| sudo mount -a # mounts any entries that are not yet mounted | |
| or, if the share is already mounted, unmount and remount so the new options take effect: | |
| sudo umount /mnt/samba_share | |
| sudo mount /mnt/samba_share | |
| 3. Verify in the file manager | |
| Open Pcmanfm, Nautilus (GNOME Files), Dolphin, or any other DE file manager. | |
| You should now see an entry named samba_share (or whatever you called the mount point) in the left‑hand pane under “Devices”. It will also appear in the standard open‑file dialog used by applications. | |
| 4. Optional: give the bookmark a friendly name | |
| Some file managers display the directory name as the label. If you want a prettier label, you can create a .desktop bookmark in ~/.config/gtk-3.0/bookmarks (for GTK‑based file managers) or the equivalent for your DE: | |
| file:///mnt/samba_share My Shared Folder | |
| Each line is URI<space>Label. After saving the file, restart the file manager (or log out/in) and the custom label will be shown. | |
| Quick checklist | |
| Edit /etc/fstab – add x-gvfs-show (and optionally users, _netdev). | |
| Reload mounts (sudo mount -a or unmount/remount). | |
| Open your file manager – the share should now appear in the sidebar. | |
| (Optional) Create a bookmark for a custom label. | |
| That’s all you need to make a Samba share mounted via fstab visible and conveniently reachable from your desktop environment. If you run into permission issues, double‑check the uid=/gid= values in the options so the mounted files belong to your regular user. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment