Linux – Best way to share directory between Windows and Linux on VMPlayer

file-sharingfilesystemslinuxvmware-player

What is the best way to share directories between Windows Vista host and Linux guest on VMPlayer?

The scenario is following:

  • on the Windows host I've got development tools (IDE, etc.);
  • on virtualized Linux I've got the test environment;
  • I need to share code directory between the two;
  • I'd prefer to have files served from Win to Lin, but if the other way around is more efficient, I consider switching.

Edit: should I use cifs rather then smbfs?

Edit2: Ok, my initial question was because I've done it "by the book". Mounted with smbmount. Was terribly slow, unusable. Then I've mounted with cifs. Didn't help. Now I've tried the ip option as suggested by Evan. No change.
Is it about round trips to domain controller or something like that? Should I set up local account just for sharing?

Best Answer

If your Linux guest has the SMB or CIFS filesystems available, you can mount shared directories on the host system (assuming you've configured networking between the VM and the host). (I'm a little sketchy on VMWare Player-- it's been a long time-- but I think it can do bridged networking between the host and the guest.)

The hardest part is going to be getting the Windows host's firewall opened up to allow file sharing. After that, assuming you can do:

mount //host-computer-name/sharename /mnt/mount-point-on-linux -t smbfs -o "ip=host-ip-address,username=valid-user-on-host"

By specifying the IP address on the mount command line you don't have to worry about name resolution between the host and the guest.

You can use either cifs or smbfs as the filesystem type, depending on which your kernel has. Both can co-exist in the same kernel w/o conflict. The smbfs code is the older code, but has always worked fine in my experience. The cifs code is newer, but has also worked when I've used it. Some people say that cifs performs better, but I can't say I've seen that. They have slightly different options semantics, so be sure to take that into account.