-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make .vagrant tree host-specific #3362
Comments
I can see the utility, but it is also quite easy to set a different If this is an ongoing pain point for many more people. I'll look into it further. But since there is a viable workaround, it is fairly low priority. |
I didn't know VAGRANT_DOTFILE_PATH exists. That's certainly a practical solution. I searched the Issues list for "Dropbox" but didn't find anything relevant. Searching for "VAGRANT_DOTFILE_PATH" did land me on issues discussing the Dropbox scenario, though. Do you want me to add it to the docs? Not currently included: http://docs.vagrantup.com/v2/other/environmental-variables.html FYI-For other uses with the same problem who stumble upon this issue, here's what I did: (on my laptop -- Ubuntu 13.10)
When I get home, I am going to either leave my desktop with the default, or change it to .vagrant-desktop. |
This is awesome! That has been a big pain point for me when working with vagrant on different machines (work/home/laptop) and syncing with dropbox. Thanks! |
Thank you! Thank you! Thank you! |
How do you set this for Windows? |
Can you explain how to manage and configure VAGRANT_DOTFILE_PATH on Windows host? |
Glad I read this issue. I have been developing with vagrant on my desktop and laptop separately over the last few weeks, and it became a headache trying to keep files synced. My case is a bit different in that I have multiple VMs for different purposes, each generated with its own Vagrantfile. Would I have to have a .bashrc file in each directory to isolate each VAGRANT_DOTFILE_PATH file? |
I keep my local repos in a Dropbox folder so I can switch between my desktop and laptop seamlessly and still have the current state of everything be synced, including changes that haven't been committed yet. The problem is the .vagrant tree is not host-specific, so when I've brought vagrant up on one host, then do the same on a second host, the second host overwrites the .vagrant/machines/[name]/virtualbox/id file which breaks the original host.
I did find a blog post describing the problem and a solution:
http://www.binaryphile.com/vagrant/sharing-vagrant-project-files-over-dropbox/
It's a little outdated (there's no more Virtualbox.xml anymore), but was still useful enough to help me understand the problem. However, the described solution (manually changing the UUID on the second host to match the first) is very brittle.
I propose adding an additional directory layer to the .vagrant tree to include the host name, so the same tree can support different VM UUIDs on different hosts off the same Vagrantfile. In order words, this:
.vagrant/machines/[name]/virtualbox/id
Would instead become one of the following (take your pick):
The last option has the merit of not adding another level of directory structure.
The text was updated successfully, but these errors were encountered: