I have ubuntu virtual machine that I'm accessing through Vagrant. On my host (Mac OSX), there is a folder with couple of files, that I share to virtual machine. In that virtual machine, I want to use guard to watch for files changes and perform some action if any of those files changes.
I set up guard properly, and when changing shared file from within virtual machine, it works ok and runs appropriate scripts. But, if I try to change shared file from my host machine, this file change event doesn't propagate and guard doesn't react.
This is how my vagrant shared folder looks like (pretty usual stuff)
local_config.vm.share_folder "app", "/var/www/app/current", "../app"
I even tried using NFS sharing (
:nfs => true) but it didn't help.
Is there any way to make file changes events propagate from host to virtual machine? Or is this something of Vagrant/VirtualBox nature?
After some more trials, I installed ZenTest gem, which contains autotest tool allowing similar functionality regarding file change events.
When running autotest in virtual machine and changing files from my host machine, these changes are propagated and autotest reacts.
Based on this, it seems that the file change event propagation is an issue of guard, not vagrant or virtual box.
I haven't look into implementation differences between guard and autotest though.
Now I know it is possible to catch file change events from host in virtual machine. Does anyone have any idea on how to achieve this using guard? I like guard more because of its DSL and generic usability.