I have a couple shares on a Windows PC for Documents, Pictures, Video, etc. that are accessible from all my PCs. I have this PC backing up to the cloud, so anything saved in these locations automatically gets an offsite backup. This computer is called Lab on my Windows network.
I have now tried about a dozen things from other Linux sites and none of them work to solve the simplest problem.
How do I get these drives to show up automatically in the Files app? Preferably below (or within) Documents, Pictures, etc. in the left hand menu. On Windows, it shows \lab\documents and \lab\pictures, but Documents/Lab and Pictures/Lab would be totally acceptable. But whatever the solution, it has to be high in WAF (wife acceptance factor).
And also why does Other Locations | Windows Network always show nothing? Shouldn't Lab be in there with shares such as Documents and Pictures just waiting for a username and password to connect? And if it doesn't work that way, then what's the point?
What is the simplest way to make this work properly?
If you open the file manager, Nautilus, and head over to Other Locations, there should be at the bottom a box to make the connection manually. For Windows share the protocol to use should be SMB, so you can write it as smb://192.168.1.10 or smb://lab, using the appropriate IP address or domain name, that is. Does this work?
I don't know why it's not detecting it automatically when you visit Other Locations, but you can set that up manually. I don't know if this is the simplest choice, however, it's just the one that I know.
Launch a terminal from the applications menu. Run the following command to install the necessary packages for mounting SMB network drives:
sudo apt install cifs-utils
Choose a location in your system where to mount the network drive. For example, if you want it under Documents create a new folder there, called "Lab" or whatever name you decide, but please don't use spaces; it just makes things more difficult.
You now need to edit a configuration file to instruct the system to search for and mount this network drive automatically. The file in question is located at: /etc/fstab.
Note that you need admin privileges to edit this file; use one of these methods to navigate and open it with the right permissions: Three ways to edit files and folders as root.
Add a new line at the bottom of the file that looks something like this:
Make sure to change the username to your own, and other details like the right location of the drive and/or the credentials file.
The credentials file referred by credentials=/home/zenzen/.smbcredentials does not exist by default, you need to create it yourself. The exact name and location doesn't matter; just make sure it matches whatever you put in /etc/fstab. Prefixing the filename with a dot will make it hidden by default (you can toggle hidden files visibility in the file manager settings).
The contents of this file should be the username and password used to connect to the drive.
username=
password=
Finally, to prevent any unwanted access to this file with sensitive details, lock it down so that only your user can modify it:
chmod 600 /home/zenzen/.smbcredentials
You might need to restart for changes to take effect. If all went well, the next time you access the Documents/Lab folder, it will automatically connect to the network drive.
Just remember you should not save documents from Linux to NTFS as files can get corrupted. Accessing files, working on them in GNU/Linux fine, but don't save back out to NTFS shares.
I know this won't help the OP but I just discovered after many months of copying and pasting info to a thumb drive and using it to swap info from one drive to another that after reading this thread I could link both of my Linux OS drives together to transfer files from one OS to the other ...... I am dual booting Mint and Zorin .....
Thanks for the info folks it is a life saver for me and a whole lot quicker .....