Vagrant responds with "Authentication Failure" when trying to provision a Cent OS 7 box on Windows 10

1,576 views
Skip to first unread message

Jason W. Thompson

unread,
Aug 25, 2016, 4:22:32 PM8/25/16
to Vagrant
Hi,

I became interested in using Chef and Vagrant because I was under the impression that the tools Just Work. Unfortunately, I've run into a weird situation where this is far from the case. I have installed Vagrant 1.8.5. I am following the Chef tutorial[1] that uses vagrant to create a "test kitchen" in order to test infrastructure. When vagrant attempts to start up the Cent OS 7 box, I get the following error:

PS C:\workspaces\learn-chef\cookbooks\motd_rhel> kitchen create
-----> Starting Kitchen (v1.11.1)
-----> Creating <default-centos-72>...
       Bringing machine 'default' up with 'virtualbox' provider...
       ==> default: Box 'bento/centos-7.2' could not be found. Attempting to find and install...
           default: Box Provider: virtualbox
           default: Box Version: >= 0
       ==> default: Loading metadata for box 'bento/centos-7.2'
           default: URL: https://atlas.hashicorp.com/bento/centos-7.2
       ==> default: Adding box 'bento/centos-7.2' (v2.2.9) for provider: virtualbox
           default: Downloading: https://atlas.hashicorp.com/bento/boxes/centos-7.2/versions/2.2.9/providers/virtualbox.box
    default: Progress: 100% (Rate: 2837k/s, Estimated time remaining: --:--:--)
       ==> default: Successfully added box 'bento/centos-7.2' (v2.2.9) for 'virtualbox'!
       ==> default: Importing base box 'bento/centos-7.2'...
==> default: Matching MAC address for NAT networking...
       ==> default: Checking if box 'bento/centos-7.2' is up to date...
       ==> default: Setting the name of the VM: kitchen-motd_rhel-default-centos-72_default_1472155814987_26510
       ==> default: Clearing any previously set network interfaces...
       ==> default: Preparing network interfaces based on configuration...
           default: Adapter 1: nat
       ==> default: Forwarding ports...
           default: 22 (guest) => 2222 (host) (adapter 1)
       ==> default: Running 'pre-boot' VM customizations...
       ==> default: Booting VM...
       ==> default: Waiting for machine to boot. This may take a few minutes...
           default: SSH address: 127.0.0.1:2222
           default: SSH username: vagrant
           default: SSH auth method: private key
           default: Warning: Remote connection disconnect. Retrying...
           default:
           default: Vagrant insecure key detected. Vagrant will automatically replace
           default: this with a newly generated keypair for better security.
           default:
           default: Inserting generated public key within guest...
           default: Removing insecure key from the guest if it's present...
           default: Key inserted! Disconnecting and reconnecting using new SSH 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...
           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...
           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...
           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.

To be sure that this isn't a chef issue, I attempted to create a CentOS box using just vagrant and got a similar error. What must I do to get this to Just Work™. 


Jason W. Thompson

unread,
Aug 25, 2016, 4:40:56 PM8/25/16
to Vagrant
After digging through GitHub issue 7610[1], I have it working now. For anyone who lands here on Google here's how to fix it:

1. Open up the following file in your favorite text editor: C:\HashiCorp\vagrant\embedded\gems\gems\vagrant-1.8.5\plugins\guests\linux\cap\public_key.rb
2. Add the following line right after line 56: chmod 0600 ~/.ssh/authorized_keys
3. Save the file and try again.

Reply all
Reply to author
Forward
0 new messages