Reputation: 15
I setx VAGRANT_CWD to some directory (let's say it's /dir) and now vagrant isn't working properly. I have a Vagrantfile in that directory /dir, and after running that VM I try to create another one in another directory by running the following code:
mkdir machine1
cd machine1
vagrant init ubuntu/trusty64
However, it seems like VAGRANT_CWD refers again to /dir instead of /dir/machine1 because it gives the following error:
`Vagrantfile` already exists in this directory. Remove it before running `vagrant init`.
Therefore, I think I need to set VAGRANT_CWD to its default value. What is this value and how do I set it?
Upvotes: 1
Views: 775
Reputation: 53793
you should unset the variable :
unset VAGRANT_CWD
so that vagrant will use the current directory (machine1
) to create the new VM.
By default, Vagrant uses the current directory you are in, so if you just want to have the vagrant files created within the current directory you should not set at all the variable
Upvotes: 1