在vagrant使用命令vagrant up
啟動虛擬機時
出錯:
C:\Vagrant>vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Box 'base' could not be found. Attempting to find and install... default: Box Provider: virtualbox default: Box Version: >= 0 ==> default: Box file was not detected as metadata. Adding it directly... ==> default: Adding box 'base' (v0) for provider: virtualbox default: Downloading: base default: An error occurred while downloading the remote file. The error message, if any, is reproduced below. Please fix this error and try again. Couldn't open file /E:/WorkSpace/Vagrant/base
原因分析:
在使用vagrant init
命令初始化配置文件的時候未指定虛擬機名稱
,也就是命令:vagrant box add BoxName
boxpath中的BoxName。
解決辦法:
1.再來一遍,重新生成Vagrantfile
配置文件
vagrant init BoxName
2.修改Vagrantfile
文件中config.vm.box
參數:
config.vm.box = "base"
將base修改為你的虛擬機名稱。
參考:官方鏈接