文档章节

本地添加vagrant box laravel/homestead

mylegendary
 mylegendary
发布于 2017/02/12 11:51
字数 1210
阅读 250
收藏 0
C:\Users\Samuel>vagrant box add laravel/homestead
==> box: Loading metadata for box 'laravel/homestead'
    box: URL: https://atlas.hashicorp.com/laravel/homestead
This box can work with multiple providers! The providers that it
can work with are listed below. Please review the list and choose
the provider you will be working with.

1) parallels
2) virtualbox
3) vmware_desktop

Enter your choice: 2
==> box: Adding box 'laravel/homestead' (v1.1.0) for provider: virtualbox
    box: Downloading: https://atlas.hashicorp.com/laravel/boxes/homestead/versions/1.1.0/providers/virtualbox.box
==> box: Box download is resuming from prior download progress
    box: Progress: 0% (Rate: 25d/s, Estimated time remaining: 0:03:25)40))
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

SSL read: error:00000000:lib(0):func(0):reason(0), errno 10054

目前laravel/homestead对应最新vagrant box版本是v1.1.0

下载地址:

https://atlas.hashicorp.com/laravel/boxes/homestead/versions/1.1.0/providers/virtualbox.box

1.下载完成后文件名为:hc-download(自定义)

执行vagrant box add命令进行安装

vagrant box add laravel/homestead F:\software\hc-download
C:\Users\Samuel>vagrant box add laravel/homestead F:\software\hc-download
==> 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:///F:/software/hc-download
    box: Progress: 100% (Rate: 7963k/s, Estimated time remaining: --:--:--)
==> box: Successfully added box 'laravel/homestead' (v0) for 'virtualbox'!

2.本地安装box 时不能指定版本号,测试结果如下:

C:\Users\Samuel>vagrant box add laravel/homestead F:\software\hc-download --box-version 1.1.0
==> box: Box file was not detected as metadata. Adding it directly...
You specified a box version constraint with a direct box file
path. Box version constraints only work with boxes from Vagrant
Cloud or a custom box host. Please remove the version constraint
and try again.

(vagrant box add <box_name> <box_path> <--box-version> <1.1.0>)

(vagrant box add box名字 box本地路径 指定版本号选项 版本号)

安装完box后,安装homestead

git clone https://github.com/laravel/homestead.git myhomestead
vagrant init
vagrant up

执行结果:

H:\myhomestead>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: >= 1.1.0
==> homestead-7: Loading metadata for box 'laravel/homestead'
    homestead-7: URL: https://atlas.hashicorp.com/laravel/homestead
==> homestead-7: Adding box 'laravel/homestead' (v1.1.0) for provider: virtualbox
    homestead-7: Downloading: https://atlas.hashicorp.com/laravel/boxes/homestead/versions/1.1.0/providers/virtualbox.box
==> homestead-7: Box download is resuming from prior download progress
    homestead-7: Progress: 0% (Rate: 0curl:/s, Estimated time remaining: --:--:--)
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

Unknown SSL protocol error in connection to atlas.hashicorp.com:443

又重新去通过url安装box。。。

若要正常启动vagrant需要修改H:\myhomestead\scripts\homestead.rb文件

18行源代码:

config.vm.box_version = settings["version"] ||= ">= 1.1.0"

修改后:

config.vm.box_version = settings["version"] ||= "0"

此时再启动vagrant,正常

H:\myhomestead>vagrant up
Bringing machine 'homestead-7' up with 'virtualbox' provider...
==> homestead-7: Importing base box 'laravel/homestead'...
==> homestead-7: Matching MAC address for NAT networking...
==> homestead-7: Setting the name of the VM: homestead-7
==> homestead-7: Clearing any previously set network interfaces...
==> homestead-7: Preparing network interfaces based on configuration...
    homestead-7: Adapter 1: nat
    homestead-7: Adapter 2: hostonly
==> homestead-7: Forwarding ports...
    homestead-7: 80 (guest) => 8000 (host) (adapter 1)
    homestead-7: 443 (guest) => 44300 (host) (adapter 1)
    homestead-7: 3306 (guest) => 33060 (host) (adapter 1)
    homestead-7: 5432 (guest) => 54320 (host) (adapter 1)
    homestead-7: 27017 (guest) => 27017 (host) (adapter 1)
    homestead-7: 22 (guest) => 2222 (host) (adapter 1)
==> homestead-7: Running 'pre-boot' VM customizations...
==> homestead-7: Booting VM...
==> homestead-7: Waiting for machine to boot. This may take a few minutes...
    homestead-7: SSH address: 127.0.0.1:2222
    homestead-7: SSH username: vagrant
    homestead-7: SSH auth method: private key
    homestead-7: Warning: Remote connection disconnect. Retrying...
    homestead-7:
    homestead-7: Vagrant insecure key detected. Vagrant will automatically replace
    homestead-7: this with a newly generated keypair for better security.
    homestead-7:
    homestead-7: Inserting generated public key within guest...
    homestead-7: Removing insecure key from the guest if it's present...
    homestead-7: Key inserted! Disconnecting and reconnecting using new SSH key...
==> homestead-7: Machine booted and ready!
==> homestead-7: Checking for guest additions in VM...
    homestead-7: The guest additions on this VM do not match the installed version of
    homestead-7: VirtualBox! In most cases this is fine, but in rare cases it can
    homestead-7: prevent things such as shared folders from working properly. If you see
    homestead-7: shared folder errors, please make sure the guest additions within the
    homestead-7: virtual machine match the version of VirtualBox you have installed on
    homestead-7: your host and reload your VM.
    homestead-7:
    homestead-7: Guest Additions Version: 5.1.10
    homestead-7: VirtualBox Version: 5.0
==> homestead-7: Setting hostname...
==> homestead-7: Configuring and enabling network interfaces...
==> homestead-7: Mounting shared folders...
    homestead-7: /vagrant => H:/myhomestead
    homestead-7: /home/vagrant/Code => H:/www
==> homestead-7: Running provisioner: file...
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: inline script
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: inline script
==> homestead-7:
==> homestead-7: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDCBV0zuqx7SVltBG5p0fbDnSG9Ojqou9pkUdTuqLDEHKcjQVOntNXiWidw6guj17kSLzyRQ/AJ2JTWJ3WRGzw53FkUTDUcWXPqXXhJ5Y
cEi0ZX1ql35HgLvFfwsvWUfEd5OxENai993+nHMXM8+iarw5SqqPPBcMzjR88jGjtVi5KJ9NKHuRFqI8PFmYEhr38RADtJRqY6hl8JKH6FUQbqYHN92lrPJUIHtta1b/fe7gZ8B6pI/1S5M2g0MXvM27g75F2YD
lzzWzfIImkKOjOOMlH97BtE8M7XXrFCpF4eqlJc4UyaPctKu5f6Ft9iVTenvvMWtDuYpOoSWW80EIZN 783935207@qq.com
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: inline script
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: C:/Users/Samuel/AppData/Local/Temp/vagrant-shell20170212-10796-1ds1bk2.sh
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Creating Site: sample.app
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Restarting Nginx
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Creating MySQL Database: homestead
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Creating Postgres Database: homestead
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Creating MySQL Database: sample
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Creating Postgres Database: sample
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Clear Variables
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: script: Update Composer
==> homestead-7: You are already using composer version 1.3.2 (stable channel).
==> homestead-7: Running provisioner: shell...
    homestead-7: Running: C:/Users/Samuel/AppData/Local/Temp/vagrant-shell20170212-10796-16p7ypy.sh

连接到虚拟机,正常

H:\myhomestead>vagrant ssh
Welcome to Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-51-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

3 packages can be updated.
0 updates are security updates.


vagrant@homestead:~$

 

© 著作权归作者所有

共有 人打赏支持
mylegendary
粉丝 0
博文 14
码字总数 2994
作品 0
静安
程序员
搭建Ubuntu PHP开发环境(使用Vagrant+Homstead+VirtualBox)

安装 virtualbox 和 vagrant 这里下载并安装 VirtualBox , Vagrant . 下载并配置 Homestead Homestead 包括以下两个东西 一个 vagrant box 虚拟机, 里面软件什么都下载好了; Github 代码库,...

xinson
2016/11/11
62
0
windows安装vagrant 以及 laravel homestead

VirtualBox 虚拟机,基础依赖 Vagrant 基于VirtualBox或vmware的虚拟化环境部署工具,可以将一个虚拟机打包(简称vbox)给别人。 Homestead laravel官方vbox,集成环境以及一套特制的命令行工具...

吾爱
2015/05/06
0
0
PHP Laravel-Homestead开发环境安装与配置

Laravel Homestead 是一个官方预载的 Vagrant「封装包」,提供你一个美好的开发环境,不需要在你的本机端安装 PHP、HHVM、网页服务器或任何服务器软件。 Homestead 可以在任何 Windows、Mac...

王永濤
2016/09/23
144
0
Homestead 无法挂载共享目录解决方案

那么不废话。 我执行 。 虚拟机启动没问题、SSH连接没问题,但是到了挂载的时候报错: 然后我装了vagrant-vbguest, 重装了homestead, vagrant甚至virtual box. 但都没什么卵用 最后我尝试了一...

zgldh
2015/10/22
434
0
使用 Docker 搭建 Laravel 本地环境

(原文地址:https://blog.tanteng.me/2017/10/docker-laravel-local-environment/) Laravel 官方提供 Homestead 和 Valet 作为本地开发环境,Homestead 是一个官方预封装的 Vagrant Box,也...

谈腾
2017/11/08
0
0

没有更多内容

加载失败,请刷新页面

加载更多

smart-doc特殊功能使用介绍

smart-doc从8月份底开始开源发布到目前为止已经迭代了几个版本。在这里非常感谢那些敢于用smart-doc去做尝试并积极提出建议的社区用户。因此决定在本博客中重要说明下smart-doc的功能,包括使...

上官胡闹
昨天
0
0
JavaEE——Junit

声明:本栏目所使用的素材都是凯哥学堂VIP学员所写,学员有权匿名,对文章有最终解释权;凯哥学堂旨在促进VIP学员互相学习的基础上公开笔记。 Junit Junit又名单元测试,Junit是用来测试Jav...

凯哥学堂
昨天
0
0
读《美丽新世界》

一、背景 十一国庆节从重庆回深圳的时候,做得绿皮车,路上看了两本书:李笑来的《韭菜的自我修养》和禁书《美丽新世界》。 上篇文章已经分享了 读《韭菜的自我修养》,这篇文章来记录一下《...

tiankonguse
昨天
0
0
archlinux下基于Jenkins,docker实现自动化部署(持续交互)

本文永久更新地址:https://my.oschina.net/bysu/blog/2250954 【若要到岸,请摇船:开源中国 不最醉不龟归】 -----------------------------------第一部分Jenkins的安装与使用-----------...

不最醉不龟归
昨天
0
0
Spark Parquet file split

在实际使用 spark + parquet 的时候, 遇到了两个不解的地方: 我们只有一个 parquet 文件(小于 hdfs block size), 但是 spark 在某个 stage 生成了4个 tasks 来处理. 4个 tasks 中只有一个 ta...

Aaaaaaaron
昨天
0
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部