如果是下载的box文件,vagrant box add和init之后启动,可能出现长时间无法通过vagrant ssh登陆的问题

==> localvm2: Importing base box 'bigdatavm'...
==> localvm2: Matching MAC address for NAT networking...
==> localvm2: Setting the name of the VM: localvm2
==> localvm2: Fixed port collision for => . Now on port .
==> localvm2: Clearing any previously set network interfaces...
==> localvm2: Preparing network interfaces based on configuration...
localvm2: Adapter : nat
localvm2: Adapter : hostonly
==> localvm2: Forwarding ports...
localvm2: (guest) => (host) (adapter )
==> localvm2: Running 'pre-boot' VM customizations...
==> localvm2: Booting VM...
==> localvm2: Waiting for machine to boot. This may take a few minutes...
localvm2: SSH address: 127.0.0.1:
localvm2: SSH username: vagrant
localvm2: SSH auth method: private key
localvm2: Warning: Remote connection disconnect. Retrying...
localvm2: Warning: Remote connection disconnect. Retrying...
localvm2: Warning: Authentication failure. Retrying...
localvm2: Warning: Authentication failure. Retrying...
localvm2: Warning: Authentication failure. Retrying...
localvm2: Warning: Authentication failure. Retrying...
localvm2: Warning: Authentication failure. Retrying...
localvm2: Warning: Authentication failure. Retrying...
localvm2: Warning: Authentication failure. Retrying...
localvm2: Warning: Authentication failure. Retrying...

这时有两种可能

一是虚拟机确实启动失败,由于vagrant默认不显示虚机启动界面,所以不太好判断。因此需要在Vagrantfile配置中增加vb.gui = true选项,就可以查看虚机的启动过程。常见问题是没有开启PC的vt-x支持,进BIOS修改配置即可。

二是如果使用拷贝过来的Vagrantfile进行up启动

可能会由于ssh认证机制导致失败。vagrant默认采用key登录,但所用的KeyPair可能没有正常配置。

使用vagrant ssh-config查看

D:\bigdata>vagrant ssh-config
Host localvm1
HostName 127.0.0.1
User vagrant
Port
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile D:/bigdata/.vagrant/machines/localvm1/virtualbox/private_key
IdentitiesOnly yes
LogLevel FATAL The provider for this Vagrant-managed machine is reporting that it
is not yet ready for SSH. Depending on your provider this can carry
different meanings. Make sure your machine is created and running and
try again. Additionally, check the output of `vagrant status` to verify
that the machine is in the state that you expect. If you continue to
get this error message, please view the documentation for the provider
you're using. D:\bigdata>

私钥的地址为D:/bigdata/.vagrant/machines/localvm1/virtualbox/private_key,但实际上本机没有这个文件。

修改方式1:拷贝本机生成的私钥到上述路径;用用户名密码(一般约定为vagrant/vagrant)通过shell登陆虚机,修改~/.ssh下的公钥文件为自己本机生成的公钥。

下次vagrant up就可以登陆成功了。

修改方式2:更改ssh配置为初始密码登陆(增加password和insert_key配置)

    config.vm.define :localvm3 do |localvm3_config|
localvm3_config.vm.hostname = "localvm3.vagrant.internal"
localvm3_config.vm.network :private_network, ip: "192.168.66.33"
localvm3_config.ssh.password = "vagrant"
localvm3_config.ssh.insert_key = false
localvm3_config.vm.provider "virtualbox" do |vb|
vb.gui = true
vb.name = "localvm3"
vb.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]
vb.customize ["modifyvm", :id, "--memory", "2048"]
end
end

* 基于virtualbox

vagrant初始登录失败的一般性解决方案的更多相关文章

  1. 用户 'IIS APPPOOL\IdealTest' 登录失败解决方案

    原文:用户 'IIS APPPOOL\IdealTest' 登录失败解决方案 运行MVC框架后可能会提示“用户 'IIS APPPOOL\IdealTest' 登录失败” 详细堆栈信息如下 说明: 执 ...

  2. 用户'sa'登录失败(错误18456)解决方案图解

    原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://thenear.blog.51cto.com/4686262/865544 htt ...

  3. 用户"IIS APPPOOL\xxxxxxxx"登录失败解决方案

    Server Error in '/' Application.-------------------------------------------------------------------- ...

  4. CentOS 7.6出现SSH登录失败的解决方法

    CentOS 7.6出现SSH登录失败的解决方案 问题重现: iterm登录 ssh vagrant@192.168.10.10 The authenticity of host '192.168.1 ...

  5. 用户 'IIS APPPOOL\DefaultAppPool' 登录失败。

    今天新建了一个ASP.NET(Language=C#)网站,配置好数据库后编写了几行代码测试数据库的是否能正常使用. 当运行程序时,第一个页面都没有打开就出现了错误(因为我首页就访问数据库,填充一些D ...

  6. 用户 'IIS APPPOOL\***' 登录失败

    用户 'IIS APPPOOL\DefaultAppPool' 登录失败. 我在windows8中安装了iis之后添加了我做的网站打开之后提示用户 'IIS APPPOOL\DefaultAppPoo ...

  7. sql server 用户'sa'登录失败(错误18456)(转载)

    转载地址:http://thenear.blog.51cto.com/4686262/865544 用户'sa'登录失败(错误18456)解决方案图解 当我们在使用sql server 的时候可能会遇 ...

  8. IIS7部署项目时提示:"错误消息 401.2。: 未经授权: 服务器配置导致登录失败。"的解决办法

    这个错误的定位:你的站点使用了Forms验证,而且在部署在生产环境的时候,设置错误,或者注释了. 解决方法如下: 1.检查Forms配置是否屏蔽. 2.有权限访问的资源是否已经开发. 基本就围绕以上两 ...

  9. IIS 解决问题:HTTP 错误 401.1 - 未授权:登录失败

    解决问题:HTTP 错误 401.1 - 未授权:登录失败 HTTP 错误 401.1 - 未授权:登录失败 Internet 信息服务 -----------解决这个问题,折磨了两天,终于搞定了,首 ...

随机推荐

  1. Python爬虫入门

    Python爬虫简介(来源于维基百科): 网络爬虫始于一张被称作种子的统一资源地址(URLs)列表.当网络爬虫访问这些统一资源定位器时,它们会甄别出页面上所有的超链接,并将它们写入一张"待访列表",即 ...

  2. net reactor加密源码保软件安全-net reactor使用教程

    上一次介绍用 Xenocode Postbuild for .NET 混淆加密源代码确保软件安全,本篇将讨论用 Eziriz .NET Reactor 混淆加密软件源代码,为从未用过该软件加密的用户分 ...

  3. Javascript模式(第三章字面量与构造函数)------读书笔记

    一 对象字面量 1.1对象字面量的语法 1,对象键值对哈希表,在其他的编程语言中称之为“关联数组”, 2 键值对里面的值,可以是原始类型也可以是其他类型的对象,称之为属性,函数称之为方法 3 自定义对 ...

  4. .NET批量删除代码前的行号

    1 EmEditor Pro.EditPlus .visual studio   ,把有行号的代码粘贴进去,按住键盘的Alt键,然后用鼠标拖出选择框列选行号,最后按Delete删除行号; 2 使用正则 ...

  5. 将JSON格式的时间/Date(2367828670431)/格式 转为正常的年-月-日 格式

    function formatDate(NewDtime) var dt = new Date(parseInt(NewDtime.slice(6, 19))); var year = dt.getF ...

  6. Python入门2

    字符串操作 字符串是语言中使用最多的,下面我们来看看python为字符串提供哪些方法: 1.upper().lower().title() 这3个方法都是返回一个新的字符串.重要性:** name = ...

  7. UNION 和 UNION ALL 区别

    UNION用的比较多union all是直接连接,取到得是所有值,记录可能有重复 union 是取唯一值,记录没有重复 1.UNION 的语法如下: [SQL 语句 1] UNION [SQL 语句 ...

  8. [转]Django与遗留系统和数据库集成

    From:http://www.czug.org/python/django/17.html 尽管Django最适合从零开始开发项目--所谓的"绿色领域"开发--将框架与遗留系统和 ...

  9. 一行代码解决各种IE兼容问题,IE6,IE7,IE8,IE9,IE10 http://www.jb51.net/css/383986.html

    在网站开发中不免因为各种兼容问题苦恼,针对兼容问题,其实IE给出了解决方案Google也给出了解决方案百度也应用了这种方案去解决IE的兼容问题   百度源代码如下 复制代码 代码如下: <!Do ...

  10. Wampserver2.5配置虚拟主机出现403 Forbidden的处理方案

    WampServer是一款由法国人开发的Apache Web服务器.PHP解释器以 及MySQL数据库的整合软件包.免去了开发人员将时间花费在繁琐的配置环境过程,从而腾出更多精力去做开发.在windo ...