Accessing a Shared Folder on a Windows PC
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.