Desperate to make folder sharing work well with a windows host and linux guest. Have I tried it all?

Hi Reddit,

I'm trying really hard to make vagrant work well with a windows host and linux guest machine specifically for nodejs app development. Using [synced folders](https://docs.vagrantup.com/v2/synced-folders/index.html) is a must have because our devs want to be able to work with their preferred editor on their OS of choice. Disk performance is also really important for us. I'll summarize what I've tried below. The test I usually use to decide if things are working well is doing an "npm install" on the shared folder with a project, pm2 is a good package to install as a benchmark. I learned a while back that to make your life easier it's best to use the "--no-bin-links" switch with the "npm install" command, and to also use a shell with admin privileges.

**Default/vboxfs Folder Sharing**

This works pretty well, except for that it's painfully slow. Too slow.

**NFS via [vagrant-winnfsd](https://github.com/GM-Alex/vagrant-winnfsd)**

This seems to fail if there are a good number of files. It might be good enough some day, but not at the present. The performance here is ok, but pm2 fails to install. Many packages fail to install.

**NFS via [vagrant-hanewin-nfs](https://github.com/simonswine/vagrant-hanewin-nfs)**

pm2 fails to install. Many node packages fail to install.

**Rsync**

This is actually great performance wise, but it's one-way so if you use scaffolding tools in the guest OS the files created in the guest won't be synced back to the host. There is [a plugin](https://github.com/smerrill/vagrant-rsync-back) to help with that but you have to manually run that command and you're going to overwrite things accidentally and generally have a bad time.

**SMB**

The performance here is ok, but pm2 fails to install. Many packages fail to install.

**Reverse Folder Sharing**

I could put the project in the guest machine, and share it to the host via smb for windows, and nfs for osx etc.., but this isn't built into vagrant and is scary given the ephemeral nature of vagrant.

Has anyone found a silver bullet for the folder sharing problem?

Thanks

2 thoughts on “Desperate to make folder sharing work well with a windows host and linux guest. Have I tried it all?”

  1. I opted for rsync, assisted by grunt. There’s a weird combo of running things local and on the guest, so tasks tailored to syncing things up are a necessity.

    I’m working with Symfony, so stuff like entity generation is done on the host and sent over, while clearing the cache, or assetic dumps are on the guest. It usually depends on whether the command insists on embedding absolute paths, because for some reason Linux doesn’t like seeing “c:\blah\foo.php”.

    I would switch to a Linux host, but I’ll still have to support Windows hosts for other devs. Rsync isnt ideal, but its a damn sight better that standard shares.

    Reply

Leave a Comment