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.
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.
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?
@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.
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.
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.