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 信息服务 -----------解决这个问题,折磨了两天,终于搞定了,首 ...
随机推荐
- 【原创】关于不同分支代码的Merge有了透彻的理解
多分支开发,Merge是一个绕不过的话题,不管是Git还是SVN,公司用的是SVN,之前对于SVN的Merge没有很好的研究,出了些状况,这个问题不解决,顺畅地进行多分支开发就是海市蜃楼,下定决心把这 ...
- ionic 常见问题
1.Couldn't find ionic.config.json file. ? a.在C:\Users\(Username)\.ionic目录下有ionic.config这个文件 添加后缀名jso ...
- 为什么上传文件的表单里面要加一个属性enctype=multipart/form-data?
首先知道enctype这个属性管理的是表单的MIME编码.共有三个值可选:1.application/x-www-form-urlencoded2.multipart/form-data3.text/ ...
- 获取与Url链接相关的信息
以下结果的值以此示例为基础:http://www.x2y2.com:80/fisker/post/0703/window.location.html?ver=1.0&id=6#imhere j ...
- GBDT算法原理深入解析
GBDT算法原理深入解析 标签: 机器学习 集成学习 GBM GBDT XGBoost 梯度提升(Gradient boosting)是一种用于回归.分类和排序任务的机器学习技术,属于Boosting ...
- linux中如何启动和关闭svn
1,启动SVN sudo svnserve -d -r /home/data/svn/ 其中 -d 表示守护进程, -r 表示在后台执行 /home/data/svn/ 为svn的安装目录 2,关闭 ...
- My Construct
1.构造函数定义 类中的构造函数用来初始化一个类.构造函数为公有类型,无返回值,用来从类实例中访问类时初始化此类的私有变量. 2.代码 public class UseConstruct { publ ...
- Hololens开发笔记之连接PC实现资源共享
官网原文介绍:https://developer.microsoft.com/en-us/windows/holographic/using_the_windows_device_portal Hol ...
- kubernetes 内网节点部署笔记(一)
在Centos7上部署kubernetes时,碰到很多坑,特别在摸拟在内网部署时,有来自GFW的障碍,有来自Firewalld的阻塞,反正是各种不服,终于慢慢理顺了思路,自己记录一下,防止遗忘. 环境 ...
- Frameset的使用
一.frameset 1. 属性 ①border 设置框架的边框粗细. ②bordercolor 设置框架的边框颜色. ③frameborder 设置是否显示框架边框.设定值只有0.1:0 表示不要边 ...