New vagrant-mirror plugin (for 1.0.x) to workaround shared folder performance
We've been using Vagrant for a while and, as with many others, have had real issues with Virtualbox shared folder performance for projects with large codebases. The standard alternative, NFS shared folders, doesn't really work when using a Windows host especially if you want to keep dependencies on the host to the bare minimum.
uses rsync to copy files from your shared folder to a directory on the guest virtual disk. Rsync runs entirely on the guest to minimise dependencies on the host.
monitors the host filesystem (using the listen gem from guard) and updates deleted, new or changed files on the guest in realtime
allows you to exclude paths (docs, for example) that are not required
can symlink from paths within your mirrored directory back to the virtualbox shared folder - so that you still see changed files on the host in specific paths where this matters to you
can beep when it completes a transfer - which you may find useful to know when you can reload your page, for example.
hooks directly into vagrant up to run a full sync just after shared folders are mounted, and to begin continuous realtime monitoring once the other vagrant up tasks have completed.
In addition to significant performance improvements, the plugin also works around the lack of support for symlinks on a virtualbox shared folder - your mirror folder is a folder on the guest virtual disk like any other. It will also allow you to work around the lack of inotify events on a shared folder - either by running guard on the guest or in future by defining event handlers in your Vagrantfile.
The plugin is fully tested with rspec and (I think) reasonably well documented. Ruby's not my first language (by a long shot) but I've tried to follow conventions where I can - fgrehm's vagrant-notify plugin was very useful as an example as was the vagrant source.
Future plans include:
exposing event callbacks to the Vagrantfile to allow you to run custom actions (perhaps flushing files from opcode cache) following file events
some performance tweaks for edge cases like deleting large folder trees instantaneously
tidying up how you quit the monitoring mode (for now, just Ctrl+C twice)