vagrant报错,提示Warning: Authentication failure. Retrying...,重试多次后失败, 并且运行完毕后没有共享文件夹
提示信息如下:
default: Waiting for machine to boot. This may take a few minutes... default: SSH address: 127.0.0.1:2200 default: SSH username: vagrant default: SSH auth method: private key default: Warning: Authentication failure. Retrying... default: Warning: Authentication failure. Retrying... default: Warning: Authentication failure. Retrying... default: Warning: Authentication failure. Retrying... default: Warning: Authentication failure. Retrying... default: Warning: Authentication failure. Retrying... default: Warning: Authentication failure. Retrying... default: Warning: Authentication failure. Retrying... Timed out while waiting for the machine to boot. This means that Vagrant was unable to communicate with the guest machine within the configured ("config.vm.boot_timeout" value) time period. If you look above, you should be able to see the error(s) that Vagrant had when attempting to connect to the machine. These errors are usually good hints as to what may be wrong. If you're using a custom box, make sure that networking is properly working and you're able to connect to the machine. It is a common problem that networking isn't setup properly in these boxes. Verify that authentication configurations are also setup properly, as well. If the box appears to be booting properly, you may want to increase the timeout ("config.vm.boot_timeout") value.
通过上面的错误信息,我们发现并不是config.vm.boot_timeout的问题, 因为我们已经可以连接虚拟机了。 Authentication failure说明认证失败, 猜测可能是ssh默认登陆问题, 简单的处理方法:
在Vagrantfile配置文件中添加了两行代码,使用明文用户名密码
注意: 如果你改过vagrant的密码,那么请填写改后的正确密码。
config.ssh.username = "vagrant" config.ssh.password = "vagrant"
保存
vagrant reload
发现问题解决啦!证明我的猜测是对的
原文来源:https://m.pythontab.com/article/1160
点击查看更多内容
为 TA 点赞
评论
共同学习,写下你的评论
评论加载中...
作者其他优质文章
正在加载中
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦