Skip to content
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 it possible to define the folder for storing the virtual maschines / harddrives #3532

Closed
kaystrobach opened this issue Apr 24, 2014 · 12 comments

Comments

@kaystrobach
Copy link

it would be nice, if there would be an option to move the virtualbox/vmware config/ disks which are currently stored in ~/Virtualbox VMs into the .vagrant folder of the VM.

This way it would be easier to move / copy the VM from one harddrive/pc/mac to another
And it would also be easier to control where the VM Data is stored.

PS: I know #1247, but that does not fix that with Multiplattform in mind 😠

@mitchellh
Copy link
Contributor

This is configured from VirtualBox itself. Vagrnat doesn't even choose where the VMs go.

@kaystrobach
Copy link
Author

i know, and i'd like to change that, so that the vm disks are always in .vagrant - is there a chance to do that?

@mitchellh
Copy link
Contributor

If you're interested, please do submit a PR and I'd love to take a look. At the moment this isn't a priority. Thanks!

@davidkarlsen
Copy link

I have been fighting this as well (in CI env / Jenkins).
Ended up doing:
export VAGRANT_HOME=$WORKSPACE/.vagrant.d
export VBOX_USER_HOME=$WORKSPACE/.vbox
VBoxManage setproperty machinefolder $VBOX_USER_HOME/machinefolder

to achive this.

Would be cool if vagrant could fix it - but I see that it's not priority and accept that fact - just my 2 cents.

@mitchellh
Copy link
Contributor

yeah I've tried to tackle this before but I think the fact that the machine folder was global was a dealbreaker. VMware ,for example, lets you do it per-VM very easily. With VirtualBox it is POSSIBLE, but tricky.

@kaystrobach
Copy link
Author

just keep in the roadmap 😄
I also have the VMWare License, so if this is a starting point i would be fine with that as well.

@mitchellh
Copy link
Contributor

@kaystrobach VMware doesn't have this problem. You can set: VAGRANT_VMWARE_CLONE_DIRECTORY. See: http://docs.vagrantup.com/v2/vmware/configuration.html

@kikitux
Copy link
Contributor

kikitux commented Apr 25, 2014

@mitchellh question.

in plugins/providers/virtualbox/driver/version_4_3.rb

today you do --dry-run, get all the information, and just modify the name from the default to the specified on vagrantfile, or based on the path.. you get what I mean.

On this piece of code:

disks = output.scan (/(\d+): Hard disk image: source image=.+, target path=(.+),/)

I think is where we can replace the path in disks variable

in my windows, an output is:

8 C:\Users\alvarom\VirtualBox VMs\packer-vagrant-oracle7\packer-vagrant-oracle7-disk1.vmdk

then, in a .each, just the machine name is replaced with:

disk_params << path.sub("/#{suggested_name}/", "/#{specified_name}/")

My ruby-fu is very low, so I can't suggest a working approach..

But i did a test, and I was able to use this to override the path to Z:\here

@kikitux
Copy link
Contributor

kikitux commented Apr 28, 2014

@mitchellh ping..

@vmmello
Copy link

vmmello commented Dec 22, 2016

This is a bit an unrelated question, but it's not very far from what is being asked here...

Is it safe for directory $VAGRANT_HOME/boxes/ to be a symlink to an external directory, e.g. /mount_point_with_more_space/vagrant/boxes?

@aateeque
Copy link

Did this ever get picked up?

@ghost
Copy link

ghost commented Mar 28, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants