Mount / Open Windows Shares Locally on Ubuntu 11.04 or 10.10

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

One can open and view shared files and folders from computers running Windows from within Linux (e.g. Ubuntu Natty Narwhal or Maverick Meerkat or any older version) by merely typing the host name or ip of the Windows machine in the location bar of the nautilus or equivalent file browser


After you press enter you would be asked for the user name and password as well as the workgroup for the Windows machine. Once you do that the share would open like this:

However, certain applications don’t like opening / accessing files directly off the samba link and therefore you might have to mount it as a local files on your machine. Well this is not too difficult, all you need is to have smbfs installed. You can do so by

sudo apt-get install smbfs

Now you can use the following commands to mount it (replace the “names” without suitable choices :D)

sudo mkdir -p /mnt/winshare

Type this in a single line:

sudo mount -t smbfs -o username=windows_machine_username,password=windows_user_password //windows_host_name_or_ip/sharename /mnt/winshare 

You can view the mounted files using the commands

cd /mnt/winshare
ls -l

If you want the Windows share //windows_host_name_or_ip/sharename to be automatically mounted at every system start (after reboot, if the Windows machine is not alive this would fail), edit and insert the following option in the file /etc/fstab, to edit the file do

gksudo gedit /etc/fstab

Append following line (written in a single line)

//windows_host_name_or_ip/share /mnt/winshare smbfs auto,gid=users,fmask=0664,dmask=0775,iocharset=iso8859-15, credentials=/etc/sambapasswords 0 0

Don’t forget to create the credentials file by doing this

gksudo gedit /etc/sambapasswords

Now add following content:

username = windows_machine_username
password = user_password

Save and close the file. Make sure only root can access your file:

chown 0.0 /etc/sambapasswords
chmod 600 /etc/sambapasswords 

You might also like

Easily Backup Network Share for Windows 7 in Linux (Ubuntu) While there...
Mount Linux NFS Share on Windows 7 One convenient...
Access or Stream Windows 7 Multimedia Share to Linux Windows 7 samba...
Solution to Windows 7 Ubuntu 9.10 Share Problem If you are...

About the Author

has written 346 posts on this blog.

Meditating towards his "nerdvana", lifehacker is a teacher by the day and a nerdy blogger by the night. He lives to learn and yearns to learn living.

One Comment on “Mount / Open Windows Shares Locally on Ubuntu 11.04 or 10.10”


  1. Easyily Backup Network Share for Windows 7 in Linux (Ubuntu) - Hack Your Life!

Write a Comment

Gravatars are small images that can show your personality. You can get your gravatar for free today!


Copyright © 2019 Hack Your Life!. All rights reserved.
Proudly powered by WordPress. Developed by Deluxe Themes