Thunar: How do I access folders shared on Windows computers?

Hello all,

I must admit that I’m a bit surprised by the fact that my search for similar questions yielded almost no results. Looks like the following task is obvious to everybody but me.

Here’s the question:

How can I browse and access folders shared by Windows computers in my network using Thunar?

At a first glance, it seems to be rather clear - just choose “Browse Network”. Unfortunately, this only lists my Linux computer (the one I am writing this post on) and one other non-Windows host.
Neither my router which offers a SMB share, nor any of my Windows computers is shown there.

One interesting thing is that “Browse Network” changes the entry in Thunar’s address bar to network:/// instead of smb:// as you could expect from some tutorials on the net.

If I try to edit that network:/// entry to point to one of the other computer’s IP address, such as network://192.168.178.29/, Thunar becomes entirely unresponsive (hangs).

If I enter smb://192.168.178.29 instead as per instructions found in tutorials, simply nothing happens.

As I read somewhere that gvfs and the gvfs-smb backend are required, I made sure they are installed:

$ pacman -Qs gvfs
local/gvfs 1.50.2-1 (gnome)
    Virtual filesystem implementation for GIO
local/gvfs-smb 1.50.2-1 (gnome)
    Virtual filesystem implementation for GIO (SMB/CIFS backend; Windows client)

As I can connect to the Windows computer using smbclient "//192.168.178.29/" without problems, I assume that at least the samba configuration should be OK.
Sharing folders from the Linux box to the Windows computers works as well.

What am I missing or overlooking? Any help would be greatly appreciated. Thanks in advance.

Samba client requires the presence of a configuration file - which may be empty - but it must be there.

Browsing a samba service for shares has been disabled for quite some time.

You will have to connect directly to the share and provide your credentials to access the share. Only then you will be able to see what other shares the service provide.

This is a consequence of various ransomware attacks which spread themselves using netbios vulnerabilities.

Some advanced samba functionality wil require you to install the samba package - example is wins lookup and nmb.

2 Likes

My main problem was:

try adding the username to use when connecting

smb://username@server/share
1 Like

That indeed explains a lot - but not everything. There is another computer in the network that appears in “Browse Network” nevertheless. If browsing was disabled, I’d expect the list of computers to be entirely empty (perhaps with a hint like “browsing disabled for security reasons” - as people coming from Windows otherwise might be confused).

As I am able to connect with smbclient and also can share folders from Linux, I assume that the samba setup here should be sufficient.

Interesting, however: After installing gvfs and in particular gvfs-smb, you will have to reboot as otherwise, the changed configuration does not take effect.

After a reboot, I now can enter smb:// URIs as expected.

The only thing really needed was

sudo modprobe cifs

Explained here

2 Likes

Thanks a lot. That indeed looks like the solution.
Maybe a stupid question - I am using cifs for auto-mounting a SMB share (mount only when accessed) with a systemd automount unit. Does that mean cifs is loaded on demand as well and is unloaded together with the automounted share after a certain time of inactivity?

GVFS operates with a performance (and feature) penalty, versus using the native CIFS kernel module.

You can use systemd mounts/automounts, the fstab, or manually mounting on demand, rather than GVFS, if you want the best performance.

KDE (not your situation) also offers a GUI friendly option: Smb4K

My CIFS module stays loaded, regardless of whether or not a systemd mount unit is active.

If you use an automount unit why would you need to access the share using smb:// ?

You would just have to access the mountpoint? Either in thunar by navigating to the mountpoint or launching thunar with a a location

thunar /data/smb

When you use gvfs as you will when using smb:// protocol in thunar you mount the device on /run/… ?

That seems overkill to me.

cifs is a network filesystem driver like nfs and as such the driver stays loaded whether in use or not.

1 Like

@DAC324, I think you’re getting some terminology mixed up.

  • The modules, like drivers, give the operating system extra abilities, such as cifs allowing you to access a network file system shared by an SMB server. They don’t load/unload based on whether or not you’re actively using a network share. Your cifs module should stay loaded indefinitely.

  • For purposes of convenience, most GUI-based file managers (Thunar, Nemo, Dolphin, etc) have built-in mechanisms for accessing SMB shares over a network. However, they use an abstraction layer (such as GVFS or KIO) to accomplish this, which results in a performance penalty. This is invoked by using the smb:// protocol in the file manager’s address bar, or when using the built-in “Network” shortcuts.

  • The preferred method is to avoid the GVFS/KIO method, but rather use the native cifs method. This is done via many different ways: systemd (auto)mounts, fstab, Smb4k, or manually invoked via the terminal. Once you set it up correctly, you can garner the same “convenience” by simply creating a shortcut/favorite to the folder of which you configured with your systemd-mount or fstab.

Like @linux-aarhus explained, you’re essentially doing a redundant “double-mount”. Even though you’ve configured systemd automounts, you’re still accessing your SMB shares via the smb:// protocol. :pensive:

1 Like

Sorry for the confusion.
That automount I mentioned points to a different share.

What I am trying to do is access additional shares in an ad hoc fashion.

As I have a cifs automount to that other share already in place I only thought that the cifs module should already have been loaded.

In a nutshell: That automount and my attempts to connect to 192.168.178.29 are two separate things.
I just don’t want to set up an automount for each share I eventually access.

Samba has always been hit-or-miss with my flavors of linux.

If your ISP allows you a static address on Windows (or doesn’t change it frequently), I found it easier to set up a Windows in-house ftp server. Comcast in the US likes to change your static address; Verizon lets you keep it almost indefinitely. Dunno about other ISPs.

Once you set up the ftp user/password in Thunar, the ftp site can be bookmarked and cifs/fstab issues avoided. Great for older Linux kit whose security can’t be updated (ie Sharp Zaurus) but still has gftp, etc available.

EDIT: the ftp setup I cite is for a home network only, but @winnie’s security concerns make a lot of sense, if only because it’s MicroSoft, not linux.

If that’s the case, you would have to enter the server’s hostname (or IP address) and the share name, at a minimum, or even prepend it with the username.

Two examples:

smb://192.168.178.29/documents
smb://daccie@192.168.178.29/documents

Either method will still require you to enter the correct password for the relevant user access.


As for casually “browsing”, @linux-aarhus already explained earlier:

You technically could enable some features on the Windows computer (which are not recommended) in order to permit “browsing”, but you’ll take a performance and security hit. It’s not really worth it anymore. (It might require additional configuration on the client side as well.)


The best approach is to add bookmarks or side-panel shortcuts, and just click on them and browse, as you would any folder.