文档章节

本地添加vagrant box laravel/homestead

mylegendary
 mylegendary
发布于 2017/02/12 11:51
字数 1210
阅读 220
收藏 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

没有更多内容

加载失败,请刷新页面

加载更多

下一页

Java IO类库之PrintStreamWriter

* A <code>PrintStream</code> adds functionality to another output stream, * namely the ability to print representations of various data values * conveniently. Two other fea......

老韭菜
51分钟前
0
0
qduoj~前端~二次开发~笔记

青岛大学qdu的onlinejudge是js的写的前端,框架是vue.js,在nodejs上部署运行,其实整体运行还是建立在docker的容器虚拟环境里,这里暂时不需要docker。安装环境是Ubuntu14-64bit 1.安装一大...

虚拟世界的懒猫
54分钟前
6
0
ConcurrentHashMap源码解读

部分内容转自:http://jiabinyuan.xyz/#/app/archive/detail/25 内部结构 内部采用了segment结构,每一个segment相当于一个hashtable。看下面的结构图: 从图的结构我们可以了解到,Concurr...

edwardGe
59分钟前
1
0
Ubuntu终端Tab键自动补全

打开 /etc/bash.bashrc,找到下列代码,取消注释。 #enable bash completion in interactive shells#if ! shopt -oq posix; then# if [-f /usr/share/bash-completion/bash_compl......

大熊猫
今天
0
0
polipo socks5代理转http代理

天朝的网络,哎~ 装个 yarn 都时而会卡 假设在SSlocal 已经装好运行的前提下,来安装设置 polipo sudo apt-get install polipo sudo vim /etc/polipo/config 追加下列配置内容,并保存 socksP...

纯洁徐
今天
0
0

没有更多内容

加载失败,请刷新页面

加载更多

下一页

返回顶部
顶部