Vagrant box保存路径修改

vagrant add box时默认保存在目录~/.vagrant.d. 可以通过设置VAGRANT_HOME环境变量改变默认位置.

VAGRANT_HOME can be set to change the directory where Vagrant stores global state. By default, this is set to ~/.vagrant.d. The Vagrant home directory is where things such as boxes are stored, so it can actually become quite large on disk.

  • Windows:

    用户变量

    setx VAGRANT_HOME"X:/your/path"

    系统变量

    setx VAGRANT_HOME"X:/your/path"/M
  • Linux

    export VAGRANT_HOME='/path/to/vagrant_home'