Vagrant duplicate vbox files in certain conditions

94 views
Skip to first unread message

Fredrik Krokstad

unread,
Aug 2, 2014, 11:23:28 AM8/2/14
to vagra...@googlegroups.com
Hello!

I have run into an issue that I find to be quite strange. I'm using the Laravel/Homestead-box with Virtual Box on Max OSX 10.9.4. When I run "vagrant up", it says that the base box 'laravel/homestead' is being imported. When I look in ~/VirtualBox VMs, I can see that a new folder containing the virtual machine files was created. Here's an example of how the folders are named: Homestead_default_1406991834006_43929.

Come a new day and I go to my terminal and do "vagrant up" again. Once again it says that the base box is being imported and, surely enough, looking in the VirtualBox VM's folder again reveals another Homestead_default_<timestamp>_<unknown_digits>-folder. The folders I have set up to sync are, of course, synced, but the MySQL databases inside the VM are empty.

This seems to happen every day. Checking my VM-folder now, there are 9 different folders in there totaling about 20GB! The same behavior is being displayed across three different macs, all running OS X 10.9.4 and using the laravel/homestead box.

I dont know if it is significant, but the laravel/homestead configuration-files (cloned from a git-repo) are stored in my Dropbox-folder and I'm using this configuration across several of my Macs.

Can someone please shed some light on what's going on here?
Thanks!

Alvaro Miranda Aguilera

unread,
Aug 3, 2014, 4:38:00 PM8/3/14
to vagra...@googlegroups.com
hello

when you do vagrant up, it create a folder in the directory you are doing the vagrant up

like .vagrant/

what could be happening is, each other host, try to find the id of the vm as a local one, can't find it, create a new one, and update this information

you go to a new host, and repeat

what you could do, is put the folder that will hold folder/vagrantfile locally

and setup a shared folder to mount that dropbox folder in the vm

that will work

Alvaro.


--
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.

Fredrik Krokstad

unread,
Aug 3, 2014, 4:57:34 PM8/3/14
to vagra...@googlegroups.com
Hi and thanks for you feedback, Alvaro!

I am doing "vagrant up" from the folder in which the config-files for that box resides. This is a folder named "Homestead" and is a cloned git-repository (the one Laravel-devs are told to use for Homestead). This folder contains, among other things: Vagrantfile and Homestead.yaml (the config-file for the box). When I do "vagrant up", the vm-files are created elsewhere, specifically ~/VirtualBox VMs/, that is, in my home folder, so the actual vm-files are not synced via Dropbox. The homestead-folder with the Vagrantifile, on the other hand, is located within my Dropbox-folder.

So you what you are saying is that storing the Vagrantfile outside of Dropbox will fix my problem?

I guess I could try that and I'll report my findings here. Thanks!

Alvaro Miranda Aguilera

unread,
Aug 3, 2014, 5:37:55 PM8/3/14
to vagra...@googlegroups.com
on this folder, when you do vagrant up a new folder is created

.vagrant

and this one is the file that get the id of the VM created

.vagrant/machines/default/virtualbox/id 

so as long the folder where you do vagrant up is local to each machine, you are good to go

in my case i have a folder in dropbox for each host



Fredrik Krokstad

unread,
Aug 3, 2014, 5:42:06 PM8/3/14
to vagra...@googlegroups.com
Ah yes, that makes sense. I didn't know where the problem was, if it was with the box, with vagrant or something I did, so I didn't really know where to look. 

I've put the Homestead-folder into my ~ folder, so it will be local for each of my macs. I've set it to mount a folder which is in my Dropbox, so my dev-files are synced. Hopefully this will get rid of the problem :c)

Thank you so much for your help! :c)

Alvaro Miranda Aguilera

unread,
Aug 3, 2014, 5:55:54 PM8/3/14
to vagra...@googlegroups.com
Hello

this will work, just one clarification

you can have everything on dropbox, as long each host have his own folder

:)

in my case I have OSX, Windows and Linux with Dropbox, so I have each of m machines like this

Dropbox/vagrant_mini
Dropbox/vagrant_laptop
etc

so I can do whatever change I want, or check/review twhatever I want from any box


Alvaro.


Fredrik Krokstad

unread,
Aug 3, 2014, 5:57:04 PM8/3/14
to vagra...@googlegroups.com
Got it! Thanks :c)
Reply all
Reply to author
Forward
0 new messages