vagrant初始登录失败的一般性解决方案
如果是下载的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初始登录失败的一般性解决方案的更多相关文章
- 用户 'IIS APPPOOL\IdealTest' 登录失败解决方案
原文:用户 'IIS APPPOOL\IdealTest' 登录失败解决方案 运行MVC框架后可能会提示“用户 'IIS APPPOOL\IdealTest' 登录失败” 详细堆栈信息如下 说明: 执 ...
- 用户'sa'登录失败(错误18456)解决方案图解
原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://thenear.blog.51cto.com/4686262/865544 htt ...
- 用户"IIS APPPOOL\xxxxxxxx"登录失败解决方案
Server Error in '/' Application.-------------------------------------------------------------------- ...
- CentOS 7.6出现SSH登录失败的解决方法
CentOS 7.6出现SSH登录失败的解决方案 问题重现: iterm登录 ssh vagrant@192.168.10.10 The authenticity of host '192.168.1 ...
- 用户 'IIS APPPOOL\DefaultAppPool' 登录失败。
今天新建了一个ASP.NET(Language=C#)网站,配置好数据库后编写了几行代码测试数据库的是否能正常使用. 当运行程序时,第一个页面都没有打开就出现了错误(因为我首页就访问数据库,填充一些D ...
- 用户 'IIS APPPOOL\***' 登录失败
用户 'IIS APPPOOL\DefaultAppPool' 登录失败. 我在windows8中安装了iis之后添加了我做的网站打开之后提示用户 'IIS APPPOOL\DefaultAppPoo ...
- sql server 用户'sa'登录失败(错误18456)(转载)
转载地址:http://thenear.blog.51cto.com/4686262/865544 用户'sa'登录失败(错误18456)解决方案图解 当我们在使用sql server 的时候可能会遇 ...
- IIS7部署项目时提示:"错误消息 401.2。: 未经授权: 服务器配置导致登录失败。"的解决办法
这个错误的定位:你的站点使用了Forms验证,而且在部署在生产环境的时候,设置错误,或者注释了. 解决方法如下: 1.检查Forms配置是否屏蔽. 2.有权限访问的资源是否已经开发. 基本就围绕以上两 ...
- IIS 解决问题:HTTP 错误 401.1 - 未授权:登录失败
解决问题:HTTP 错误 401.1 - 未授权:登录失败 HTTP 错误 401.1 - 未授权:登录失败 Internet 信息服务 -----------解决这个问题,折磨了两天,终于搞定了,首 ...
随机推荐
- ios获取UserAgent
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero]; NSString *userAgent = [webView st ...
- JMeter Http测试计划
一.新建Http测试计划 二.添加线程组 设定5个线程,循环2次 三.添加Http请求 以百度为例: 四.添加监听:察看结果树 五.执行测试 5个用户,循环2次,共发了10个请求.
- javascript中无法通过div.style.left获取值的问题
一.问题总结: 样式必须直接写在元素内部才能通过div.style.left直接获取属性值(也就是必须是内联样式才行),定义在css中的样式不能通过这种方式获取. 让元素移动到200停止 setTim ...
- MyBatis与Hibernate的比较
Hibernate 与Mybatis都是流行的持久层开发框架,但Hibernate开发社区相对多热闹些,支持的工具也多,更新也快,当前最高版本4.1.8.而Mybatis相对平静,工具较少,当前最高版 ...
- EL总结
El: 1.el表达式语言(是什么) 2.el是书写到jsp页面 3.el语法格式${ } 4.el算数运算(+,-,*,/,%), 逻辑运算(&&,||,!), 关系运算(>, ...
- JAVA代码发送邮件示例和解释
下载和上传附件.发送短信和发送邮件,都算是程序中很常用的功能,之前记录了文件的上传和下载还有发送短信,由于最近比较忙,邮件发送的功能就没有时间去弄,好在昨晚终于走通代码成功以163邮箱发送邮件到qq邮 ...
- c# MessageBox 用法大全
我们在程序中经常会用到MessageBox. 1.MessageBox.Show("Hello~~~~"); 最简单的,只显示提示信息. 2.MessageBox.Show(&qu ...
- java GC的优化
参考网摘: http://www.360doc.com/content/13/0305/10/15643_269388816.shtml
- Window 端口查询
1. Window环境下查询端口使用情况 方法1: 使用netstat [-参数]|findstr [端口号]来直接查询某个端口的具体使用情况 示例: netstat -ano|findstr &qu ...
- Jquery实现兼容各大浏览器的Enter回车切换输入焦点的方法
<script type="text/javascript"> $('input:text:first').focus(); document.onkeydown = ...