如果是下载的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. [zhuan] linux 下 wxWidgets 安装,编译

      http://blog.csdn.net/yuzhenxiong0823/article/details/7727133 wxWidgets在Linux下有wxGTK和wxX11供使用,各需要GT ...

  2. CentOS 6.5下配置iSCSI网络存储

    一.简介 iSCSI(internet SCSI)技术由IBM公司研究开发,是一个供硬件设备使用的.可以在IP协议的上层运行的SCSI指令集,这种指令集合可以实现在IP网络上运行 SCSI协议,使其能 ...

  3. DOJO DOM 功能

    In this tutorial, you'll learn about how to use Dojo to manipulate the DOM in a simple, cross-browse ...

  4. eclipse使用技巧之 //TODO标识

    通常有三种方式去表示你的待办: //TODO 待实现 //XXX 勉强可以工作,但是性能差 //FIXME 代码错误,必须修复. 在task窗口可以查找所有TODO. 使用ctrl + K 去单页面定 ...

  5. 智能指针weak_ptr解决循环依赖问题

    #include <iostream> #include <memory> class Woman; class Man{ private: std::weak_ptr< ...

  6. 关于Failed to install helloworld.apk on device 'emulator-5554!的一个解决办法

    好不容易架好了android环境,把该安得都安好了,结果发现在安装过程中创建一个虚拟设备映象就占用了c盘34g的空间,我的系统盘差点瘫了,看来以后就只能先用这一个虚拟设备调试了, 接着说上边这个问题, ...

  7. 关于import caffe出错的解决

    [http://blog.csdn.net/wuzuyu365/article/details/52431062]关于在caffe下,import caffe报错的解决:conda install p ...

  8. Gson--Gson解析=等号出现乱码?

    GSON使用笔记(1) -- 序列化时排除字段的几种方式 --3,关于Gson解析时候特殊符号,被转义的问题,如'单引号? //Creating the JSON object, and gettin ...

  9. ld.so.conf 和 ldconfig

    1. 查看执行文件的链接库 ldd 例子: # ldd /sbin/sln not a dynamic executable “not a dynamic executable”是 ldd 说明 sl ...

  10. 彻底弄懂响应式设计中的em和rem

    前一阵子在响应式开发中遇到了em和rem的问题,也上网搜过一些文章,篇幅很长,也没有仔细看,今天来总结一下. rem是指:根元素(root element,html)的字体大小, em是指:父元素的字 ...