使用Homestead下载的盒子文件

时间:2017-06-13 16:47:39

标签: vagrant homestead

我正在尝试安装laravel / homestead并按照https://laravel.com/docs/5.4/homestead中描述的步骤进行操作。

在这样做的过程中,我在“第一步”中添加一个框时遇到了问题,因此我必须从外部下载虚拟框文件并使用该文件添加框:

$ vagrant box list
There are no installed boxes! Use `vagrant box add` to add some.
$ vagrant box add laravel/homestead virtualbox/homestead.box 
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'laravel/homestead' (v0) for provider:
    box: Unpacking necessary files from: file://D:/Code/virtualbox/homestead.box
    box:
==> box: Successfully added box 'laravel/homestead' (v0) for 'virtualbox'!

$ git clone https://github.com/laravel/homestead.git Homestead
Cloning into 'Homestead'...
...
$ cd Homestead ; git checkout v5.4.0
Note: checking out 'v5.4.0'.
$ bash init.sh
Homestead initialized!

我的麻烦在于vagrant up,它仍在尝试下载和失败。如何告诉vagrant不再下载盒子文件并使用现有的盒子?

$ vagrant up
Bringing machine 'homestead-7' up with 'virtualbox' provider...
==> homestead-7: Box 'laravel/homestead' could not be found. Attempting to 
    find and install...
    homestead-7: Box Provider: virtualbox
    homestead-7: Box Version: >= 2.0.0
==> homestead-7: Loading metadata for box 'laravel/homestead'
    homestead-7: URL: https://atlas.hashicorp.com/laravel/homestead
==> homestead-7: Adding box 'laravel/homestead' (v2.1.0) for provider: 
    virtualbox
    homestead-7: Downloading: https://atlas.hashicorp.com/laravel/boxes/homestead/versions/2.1.0/providers/virtualbox.box

我已尝试在第一步命名我的盒子到宅基地7,但没有运气。关于vagrant up的后续处决,流浪者声称要从之前的下载中恢复,但进展并不是这样。

1 个答案:

答案 0 :(得分:2)

下面

Successfully added box 'laravel/homestead' (v0) for 'virtualbox'!

您已安装了laravel/homestead框的版本0。在您的宅基地版本中,它需要version大于2.0.0。

如果您想使用该版本的盒子,可以在json文件中添加version参数。

{
    "version": "0",
    "ip": "192.168.10.10",
    "memory": 2048,
    "cpus": 1,
    "provider": "virtualbox",
    ...
}