低版本vagrant在下载远程box时报错
2020-05-24 本文已影响0人
ggcoder
问题:The box 'generic/centos7' could not be found or could not be accessed in the remote catalog
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'generic/centos7' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
The box 'generic/centos7' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Atlas, please verify you're logged in via
`vagrant login`. Also, please double-check the name. The expanded
URL and error message are shown below:
URL: ["https://atlas.hashicorp.com/generic/centos7"]
Error: The requested URL returned error: 404 Not Found
错误
问题原因:vagrant版本过低(我的是1.7.2),官方已经更换了地址,升级vagrant到2.x或者在Vgrantfile中配置下载地址
1)升级可重新安装
2)修改配置:在Vagrantfile中添加Vagrant::DEFAULT_SERVER_URL.replace('https://vagrantcloud.com')
即可
然后执行vagrant up
,OK!
国内可用box源:
http://mirrors.ustc.edu.cn/centos-cloud/centos/6/vagrant/x86_64/images/