- my wife's laptop is not always connected
- two way file transfers
- non-English characters in file names
- no crashes or stalls, no transfer errors
- usable in a script
- bulk file transfers
- large files
- one-time or automatic setup
The first step is to share a folder on the Windows PC.
The next step is connect to that shared folder from the Linux PC:
I started out using the "Places->Connect to Server..." menu item on the Gnome panel. It's really easy: select "Windows share" in the Service type drop menu, and type in the relevant connection information (server, share, folder, etc.). This worked rather well as long as I was using nautilus for my file transfers. I couldn't figure out at the time how to access the remote files via a script with regular shell commands (e.g. cp, rm, mv).
I just recently learned that I was actually using Gnome VFS, and that files may be copied at the command line with the gnomevfs-copy utility, using the same file URI's that nautilus uses (they start with smb://).
Still, I wanted something that's not tied to Gnome, since I have plans to replace it with something else (I'll have more to say about that in the near future).
For a short while I used scp (secure copy) and sshfs (ssh user-space file system), but this method has several drawbacks: for starters I needed to setup an SSH server on my wife's laptop (available for free as part of Cygwin). It isn't straight forward.
There are other problems:
- I can't access my wife's documents folder when I connect with my own username, even though it is shared
- Filenames must be in English (I couldn't figure out how to configure this)
- sshfs tends to stall in mid transfer on my setup, I didn't investigate why.
//10.0.0.4/C /mnt/windows/C smbfs uid=<username>,gid=<username>,username=guest,guest,codepage=<codepage>,iocharset=utf8 0 0
Notes:
- my wife's machine has the local address 10.0.0.4
- it has the whole C drive shared
- I created the directory /mnt/windows/C to be used as the mount point
- you should replace the text in red with your own stuff
- the shared folder is treated here as if it is always available - I tried to add the noauto option but then the codepage and iocharset settings were ignored (probably due to a bug in smbmount).
//10.0.0.4/C /mnt/windows/C cifs noauto,noexec,nosuid,nodev,uid=<username>,gid=<username>,username=guest,guest,iocharset=utf8 0 0
And it worked just fine - it meets all of my requirements!
One last note: an issue that seems to be a FAQ is how to mount a folder like "My Documents" that's shared on the windows machine? - the problem is that the space messes up /etc/fstab. The solution is to use the octal code for the space character \040, as follows:
//10.0.0.4/My\040Documents /mnt/windows/My\040Documents cifs noauto,noexec,nosuid,nodev,uid=<username>,gid=<username>,username=guest,guest,iocharset=utf8 0 0
Happy sharing!