How to mount a Windows file share on Ubuntu 13.04

Topics: 

I worked on a project lately where I needed access to a Windows file server. There are two (2) ways of doing this, as a regular user (available only to the person setting it up), and as root (the system administrator). Setting up the connection system-wide using the latter approach will allow read-only access by everyone on the system, but they won't be able to write to it.

Mounting the share in user space

  1. Open the Files file manager.
  2. Files » Connect to Server.
  3. For the Server Address, enter the following (where HOSTNAME is the server name and SHARE is the share name):
    • smb://HOSTNAME/SHARE
  4. Hit the Connect button.

The share will now be available in Files on the left sidebar under the Network section, and it will be available from the command-line interface (CLI) over at /run/user/$USER/gvfs/ where $USER is your local user name. I'd recommend adding softlink to more easily access your mounts:

  • ln -s /run/user/$USER/gvfs ~/mounts

For more information, see:

Mounting the share system-wide

This needs be done as the superuser, but the share should be readable by everyone. It will add a package to work the target file system, create a local folder to house the files and finally mount the remote share locally.

  1. sudo apt-get install cifs-utils
  2. sudo mkdir /mnt/LOCAL_SHARE_NAME
  3. sudo mount -t cifs //REMOTE_HOST_NAME/REMOTE_SHARE_NAME /mnt/LOCAL_SHARE_NAME

For more permanent solutions that will persist after system restarts, have a look at:

Comments

Add new comment

You must have Javascript enabled to use this form.