Search code examples
vagrant

Download vagrant box to different drive


I chose the D:\ drive during installation but when I download a vagrant box it downloads to my user directory on C:\ drive. I am using a SSD with hardly any available space. How do I make it download boxes to another drive?


Solution

  • You can use the VAGRANT_HOME environment variable to change the vagrant config / box download directory.

    On Windows you should be able to use the setx command to change it, for example:

    setx VAGRANT_HOME "D:/vagrant"

    However, I found a similar stack overflow question where users are suggesting that the environment variable doesn't always work and that changing the @home_path found in vagrant\embedded\gems\gems\vagrant-1.x.x.dev\lib\vagrant\environment.rb worked for them.