Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a server for development (Ubuntu 12.04). On that machine, I have a shared folder named "projects". I tried

sudo mount -t smbfs smb://192.168.2.28/projects/myProject /mnt/myProject

on my Ubuntu 11.10 and got the error:

Mounting cifs URL not implemented yet. Attempt to mount smb://192.168.2.28/projects/myProject.

How can I do to solve it? I need to mount the folder to use it with NetBeans.

share|improve this question
    
Sounds like the samba server (192.168.2.28) isn't setup yet or doesn't have the proper ports open to allow it to connect. Can you run this command to make sure you see the proper ports open for samba connection: sudo nmap 192.168.2.28 –  ruffEdgz May 14 '12 at 20:30
    
@ruffEdgz The problem is not related to the server; this error message occurs before any network operations are performed. See my answer for details. –  Eliah Kagan May 14 '12 at 20:47
    
Good to know. Haven't needed to do this on my laptop yet so I will have to make sure it works on my current Samba server ;) –  ruffEdgz May 14 '12 at 21:28
add comment

2 Answers 2

up vote 43 down vote accepted

Since as the error message says CIFS URLs (starting with smb://) are not supported, you have to use the "classic" syntax to identify the server and share. Furthermore, you cannot mount a folder within a share as though it is a share--you should mount the share and then access the folder within it. You can make a symbolic link to the folder inside the share, if necessary. Finally, when you run smbmount, mount -t smbfs, or similar remote mount commands as root (for example, with sudo), you need to specify the username on the server (unless it's actually root, which is unlikely and, if the server runs a Unix-like system, not recommended).

So first, you'll create a folder (mount point) for the share:

sudo mkdir /mnt/projects

(This is assuming you want to create it in /mnt. It's become more common to create all globally accessible mount points that aren't part of your Ubuntu system itself in /media instead of /mnt but it's fine to use /mnt if you like.)

Then use a command like this to mount the share:

sudo smbmount //192.168.2.28/projects /mnt/projects -o user=USERNAME

Replace USERNAME with the username on the Samba server that you need to log in as. You'll be prompted for your password. You can specify your password on the command-line too (with -o password=PASSWORD) but it will appear in cleartext in the Terminal and will go into your command history, so you probably don't want to do that.

You'll notice that I've used smbmount but mount -t smbfs or mount -t cifs (or mount.cifs) should work just as well, if you prefer.

Now smb://192.168.2.28/projects's contents are accessible in /mnt/projects. If you need to be able to access the contents of smb://192.168.2.28/projects/myProject in /mnt/projects/myProject, you can create a symbolic link:

sudo ln -s /mnt/projects/myProject /mnt/myProject

For readers of Ubuntu 12.10 and later: You must use mount.cifs or mount -t cifs (smbmount and mount -t smbfs are no longer provided). The cifs-utils Install cifs-utils package is required. These commands will work on earlier systems too.

share|improve this answer
    
Thanks! It really worked. –  Almino Melo May 15 '12 at 15:50
4  
On Ubuntu 13.04 I had to install the cifs-utils first: sudo aptitude install cifs-utils. Afterwards I was able to mount a share with this syntax: sudo mount -t cifs //server/share /mnt/ –  Gerald Schneider Jul 29 '13 at 15:27
    
@GeraldSchneider Thanks, I've added mention of that to the answer. –  Eliah Kagan Jul 29 '13 at 16:21
    
Worked with me mount Windows 7 (host) folder in Kubuntu 13.04 inside VirtualBox (using a host-only adapter). –  Mohamad Fakih Aug 30 '13 at 17:50
add comment

In order to permanently mount your SMB share use the following procedure:

  1. create a folder for mounting the share on (for example /mnt/windows):

    sudo mkdir [mount point]
    
  2. Change its permissions

    sudo chown [username]:[username] [mount point]
    
  3. Create a file containing your domain credentials (I use /home/[user]/.smbcredentials)

    username=[domain user]
    password=[domain password]
    domain=[domain]
    
  4. Add the following line to /etc/fstab

    //[smb hostname]/[share name]/        [mount point]  cifs        credentials=[credentials file path],rw,uid=[user],user       0       0
    
  5. Run (only once, on reboot this will happen automagically)

    sudo mount [mount point]
    

Tested to work on Ubuntu 12.10

share|improve this answer
    
What worked best for me was: echo //192.168.1.1/c$/ /mnt/c cifs credentials=/home/user/.smbcredentials,rw,uid=1001,gid=1001,user 0 0 | sudo tee -a /etc/fstab . Then to mount, I ran: sudo mount /mnt/c –  Ross Smith II Jan 13 at 17:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.