Skip to content

Configuration Using Rsync Instead of NFS

rgeleta edited this page Dec 24, 2014 · 1 revision

NFS is stable and works well for mounting your virtual Kalastack drive on your host machine, but some people may experience problems with it. If you...

  • have consistent stability issues (NFS refuses to work, particularly if you're running OS 10.9+)
  • experience degraded performance in your virtual environment

...you may want to try using Rsync instead of NFS.

To do so, follow these instructions:

  1. Edit the Kalastack Vagrantfile (for Kalabox users, this should be at $HOME/.kalabox/kalastack/Vagrantfile) to change the line...

config.vm.synced_folder Dir.home + conf["synced_www_folder"]["host_path"], conf["synced_www_folder"]["guest_path"], :create => conf["synced_www_folder"]["create"], :nfs => conf["synced_www_folder"]["nfs"], :nfs_version => conf["synced_www_folder"]["nfs_version"]

to

config.vm.synced_folder Dir.home + conf["synced_www_folder"]["host_path"] + "/", conf["synced_www_folder"]["guest_path"], :create => conf["synced_www_folder"]["create"], type: "rsync", rsync__args: ["-a"]

  1. Make sure your virtual environment is halted, then run "vagrant up" (or simply restart Kalabox).

  2. In the kalastack directory, run "vagrant rsync-auto". This will sync any changes you make on your host machine over to your virtual.

Warnings

  • It may take a couple seconds for changes made on your host machine to be transferred to your virtual Kalastack environment.
  • Changes made on the virtual machine will not be synced back to the host machine.
  • Occasionally the "vagrant rsync-auto" command will fail and need to be restarted; leave it running in the terminal window, and if you're having problems, try stopping it (ctrl+c) and re-running the command.