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.
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 runsmbmount
,mount -t smbfs
, or similar remote mount commands asroot
(for example, withsudo
), you need to specify the username on the server (unless it's actuallyroot
, 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
butmount -t smbfs
ormount -t cifs
(ormount.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 ofsmb://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
ormount -t cifs
(smbmount
andmount -t smbfs
are no longer provided). The cifs-utils package is required. These commands will work on earlier systems too.In order to permanently mount your SMB share use the following procedure:
create a folder for mounting the share on (for example /mnt/windows):
Change its permissions
Create a file containing your domain credentials (I use /home/[user]/.smbcredentials)
Add the following line to /etc/fstab
Run (only once, on reboot this will happen automagically)
Tested to work on Ubuntu 12.10
While the accepted answer is correct, you can now mount a folder within a samba share with help from 3 packages:
These are CentOS base repo packages (sorry, no longer an Ubuntu user so can't check) but I'm confident there's something similar for Ubuntu.
In Ubuntu 18.04 I mounted a shared smb directory directly via the filebrowser, no command line fiddling required.
Open the file browser, then click +Other locations
Enter server address eg smb://shared.foo.ac.uk
Click "Connect" and enter your credentials if necessary