Vagrant rsync new folders after the up command

192 views
Skip to first unread message

Chandu

unread,
Mar 14, 2015, 1:09:31 PM3/14/15
to vagra...@googlegroups.com
Hi, 
I am using rsync to sync files from my windows host to ubuntu guest.
Right now when I vagrant up my ubuntu machine as per the config in vagrant file folder A is synced.

What I would like to do is after my ubuntu guest is up, I would like to add new folders for rsync in my Vagrantfile and be able to get them synced.

I tried using vagrant rsync after I edited my vagrant file but it is not picking new folders.

Is it possible to add new folders and get them synced?

Alvaro Miranda Aguilera

unread,
Mar 15, 2015, 12:03:43 AM3/15/15
to vagra...@googlegroups.com
Can you paste your vagrantfile ?

and a sample of the directory?

if you are adding subdirectories in the shared folder, vagrant rsync
should do the trick

http://docs.vagrantup.com/v2/synced-folders/rsync.html

if are new synced folder, then vagrant reload ?? you can try `vagrant
rsync` first
> --
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vagrant-up+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Chandu

unread,
Mar 15, 2015, 12:41:13 PM3/15/15
to vagra...@googlegroups.com
Thanks Alvaro.
I am using reload now.
I was thinking if there is any alternative (like vagrant provision) instead of reloading the VM.
-
Chandu

You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/HOXfKKtDgx0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.

Alvaro Miranda Aguilera

unread,
Mar 15, 2015, 5:35:31 PM3/15/15
to vagra...@googlegroups.com
vagrant rsync

it's a subcommand

What's the output when you write vagrant rsync ??

Justin Beaty

unread,
Jun 24, 2015, 10:10:59 AM6/24/15
to vagra...@googlegroups.com
Hey Chandu,

I know this is late, but I was just browsing some old posts in this group.

I faced the same problem so I created a new vagrant plugin. Install it by running:

    vagrant plugin install vagrant-force-rsync

Then, include this provisioner anywhere in the vagrantfile that you want to sync. I usually put it after any host-shell provisioners.

    config.vm.provision "force-rsync"

Please note that it is VERY limited and only syncs the root host folder to /vagrant on the guest with the default rsync options. I am not very good at interfacing with Vagrant's objects in Ruby, so it is pretty hacky. You would be able to modify the source if you need to sync some other folders though.
Reply all
Reply to author
Forward
0 new messages