vagrant up报错 Warning: Authentication failure. Retrying...解决方案

来源:互联网 发布:中国农业部数据库 编辑:程序博客网 时间:2024/06/05 11:05
windows下vagrant报错,老是提示Warning: Authentication failure. Retrying...,并且运行完毕后没有共享文件夹,郁闷...

网上找资料,逛论坛,终于有了解决方法,最起码能运行了,贴出来分享一下。

不废话了,下面是报错代码和解决方案:

本地环境win7,vagrant版本1.8.5,virtualbox版本5.0.4

vagrant box add centos71 vagrant-centos-7.1.box

vagrant init centos71

 

报错代码:

 

 1 f:\box>vagrant up 2 ==> default: Attempting graceful shutdown of VM... 3     default: Guest communication could not be established! This is 4 se 5     default: SSH is not running, the authentication information was 6     default: or some other networking issue. Vagrant will force hal 7     default: capable. 8 ==> default: Forcing shutdown of VM... 9 ==> default: Clearing any previously set forwarded ports...10 ==> default: Fixed port collision for 22 => 2222. Now on port 2200.11 ==> default: Clearing any previously set network interfaces...12 ==> default: Preparing network interfaces based on configuration...13     default: Adapter 1: nat14 ==> default: Forwarding ports...15     default: 22 (guest) => 2200 (host) (adapter 1)16 ==> default: Booting VM...17 ==> default: Waiting for machine to boot. This may take a few minut18     default: SSH address: 127.0.0.1:220019     default: SSH username: vagrant20     default: SSH auth method: private key21     default: Warning: Authentication failure. Retrying...22     default: Warning: Authentication failure. Retrying...23     default: Warning: Authentication failure. Retrying...24     default: Warning: Authentication failure. Retrying...25     default: Warning: Authentication failure. Retrying...26     default: Warning: Authentication failure. Retrying...27     default: Warning: Authentication failure. Retrying...28     default: Warning: Authentication failure. Retrying...29 The guest machine entered an invalid state while waiting for it30 to boot. Valid states are 'starting, running'. The machine is in th31 'paused' state. Please verify everything is configured32 properly and try again.33 34 If the provider you're using has a GUI that comes with it,35 it is often helpful to open that and watch the machine, since the36 GUI often has more helpful error messages than Vagrant can retrieve37 For example, if you're using VirtualBox, run `vagrant up` while the38 VirtualBox GUI is open.39 40 The primary issue for this error is that the provider you're using41 is not properly configured. This is very rarely a Vagrant issue.

 

解决方法:

 

 1 # -*- mode: ruby -*- 2 # vi: set ft=ruby : 3  4 # All Vagrant configuration is done below. The "2" in Vagrant.configure 5 # configures the configuration version (we support older styles for 6 # backwards compatibility). Please don't change it unless you know what 7 # you're doing. 8  9 Vagrant.configure("2") do |config|10   # The most common configuration options are documented and commented below.11   # For a complete reference, please see the online documentation at12   # https://docs.vagrantup.com.13 14   # Every Vagrant development environment requires a box. You can search for15   # boxes at https://atlas.hashicorp.com/search.16   config.vm.box = "centos71"17   18   config.vm.boot_timeout = 36019   config.ssh.username = "vagrant"20   config.ssh.password = "vagrant"21 22   # Disable automatic box update checking. If you disable this, then23   # boxes will only be checked for updates when the user runs24   # `vagrant box outdated`. This is not recommended.25   # config.vm.box_check_update = false26 27   # Create a forwarded port mapping which allows access to a specific port28   # within the machine from a port on the host machine. In the example below,29   # accessing "localhost:8080" will access port 80 on the guest machine.30   # config.vm.network "forwarded_port", guest: 80, host: 808031 32   # Create a private network, which allows host-only access to the machine33   # using a specific IP.34   # config.vm.network "private_network", ip: "192.168.33.10"35 36   # Create a public network, which generally matched to bridged network.37   # Bridged networks make the machine appear as another physical device on38   # your network.39   # config.vm.network "public_network"40 41   # Share an additional folder to the guest VM. The first argument is42   # the path on the host to the actual folder. The second argument is43   # the path on the guest to mount the folder. And the optional third44   # argument is a set of non-required options.45   # config.vm.synced_folder "../data", "/vagrant_data"46 47   # Provider-specific configuration so you can fine-tune various48   # backing providers for Vagrant. These expose provider-specific options.49   # Example for VirtualBox:50   #51   # config.vm.provider "virtualbox" do |vb|52   #   # Display the VirtualBox GUI when booting the machine53   #   vb.gui = true54   #55   #   # Customize the amount of memory on the VM:56   #   vb.memory = "1024"57   # end58   #59   # View the documentation for the provider you are using for more60   # information on available options.61 62   # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies63   # such as FTP and Heroku are also available. See the documentation at64   # https://docs.vagrantup.com/v2/push/atlas.html for more information.65   # config.push.define "atlas" do |push|66   #   push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"67   # end68 69   # Enable provisioning with a shell script. Additional provisioners such as70   # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the71   # documentation for more information about their specific syntax and use.72   # config.vm.provision "shell", inline: <<-SHELL73   #   apt-get update74   #   apt-get install -y apache275   # SHELL76 end

 

在Vagrantfile配置文件中添加了两行代码,使用明文用户名密码

config.ssh.username = "vagrant"
config.ssh.password = "vagrant"

保存

vagrant reload

done!

Well done and Good Luck! 

阅读全文
0 0
原创粉丝点击