将 vagrant box 下载到不同的驱动器 [英] Download vagrant box to different drive
问题描述
我在安装过程中选择了 D:\ 驱动器,但是当我下载一个 vagrant box 时,它会下载到我在 C:\ 驱动器上的用户目录.我正在使用几乎没有任何可用空间的 SSD.如何让它下载盒子到另一个驱动器?
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?
推荐答案
您可以使用 VAGRANT_HOME 环境变量 更改 vagrant config/box 下载目录.
You can use the VAGRANT_HOME environment variable to change the vagrant config / box download directory.
在 Windows 上,您应该能够使用 setx
命令来更改它,例如:
On Windows you should be able to use the setx
command to change it, for example:
setx VAGRANT_HOME "D:/vagrant"
但是,我发现了一个类似的堆栈溢出问题,其中用户暗示环境变量并不总是有效,并且 更改在 vagrant 中找到的
为他们工作.@home_path
\embedded\gems\gems\vagrant-1.xxdev\lib\vagrant\environment.rb
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.
这篇关于将 vagrant box 下载到不同的驱动器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!