During the last few days I've tried to connect to a Windows shared folder on another machine using Ubuntu.

Finally yesterday I succeeded, but today it is not working anymore. Here's what I have done:

  • create a directory on Desktop
  • add this line to /etc/fstab:

    //network_ip/shared_folder /home/user_name/Desktop/directory_on_Desktop cifs guest,uid=1000 0 0

Yesterday it worked fine, but today it says: mount (22): invalid argument

If I change, in the fstab file, from guest to users it works fine. But why can't I use guest?

P.S. Yesterday after finishing using the PC I shut it down without manually unmounting the shared folder. While it was shutting down it stopped on the Ubuntu window (the one with five dots under the logo) so I held down the power button to shut it down.

  • This is an old entry, but you can try: askubuntu.com/questions/199142/… – Cloacker Jul 7 '16 at 14:46
  • Unfortunately if I add users it still doesn’t work (it says invalid argument), the only way to make it work is removing guest. – Lorenzo Jul 8 '16 at 9:32

1) perhaps, just a hunch, fstab program runs before network is up. The correct approach should be editing /etc/network/if-up.d for updating the fstab whenever the interface goes up (and if-down.d, when it goes down). (ask for help with this)

2) Other thing: probably you had the guest user, if you want only the "guest" user to mount, ok, but you'll probably want any user to mount. you should put "user", for any user to have access.

  • Sorry I forgot to write that the error: mount (22): invalid argument appears when I do: sudo mount - a. So I think that the problem is not in your point number one (tell me if I am wrong). In addition to that I put guest just because I don't want to be asked for password (because there isn't one). – Lorenzo Jul 7 '16 at 14:22

Stumbled upon the same behavior in Arch, mount.cifs version 6.7. Whenever the guest option was specified the mount command failed with the "invalid agrument" message, even though the man pages listed the guest option as supported.

I worked around that by specifying username=guest,password= instead. That is, user "guest", empty password. Worked fine connecting to an anonymous share on a Windows XP laptop. I think you can use any name in this case, not just "guest". Maybe even an empty name will work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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