The box 'centos/7' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Vagrant Cloud, 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://vagrantcloud.com/centos/7"]
Error: Recv failure: Connection was reset
这个报错原因是https://vagrantcloud.com/centos/7 这个链接地址已经无效了,从这个链接无法下载centos7了。正确的做法应该是把这个centos7下载到本地然后通过命令安装
然后执行如下命令:
1.添加 vagrant box 到 box list
vagrant box add centos7 <path>
path就是Centos7-x86....的文件路径
2. 初始化应一个虚拟机使用刚才添加的vagrant box
vagrant init centos7
温馨提示:如果你之前执行过初始化的命令,那个在执行这个命令的时候它会从去网上下载镜像,因此你需要找到 Vagrantfile 文件删除掉,然后再执行上面的命令就没问题了,安装完成后,下载的镜像文件也可以删掉了。
3.启动虚拟机
vagrant up
搞定