【vagrant】第一次安装添加box报错:The box failed to unpackage properly....
报错信息
The box failed to unpackage properly. Please verify that the box file you're trying to add is not corrupted and that enough disk space is available and then try again. The output from attempting to unpackage (if any): x ./box.ovf x ./Vagrantfile x ./box-disk001.vmdk: Write failed bsdtar.EXE: Error exit delayed from previous errors.
原因
使用vagrant up启动虚拟机的时候,打包的虚拟机会保存在.vagrant.d/boxes目录下,这个文件夹默认是存放在系统盘上的C:/Users/{用户名}目录下的,如果box文件非常多的话,会造成空间不够。
解决
解决方案:把这个目录移到其它盘
1、将.vagrant.d文件夹剪切到别的盘,比如d:/software/vagrant/.vagrant.d
2、设置环境变量VAGRANT_HOME为d:/software/vagrant/.vagrant.d
3、在path环境变量下添加%VAGRANT_HOME%
=======================================
由于本人水平有限,文章在表述和代码方面如有不妥之处,欢迎批评指正。留下你的脚印,欢迎评论哦。你也可以关注我,一起学习哦!