Search code examples
vagrantdevopsvagrantfilevagrant-windows

What is the logical/conceptual difference between .vagrant and .vagrant.d directory?


I want to know logical/conceptual difference between .vagrant and .vagrant.d directory

And also, what is the difference between the following keys

(Please observe the path of these two) one of which is placed in .vagrant directory and the other one in .vagrant.d directory in Windows 7?

C:\Users\username**.vagrant**\machines\default\virtualbox\private_key

C:\Users\username**.vagrant.d**\insecure_private_key

Could not find anywhere in the documentation and on the Internet as well. Thanks in advance.


Solution

  • .vagrant.d is usually placed in your home folder and stores system-wide data/settings, i.e. downloaded vagrant boxes.

    .vagrant is placed in your environment/project folder and stores project-specific settings, i.e. current VM settings. So if you work in user/myproject, create Vagrantfile there and exec vagrant up, then user/myproject/.vagrant directory will be created with VM specific data.

    .vagrant.d/insecure_private_key is default insecure private key to access your VMs, it's replaced by vagrant on first VM start with private_key from project's .vagrant directory. In your example: private_key for default VM started with virtualbox provider.