Another "Authentication failure. Retrying..." Question

587 views
Skip to first unread message

Robert

unread,
May 15, 2019, 3:06:49 PM5/15/19
to Vagrant
I'm running Vagrant v. 2.2.3 on top of VirtualBox 5.2.26 on macOS
10.12.6.  Whenever I tried to create Debian VMs, I'm getting an
authentication error.  Here is my Vagrantfile:

    # -*- mode: ruby -*-


    VAGRANTFILE_API_VERSION
= "2"


   
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
      config
.vm.box = "debian/stretch64"
      config
.ssh.insert_key = false
      config
.vm.synced_folder "./shared", "/vagrant", type: "virtualbox"
      config
.vm.provider :virtualbox do |v|
        v
.memory = 256
        v
.linked_clone = true
     
end


      config
.vm.define "fs" do |fs|
        fs
.vm.hostname = "fs-vm.example.com"
        fs
.vm.network :private_network, ip: "192.168.2.100"
     
end


      config
.vm.define "db" do |db|
        db
.vm.hostname = "db-vm.example.com"
        db
.vm.network :private_network, ip: "192.168.2.101"
     
end


      config
.vm.define "web" do |web|
        web
.vm.hostname = "web-vm.example.com"
        web
.vm.network :private_network, ip: "192.168.2.102"
        web
.ssh.forward_agent = true
     
end


      config
.vm.define "cms" do |cms|
        cms
.vm.hostname = "cms-vm.example.com"
        cms
.vm.network :private_network, ip: "192.168.2.103"
     
end
   
end


The first time I ran 'vagrant up', I got errors just like those shown
below except that I got the "Warning: Authentication failure" errors
repeatedly for the 'fs' server.  When I re-run 'vagrant up', I now get
the errors as they are shown below.

    Bringing machine 'fs' up with 'virtualbox' provider...
   
Bringing machine 'db' up with 'virtualbox' provider...
   
Bringing machine 'web' up with 'virtualbox' provider...
   
Bringing machine 'cms' up with 'virtualbox' provider...
   
==> fs: Machine already provisioned. Run `vagrant provision` or use the `--provision`
   
==> fs: flag to force provisioning. Provisioners marked to run always will still run.
   
==> db: Clearing any previously set forwarded ports...
   
==> db: Fixed port collision for 22 => 2222. Now on port 2201.
   
==> db: Clearing any previously set network interfaces...
   
==> db: Preparing network interfaces based on configuration...
        db
: Adapter 1: nat
        db
: Adapter 2: hostonly
   
==> db: Forwarding ports...
        db
: 22 (guest) => 2201 (host) (adapter 1)
   
==> db: Running 'pre-boot' VM customizations...
   
==> db: Booting VM...
   
==> db: Waiting for machine to boot. This may take a few minutes...
        db
: SSH address: 127.0.0.1:2201
        db
: SSH username: vagrant
        db
: SSH auth method: private key
        db
: Warning: Authentication failure. Retrying...
        db
: Warning: Authentication failure. Retrying...
        db
: Warning: Authentication failure. Retrying...
        db
: Warning: Authentication failure. Retrying...
        db
: Warning: Authentication failure. Retrying...


If I run 'vagrant status' I see the following:

    Current machine states:


    fs                        running
(virtualbox)
    db                        running
(virtualbox)
    web                       poweroff
(virtualbox)
    cms                       poweroff
(virtualbox)


   
This environment represents multiple VMs. The VMs are all listed
    above
with their current state. For more information about a specific
    VM
, run `vagrant status NAME`.


Is there any way to prevent this authentication error so that when I
issue the 'up' command all four VMs will build without errors?  Vagrant
seems like a very handy development tool but I always have this problem
whenever I try to use it.

Thanks!

Jim McGinness

unread,
May 15, 2019, 3:20:06 PM5/15/19
to Vagrant
Try removing the line

   config.ssh.insert_key = false

from your Vagrantfile or change it to

  config.ssh.insert_key = true

I'm not in a position right now to run a  test for you, but in my experience things work right when Vagrant is allowed to insert the key.

Robert

unread,
May 15, 2019, 5:40:39 PM5/15/19
to Vagrant
Your suggestion to change 'config.ssh.insert_key' from False to True (or delete it altogether as True is the default) resolved the problem.  I'm sure that I began setting this to False sometime in the past because doing so fixed some other error I was getting but I can't find anything in my notes to explain why I did it.  In any case, things are working now so thanks!
Reply all
Reply to author
Forward
0 new messages