Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vagrant file resync: Vagrant Box does not update new content in text editor

I don't know real detailed specifics about vagrant settings but after I tried to resync my box when it started up. The vagrant box won't update the content I changed from my text editor to the box after the box is booted and before it is stopped and rebooted again. The command I used is below:

config.vm.synced_folder ".", "/vagrant", type: "rsync"

I needed to resync because my rails server is running slowly on my machine locally. I was wondering:

1) Is this the behavior expected?

2) Are there other options to speed up my rails server so it doesn't take 1 second for every javascript file to load?

like image 671
applecrusher Avatar asked Jun 26 '15 22:06

applecrusher


2 Answers

With your configuration you'll need:

$ vagrant up
$ vagrant rsync-auto

And at other terminal you can do:

$ vagrant ssh

And your app folder must be updated on virtual machine when you change at your develop environment.

But, I config my sync folders with Vagrant basic usage, it means without type option (let vagrant chose the best type, also it keeps sync):

config.vm.synced_folder ".", "/vagrant"

And I use one terminal for vagrant stuff, with only these commands:

$ vagrant up
$ vagrant ssh

Answer 1) If you need use rsync, yes this is the behavior expected: folders will not been updated unless you start vagrant rsync-auto (I've tested this option)

Answer 2) You must expect a degradation on performance running a virtual machine, because you had limited some memory and cpu processors (unless you are running on Windows OS -I don't test it-).

like image 145
Alejandro Babio Avatar answered Oct 03 '22 02:10

Alejandro Babio


Please make sure:

  1. rsync.exe on the path
  2. The rsync or rsync-auto command is used to start vagrant, Without running these commands, Vagrant only syncs the folders on vagrant up or vagrant reload
like image 37
Liping Huang Avatar answered Oct 03 '22 00:10

Liping Huang