下面先总结遇到的问题,这些问题如果你也遇到,可能需要搜索很多次才能找到原因。

如果想看安装过程,可以先直接跳到后面第二部分部分。

1 问题汇总:

1.1 vagrant版本过高问题。

vagrant 1.8.7版本存在问题。可以搜索:"vagrant 1.8.7 cant download box"

https://github.com/mitchellh/vagrant/issues/6725 也上有人提到。

 /opt/vagrant/bin/vagrant -v
Vagrant 1.8.

vagrant box add centos /Users/user/box/src/centos65-x86_64-.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'centos' (v0) for provider:
box: Unpacking necessary files from: file:///Users/user/box/src/centos65-x86_64-20140116.box
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

而且后面并没有列出具体的原因。要查看原因,即使开启debug。

VAGRANT_LOG=debug vagrant box add --name centos65-x86  /Users/user/box/src/centos65-x86_64-.box --checksum-type sha256 --checksum 84eda9c4f00c86b62509d1007d4f1cf16b86bccb3795659cb56d1ea0007c3adc --provider Virtualbox

# ...
DEBUG subprocess: stderr: dyld: Library not loaded: @rpath/libcurl..dylib
Referenced from: /opt/vagrant/embedded/bin/curl
Reason: Incompatible library version: curl requires version 9.0. or later, but libcurl..dylib provides version 7.0.
DEBUG subprocess: Waiting for process to exit. Remaining to timeout:
DEBUG subprocess: Exit status:
WARN downloader: Downloader exit code:
ERROR downloader: Exit code:
# ...

其中部分输出如上,提示/opt/vagrant/embedded/bin/curl的版本问题:

curl requires version 9.0.0

解决办法

网上大多提示1.8.7版本确实有如下问题,建议重新安装1.8.6.

  • 重新安装Vagrant 1.8.6

  • 使用你系统的curl代替Vagrant curl

sudo ln -nsf /usr/bin/curl /opt/vagrant/embedded/bin/curl

实际上第二步不是必须的。

1.2 vagrant版本过低问题。

vagrant 1.8.1版本存在的问题。这个问题来自与virtulbox的版本配合上面。

 /opt/vagrant/bin/vagrant -v
# Vagrant 1.8.

/opt/vagrant/embedded/bin/curl --version
# curl 7.45. (x86_64-apple-darwin12.6.0) libcurl/7.45. OpenSSL/1.0.2d zlib/1.2.

ls -trl ~/.vagrant.d/boxes/
# blank

VAGRANT_LOG=debug vagrant box add --name centos65-x86 /Users/user/box/src/centos65-x86_64-.box
# Successfully added box 'centos65-x86' (v0) for 'virtualbox'!

vagrant box list
# centos65-x86 (virtualbox, )

cd /Users/user/box/baseVM/

vagrant init centos65-x86
# A `Vagrantfile` has been placed in this directory. You are now
# ready to `vagrant up` your first virtual environment! Please read
# the comments in the Vagrantfile as well as documentation on
# `vagrantup.com` for more information on using Vagrant.

vagrant up
# ==> Provider 'virtualbox' not found. We'll automatically install it now...
# ==> Downloading VirtualBox 5.0....

从上面可见,1.8.1版本并不能识别到VirtualBox 版本 5.1.10 r112026 (Qt5.6.2)

下面是网上说明;

http://stackoverflow.com/questions/38378418/vagrant-virtualbox-provider-virtualbox-not-found-well-automatically-instal

Vagrant 1.8.4 and older are not compatible with the VirtualBox 5.1.x.
Vagrant 1.8.5 has been released already and it supports the VirtualBox 5.1.x.
 
因此为了配合最新的vb。需要使用vagrant 1.8.5 ~ 1.8.6版本。

1.3 vagrant box下载失败

默认的下载地址:http://www.vagrantbox.es/

下载不太稳定,下了好多次都中途失败。提示"失败 - 已被禁止"。原本是要使用CentOS 6.4 x86_64版本的。结果总下载不了。最后使用了这个版本。

https://github.com/2creatives/vagrant-centos/releases

centos65-x86_64-20140116.box

网页上该文件的检验码::

SHA256(centos65-x86_64-20140116.box)= 84eda9c4f00c86b62509d1007d4f1cf16b86bccb3795659cb56d1ea0007c3adc

check it:

 shasum -a256 centos65-x86_64-.box
84eda9c4f00c86b62509d1007d4f1cf16b86bccb3795659cb56d1ea0007c3adc centos65-x86_64-.box

md5 centos65-x86_64-.box
MD5 (centos65-x86_64-.box) = c6518b158f7babd09dcccc30eb3d9333

为了方便大家下载。我在网盘上放了一个文件,大家可以使用上面的信息自行校验,我也没有水平在这个镜像中装后门,呵呵。

2 源文件

经过几轮折腾。确定了各版本。

  • 本机系统:OS X 10.11.3

  • virtualBox: VirtualBox-5.1.10-112026-OSX.dmg

  • vagrant_1.8.6.dmg

  • box: centos65-x86_64-20140116.box

3 安装vb和vagrant

分别手动安装virtualBox和vagrant。安装后

vb下载地址:https://www.virtualbox.org/wiki/Downloads

vagrant地址:https://www.vagrantup.com/downloads.html

vagrant历史版本:https://releases.hashicorp.com/vagrant/

vagrant box: http://www.vagrantbox.es/

安装后检查:

 /opt/vagrant/bin/vagrant -v
# Vagrant 1.8.

/opt/vagrant/embedded/bin/curl --version
# curl 7.45. (x86_64-apple-darwin13.4.0) libcurl/7.45. OpenSSL/1.0.2e zlib/1.2.

ls -trl ~/.vagrant.d/boxes/
# blank

 VAGRANT_LOG=debug vagrant box add --name centos65-x86  /Users/user/box/src/centos65-x86_64-.box
# ==> box: Successfully added box 'centos65-x86' (v0) for 'virtualbox'!

ls ~/.vagrant.d/boxes/centos65-x86//virtualbox/
total
-rw-r--r-- user staff : metadata.json
-rw------- user staff : box.ovf
-rw------- user staff : box-disk2.vmdk
-rw------- user staff : box-disk1.vmdk
-rw-r--r-- user staff : Vagrantfile

vagrant box list
# centos65-x86 (virtualbox, )

cd /Users/user/box/baseVM/

vagrant init centos65-x86
#A Vagrantfile has been placed in this directory. You are now
#ready to vagrant up your first virtual environment! Please read
#the comments in the Vagrantfile as well as documentation on
#vagrantup.com for more information on using Vagrant.

ls -l
#total
#-rw-r--r-- user staff : Vagrantfile
 
启动:
 vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'centos65-x86'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: baseVM_default_1480320850854_85192
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter : nat
==> default: Forwarding ports...
default: (guest) => (host) (adapter )
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:
default: SSH username: vagrant
default: SSH auth method: private key
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: The guest additions on this VM do not match the installed version of
default: VirtualBox! In most cases this is fine, but in rare cases it can
default: prevent things such as shared folders from working properly. If you see
default: shared folder errors, please make sure the guest additions within the
default: virtual machine match the version of VirtualBox you have installed on
default: your host and reload your VM.
default:
default: Guest Additions Version: 4.3.
default: VirtualBox Version: 5.1
==> default: Mounting shared folders...
default: /vagrant => /Users/user/box/baseVM

检查进程

 ps axu | grep -i virtual
# ...

从上面可以看到登陆信息:

  • 127.0.0.1:2222

  • default: SSH username: vagrant

  • 用户名与密码均是: vagrant

但登陆并不需要输入用户名或机器及端口。

登陆:

 vagrant ssh​
[vagrant@vagrant-centos65 ~]$ pwd
/home/vagrant

ls -l /vagrant/
total
-rw-r--r-- vagrant vagrant Nov : Vagrantfile

至此成功进入vagrant虚机。

就在写这篇文章时,发现1.9.0已经出来了。可以试下最新版本了,应该修复了1.8.7的问题。

vagrant 1.8.6 安装过程及总结遇到的坑的更多相关文章

  1. vue 安装教程(自己安装过程及遇到的一些坑)

    1.安装node.js(http://www.runoob.com/nodejs/nodejs-install-setup.html) 2.基于node.js,利用淘宝npm镜像安装相关依赖 在cmd ...

  2. Rabbimq 安装过程,还有踩得坑!centos 安装

    一 .安装erlang 1 添加yum 源,在/etc/yum.repos.d 下添加 rabbitmq-erlang.repo,内容如下 # In /etc/yum.repos.d/rabbitmq ...

  3. Anaconda2+Theano 安装过程中的所有的坑。。。

    写在前面的废话 上次搞theano安装还是一年多以前..anaconda才出到1.4,当时的AnacondaCE,直接安装完基本上theano啥的都一套成功.. 今天换了个电脑,重装anaconda, ...

  4. win10下mysql安装过程中遇到的各种坑

    前几天重装系统,又要下回来mysql,但没想到还是遇到了许多麻烦,翻了十多篇博文才搞定,写个总结出来方便以后不要重复踩坑,也给大家参考参考. 1.下载与安装 这个没什么好说的,下载地址网上一大堆,安装 ...

  5. 安装sublime插件安装不上遇到的各种坑

    为了学习VUE , 发现没有高亮代码, 百度原来需要安装插件,安装过程中遇到了各种坑,记录下来避免大家踩坑, 首先用代码安装快捷键  ctrl+`   粘贴代码 import urllib.reque ...

  6. webstorm下载&&安装过程&&打开项目

    一.webstorm下载 WebStorm 是jetbrains公司旗下一款JavaScript 开发工具.被广大中国JS开发者誉为"Web前端开发神器"."最强大的HT ...

  7. 安装过程错误[INS-30131]

    问题:Oracle Database 安装过程错误[INS-30131]   原因:安装用户没有对临时文件夹的读写权限   解决方案:   1.以管理员身份运行cmd.exe 2.输入命令(需启动Se ...

  8. TortoiseGIT的安装过程详解

    TortoiseGIT简介 TortoiseGIT 是Git版本控制系统的一个免费开源客户端,它是git版本控制的 Windows 扩展.可以使你避免使用枯燥而且不方便的命令行.它完全嵌入 Windo ...

  9. RabbitMQ 集群安装过程详解

    一.安装Erlang 1.rabbitMQ是基于erlang的,所以首先必须配置erlang环境. 从erlang官网下载 otp 18.3.下载链接:http://erlang.org/downlo ...

随机推荐

  1. Fis3的前端工程化之路[三大特性篇之声明依赖]

    Fis3版本:v3.4.22 Fis3的三大特性 资源定位:获取任何开发中所使用资源的线上路径 内容嵌入:把一个文件的内容(文本)或者base64编码(图片)嵌入到另一个文件中 依赖声明:在一个文本文 ...

  2. 告别被拒,如何提升iOS审核通过率(上篇)

    iOS审核一直是每款移动产品上架苹果商店时面对的一座大山,每次提审都像是一次漫长而又悲壮的旅行,经常被苹果拒之门外,无比煎熬.那么问题来了,我们有没有什么办法准确把握苹果审核准则,从而提升审核的通过率 ...

  3. ASP.NET MVC with Entity Framework and CSS一书翻译系列文章之第二章:利用模型类创建视图、控制器和数据库

    在这一章中,我们将直接进入项目,并且为产品和分类添加一些基本的模型类.我们将在Entity Framework的代码优先模式下,利用这些模型类创建一个数据库.我们还将学习如何在代码中创建数据库上下文类 ...

  4. 【Machine Learning】KNN算法虹膜图片识别

    K-近邻算法虹膜图片识别实战 作者:白宁超 2017年1月3日18:26:33 摘要:随着机器学习和深度学习的热潮,各种图书层出不穷.然而多数是基础理论知识介绍,缺乏实现的深入理解.本系列文章是作者结 ...

  5. Storm如何保证可靠的消息处理

    作者:Jack47 PS:如果喜欢我写的文章,欢迎关注我的微信公众账号程序员杰克,两边的文章会同步,也可以添加我的RSS订阅源. 本文主要翻译自Storm官方文档Guaranteeing messag ...

  6. 【探索】机器指令翻译成 JavaScript

    前言 前些时候研究脚本混淆时,打算先学一些「程序流程」相关的概念.为了不因太枯燥而放弃,决定想一个有趣的案例,可以边探索边学. 于是想了一个话题:尝试将机器指令 1:1 翻译 成 JavaScript ...

  7. 戏说HTML5

    如果有非技术人员问你,HTML5是什么,你会怎么回答? 新的HTML规范... 给浏览器提供了牛逼能力,干以前不能干的事...(确切地说应该是给浏览器规定了许多新的接口标准,要求浏览器实现牛逼的功能. ...

  8. 使用 .NET WinForm 开发所见即所得的 IDE 开发环境,实现不写代码直接生成应用程序

    直接切入正题,这是我09年到11年左右业余时间编写的项目,最初的想法很简单,做一个能拖拖拽拽就直接生成应用程序的工具,不用写代码,把能想到的业务操作全部封装起来,通过配置的方式把这些业务操作组织起来运 ...

  9. 《Django By Example》第一章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:本人目前在杭州某家互联网公司工作, ...

  10. 谈谈JS中的函数节流

    好吧,一直在秋招中,都没怎么写博客了...今天赶紧来补一补才行...我发现,在面试中,讲到函数节流好像可以加分,尽管这并不是特别高深的技术,下面就聊聊吧! ^_^ 备注:以下内容部分来自<Jav ...