The folder where I have Vagrantfile is being auto-generated during the build, so it gets cleaned up, but I'd like to still be able to use the created machines. The easiest way would be to put .vagrant folder somewhere outside the auto-generated folder. Is this possible?
You have (at least) two options:
Use VAGRANT_DOTFILE_PATH
to set the the location where the project specific data is stored (defaults to .vagrant
as you already know). Note that the path has to be project/Vagrantfile specific.
cd
to a directory where you want the .vagrant
directory to be created, and use VAGRANT_VAGRANTFILE
to specify the path to the generated Vagrantfile.