9

This don't think this is the typical, "I can't mount a windows share" post.

I am using stock Ubuntu 12.04. I am pretty sure this is a Nautilus issue, but I have reached a dead end. I have one share that I can't mount using smb://server/share via nautilus. I get the following error.

Error: Failed to mount Windows share
Please select another viewer and try again

I can mount this share from other machines(non-ubuntu) using the same credentials so I know I have perms on the destination share. I can mount other shares on other servers from my Ubuntu box so I am pretty sure I have all the smb packages I need on my Ubuntu box. To make thing more interesting, if I use smbclient from the command line, I mount this share with no problems from my Ubuntu box.

So here's what we know:

  1. destination share perms are ok (no problem accessing from other machines)
  2. smb is setup correctly on Ubuntu box (access other windows shares no problem)
  3. I only get the error when using nautilus
  4. smbclient in terminal works, no problem

Any help would be greatly appreciated. Googling turned up simple mount/perms issues, and I don't think that is what is going on here.

Let me know if you need more information.

Hugh

Update 1:

gvfs-mount smb://host/share failed with the following error:

Error mounting location: Failed to mount Windows share

Update 2:

John -

  • I tried #1 and got the same error as above.
  • #2 is not an option. This is a production share and if I changed the name of the share it would break things for many users.
  • I tried #3 and got the same select another viewer and try again error.

Update 3:

I installed a Debian guest VM on this box. It can connect to this share without issue. I tried both gvfs-mount from the terminal and I tried it from nautilus. They were both successful.

Here's some info on the Deb VM:

$ uname -a
Linux debian 2.6.32-5-amd64 #1 SMP Sun Sep 23 10:07:46 UTC 2012 x86_64 GNU/Linux
$ dpkg -l |grep gvfs
ii  gvfs                                 1.6.4-3                           userspace 
$ dpkg -l |grep nautilus
ii  nautilus                             2.30.1-2squeeze1                  file manager and graphical shell for GNOME

I hope this helps a little

Update 4

Looking at the logs was one of the first things I checked. Nothing gets logged to syslog with the mount fails.

Update 5

  • added share name to existing share and got the same error.
  • nothing in server event logs
  • tested a different share on same server and was able to connect. makes you think it is a perms issue, except I can connect to problematic share from command line via smbclient command.
  • I am not thrilled about the downgrade option
7
  • Can you try gvfs-mount smb://host/share and provide its output if it fails? Dec 10, 2012 at 17:57
  • the mount failed with the following error. "Error mounting location: Failed to mount Windows share"
    – oznah
    Dec 10, 2012 at 19:30
  • And no other message? :/ Dec 10, 2012 at 19:39
  • it prompted me for my user/domain/password which I entered correctly. It only returned the above error. Nothing else.
    – oznah
    Dec 10, 2012 at 22:13
  • Can you try (1) gvfs-mount smb://<IP Address>/share (2) Changing share name. (3) Create a new user on ubuntu box, mount the share with nautilus.
    – John Siu
    Dec 13, 2012 at 2:36

4 Answers 4

1

I had this problem too and I'll bet yours is the same.

It only happened with some shares. I had guest ok = Yes, but the permissions only allowed the owner to list the directory contents.

For example:

[documents]
    path = /home/ghodmode/Documents
    read only = No
    guest ok = Yes

... and ...

ghodmode@server ~ % ls -dl /home/ghodmode/Documents/
drwxr--r-- 12 ghodmode ghodmode 4096 Dec 14 03:32 /home/ghodmode/Documents/

The result was exactly the error message you described. This tells me that nautilus will access shares on a server as a guest user when it can even if it has already accessed other shares as a logged in user.

The default guest user is "nobody".

The solution for me was to change the permissions. I suspect that setting guest ok = No would also work.

4
  • guest ok = No Where would I make that change? Is that in smb.conf?
    – oznah
    Dec 17, 2012 at 18:20
  • @oznah Yep. All settings for Samba go into smb.conf. guest ok is a per-share setting, so it's set for each directory you have shared. If you don't have it set, it defaults to "No". Information on this and all the other settings can be found from the command man smb.conf. If you prefer reading it from a web page (like I do), the same information is on samba.org: samba.org/samba/docs/man/manpages-3/smb.conf.5.html
    – user39051
    Dec 18, 2012 at 1:48
  • It's doubtful this will resolve the issue because the server is a windows box not a samba server. I am just trying to mount a windows share from a Ubuntu desktop.
    – oznah
    Dec 19, 2012 at 17:15
  • @oznah Ya I didn't realize your server was a Windows box. However, the source of the problem might be the same. Remember my observation that Nautilus will connect as a guest user whenever it can. Can you find the Windows equivalent of "Guest Ok = No"? I mean don't allow any access to the share (not even read or list contents) unless it's with a valid login.
    – user39051
    Dec 21, 2012 at 6:40
1

Before you begin, double check the network location is typed correctly. This is one reason you will get this error. \\hostname\share

In my case, I was able to resolve this issue after diagnosing that it was in fact a DNS issue.

Try to ping the Windows machine in a terminal from Ubuntu:

ping <hostname>

If you cannot ping it via its hostname, try the IP address instead. If the IP address works, then you have a DNS issue where the DNS server is unable to resolve the IP address for the host.

In my organisation, we use an enterprise DNS with Windows Servers. Using the command prompt in Windows, run:

ipconfig /all

Take each of the DNS Server entries and add them to the hosts file on the Ubuntu machine in /etc/hosts

The /etc/hosts file accepts entries as "IP HOSTNAME", example:

10.1.2.1 mydnsserver1

The DNS should also be specified in the interfaces file /etc/network/interfaces, the specific lines you want to check are dns-nameservers and dns-search. dns-nameservers should be set to the entry you put in your hosts file above and can take multiple IP addresses, dns-search should be set to your domain (if in use). IP addresses are just examples.

auto eth0
iface eth0 inet static
        address 10.1.2.10
        netmask 255.255.255.0
        gateway 10.1.1.1
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 10.1.2.1
        dns-search mydomain.com

Check your /etc/samba/smb.conf file and ensure your workgroup is correct. Just in case.

Once you are satisfied, run this command:

sudo /etc/init.d/networking force-reload 

Assuming all the settings are correct, you should be able to ping the host via its hostname which will in turn resolve the error.

2
  • Your answer could be better by exactly showing what kind of changes should be made to the files you mentioned and explaining why it needs to be changed like that.
    – mondjunge
    Feb 19, 2015 at 16:12
  • 1
    Thanks for the suggestion. I overhauled the entire post with examples, hopefully it will help others. :) Mar 2, 2015 at 6:07
0
  1. Lets create some short-hand for easy reading

    • ProblemShare - Windwos share that Nautilus has problem mounting
    • ProblemServer - Windows server sharing the ProblemShare
    • ProblemMachine - Ubuntu machine/desktop having difficulty mounting the the above share.
    • ProblemAccount - Ubuntu account of ProblemMachine having problem mounting ProblemShare with Nautilus
  2. Test #1

    On ProblemMachine

    • Make sure system is not mounting any samba share (check /etc/fstab)
    • Reboot
    • Create a new user, then try mounting the ProblemShare with Nautilus.

      If new user mount successfully, your Nautitlus and related package is not the issue.

  3. Test #2

    On ProblemMachine

    • Make sure system is not mounting any samba share (check /etc/fstab)
    • Reboot
    • Login ProblemAccount
    • Make sure desktop/Nautilus don't have any active samba mount, especially with ProblemServer.
    • Make sure there is no samba auto mount from login script
    • Logout then login ProblemAccount
    • Open Nautilus

      1. Click 'File' in menu bar(top of screen)
      2. Select 'Connect to Server...'
      3. Enter info
        • Server: < ProblemServer name or IP, not URL format >
        • Type: Windows share
        • User name and Password, use your Windows credential
      4. Once connected, select 'ProblemShare'

    If this mount successful, your problem is caused by cached credential or credential in key chain.

0

I got same error message, when I try to mount a windows drive which is not accessible by name, the solution is mount the windows drive by IP address.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .