Mounting a Windows or other OS drive across a network can be a challenge in Ubuntu. Samba is great but it certainly takes a bit of getting used to. If you´re in a hurry it can be a bit cumbersome and fiddly to set up. If the need to have the connection to the other OS is a short-lived one, there is even less incentive to go through the whole rigmarole to get the connection set up.
Gigolo is a great utility that has saved me time as well as finger and brain-ache on more than one occasion. It is available in the Software Centre.
To use it is very straightforward. Firing up the software brings up the main window.
Click on the Connect icon and complete the details for your connection in the Connect to Server dialog. Pick the appropriate type of connection from the Service type drop-down menu and the fields that are required in order to complete the connection are displayed. These fields differ from connection type to connection type. The ones that appear when you select a Samba share are shown below.
Provide the required information as appropriate for your connection, and then click the Connect button. If one is required you will be asked for a password. The Connect to Server dialog closes and you are returned to the main Gigolo window. You should have en entry in the main window representing your connection.
You can double-click it to open a file browser window on your Samba share, or highlight it and click the terminal icon in the toolbar to open a terminal window on your shared resource.
You can also create bookmarks in Gigolo so that you don’t need to re-enter the details of a connection that you wish to re-use, and you can select to have the shared resource automatically connected each time your system is restarted.
I was recently asked how to share folders between two Linux PCs. I didn’t know off-hand but I said I’d look into it. To research this I’d need two Linux PCs, so I used my main Ubunto PC (Nostromo) as one and a VirtualBox PC running Ubuntu as the other. The virtual PC was called Sandbox. Sandbox was configured so that it and Nostromo were on the same network. They could ping one another.
As it turned out the process of setting up shared folders was nice and straightforward. I first created a folder on Nostromo called Nostromo. I right-clicked it and selected Sharing Options.
The Folder Sharing options dialog popped up. I selected the Share this folder option and then clicked the Create Share button.
I was prompted to install the Windows Network Sharing service. I typed in my root password and the files were downloaded and installed. I was then prompted to reboot.
The Nostromo folder now had a two way arrow icon on it, indicating it was shared.
I repeated this on Sandbox. I created a folder on Sandbox called Sandbox, and set up a share on that folder. I had to go through the same steps as above, and then reboot. That folder now showed a hand icon, showing that it was shared. The visual differences in the UI and in the sharing symbols is because Sandbox wasn’t running the Unity interface.
I highlighted the Network entry in the desktop browser on Sandbox and saw that the Nostromo PC and the Sandbox PC were both listed in the network window.
I double clicked on the Nostromo computer icon and the display changed to show the shares that were available on the Nostromo computer.
The Nostromo folder was listed (but without the capital N for some reason). When I double-clicked it to open it I was prompted for the login details of an account on Nostromo that had permission to access this file. Because the folder I had shared was in my home folder I entered my normal user details for Nostromo. (If I had clicked the Guest Access option in the Folder Sharing dialog I wouldn’t have had to do this step.)
I saw that the test file I had placed in that folder on Nostromo was visible and accessible from Sandbox.
And that was that.
Some years ago a friend of mine asked me to go over to his house to help him set up access to a Windows PC from an Ubuntu one. To cut a long and frustrating story short, we tried everything we could think of for an entire afternoon and still failed miserably. It was with a heavy heart then, that I turned to that same task again today.
I wanted to have access to a shared drive on a Windows XP laptop. I was amazed to find the answer after only a short period of Googling. These are the steps that I needed. The laptop in question is on a workgroup, and there is no password – it just boots straight up. It is attached wirelessly to the same network that my Ubuntu box is cabled onto.
I created a folder called davetest on the laptop & shared with read/write access. I checked that I could see it and that I had read/write access to it from another Windows laptop just to verify that the share was working. It was.
On my Ubuntu PC I opened a terminal and typed:
sudo apt-get install smbfs
As I understand it (and I’ll gleefully admit I’m no expert in this) SMB (Server Message Block) is a network protocol used to access such things as printers and shares between network nodes. The smbfs package allows Linux to interact with the SMB protocol via the Linux file system (hence smb fs).
I had to create a folder on the Ubuntu PC in the media folder on which the remote share would be mounted:
sudo mkdir /media/laptop
I then had to edit the fstab file:
sudo gedit /etc/fstab
I added the following line to the bottom of the file (note that this should all entered on one long line):
//<IP Address>/davetest /media/laptop cifs guest,uid=1000,iocharset=utf8,codepage=unicode,unicode 0 0
<IP Address> = IP of laptop
davetest = name of shared folder on laptop
uid = The user ID of the user who will take ownership of the mounted files
Finally I used the mount command to mount the shared folder onto the Ubuntu file system at the /media/laptop location:
sudo mount -a
I received no error messages, so I proceeded to the first and simplest test:
This listed the files in the shared folder on the Windows laptop. I experimented further and through the usual means I verified that I could copy files to the location, delete files and change files. The new file system location was accessible through the terminal windows and through Nautilus.
Makes me wonder what the deuce we were doing all those years ago, and why it was such an epic failure.