vagrant up报错 * The box 'tBox' could not be found


Mac(10.9.2)下安装Vagrant。

Vagrant version:  1.3.5

VirtualBox version: 4.3.10

Box: vagrant-centos-5.10-x86_64.box

安装完毕之后,vagrant up报错了。。。

localhost:dev angel$ vagrant up

Bringing machine 'default' up with 'virtualbox' provider...

There are errors in the configuration of this machine. Please fix

the following errors and try again:

vm:

* The box 'tBox' could not be found.

tBox找不到。。。。

用如下命令查找目前添加的所有镜像。

vagrant box list

显示如下:

localhost:dev angel$ vagrant box list

tBox        (vmware_fusion)

发现了什么, vmware_fusion,奇怪,明明我安装的时virtualbox ????
ok, 按默认方式重新增加一个镜像。

localhost:dev angel$ vagrant box add centos-5.10 ~/Downloads/vagrant-centos-5.10-x86_64.box

Downloading or copying the box...

Extracting box...te: 209M/s, Estimated time remaining: 0:00:01)

Successfully added box 'centos-5.10' with provider 'vmware_fusion'!

看到没有,Successfully added box ‘centos-5.10' with prover 'vmware _fusion',   增加镜像,默认provider(不知道怎么称呼)是”vmware_fusion“。

ok,既然发现了问题。解决的思路也有了。

重新增加一个镜像,指定provider。如下。


localhost:dev angel$ vagrant box add --provider virtualbox centos-5.10-virtualbox ~/Downloads/vagrant-centos-5.10-x86_64.box

Downloading or copying the box...

Extracting box...te: 199M/s, Estimated time remaining: --:--:--)

The box you attempted to add doesn't match the provider you specified.

Provider expected: virtualbox

Provider of box: vmware_fusion

MyGod, 看到没有 期望的Provider是virtualbox,而目前的使用的box是给vmware_fusion使用的。看来是下错文件。

到官方box镜像网站去重新下载Provider是virtuabox的box镜像。

下载之后重新添加box.

localhost:dev angel$ vagrant box add centos-virtualbox ~/Downloads/CentOS-56-x64-packages-puppet-2.6.10-chef-0.10.6.box

Downloading or copying the box...

Extracting box...te: 208M/s, Estimated time remaining: --:--:--)

Successfully added box 'centos-virtualbox' with provider 'virtualbox'!

vagrant up启动成功。

localhost:dev angel$ vagrant  up

Bringing machine 'default' up with 'virtualbox' provider...

[default] Importing base box 'centos-virtualbox'...

[default] Matching MAC address for NAT networking...

[default] Setting the name of the VM...

[default] Clearing any previously set forwarded ports...

[default] Creating shared folders metadata...

[default] Clearing any previously set network interfaces...

[default] Preparing network interfaces based on configuration...

[default] Forwarding ports...

[default] -- 22 => 2222 (adapter 1)

[default] Booting VM...

[default] Waiting for machine to boot. This may take a few minutes...

[default] Machine booted and ready!

[default] The guest additions on this VM do not match the installed version of

VirtualBox! In most cases this is fine, but in rare cases it can

cause things such as shared folders to not work properly. If you see

shared folder errors, please update the guest additions within the

virtual machine and reload your VM.

 

Guest Additions Version: 4.2.0

VirtualBox Version: 4.3

[default] Mounting shared folders...

[default] -- /vagrant

总结:虚拟机和镜像文件是有对应关系的。下载镜像文件需要注意下。

相关内容

    暂无相关文章