bento icon indicating copy to clipboard operation
bento copied to clipboard

Vagrant box rockylinux-9 fails with 'Authentication failure' in VirtualBox

Open EmersonPrado opened this issue 2 years ago • 0 comments

Issue description

I tried to use bento/rockylinux-9 box but, when creating the VM (first vagrant up), it starts repeating this error message: <VM>: Warning: Authentication failure. Retrying... until booting times out. After it times out, I can SSH to the VM thru vagrant ssh. Restarting the VM doesn't change behaviour.

Software Version

  • Distro: Linux Mint Debian Edition 4
    • Based on Debian 10.2
  • Kernel: 4.19.0-21-amd64
  • Vagrant: 2.2.3+dfsg-1
  • VirtualBox: 6.0.22-137980~Debian~buster
  • Box: bento/rockylinux-9 (virtualbox, 202207.20.0)

Replication Case

My Vagrantfile:

VMS = {
  'bento-rocky-8' => 'bento/rockylinux-8',
  'bento-rocky-9' => 'bento/rockylinux-9'
}
Vagrant.configure("2") do |config|
  VMS.each do |name, box|
    config.vm.define name do |vm|
      vm.vm.box = box
    end
  end
end

Output

==> bento-rocky-9: Booting VM...
==> bento-rocky-9: Waiting for machine to boot. This may take a few minutes...
    bento-rocky-9: SSH address: 127.0.0.1:2200
    bento-rocky-9: SSH username: vagrant
    bento-rocky-9: SSH auth method: private key
    bento-rocky-9: Warning: Authentication failure. Retrying...
    bento-rocky-9: Warning: Authentication failure. Retrying...
    bento-rocky-9: Warning: Authentication failure. Retrying...
    ...
Timed out while waiting for the machine to boot....

Comparison to a good box - bento/rockylinux-8

Box bento/rockylinux-8 boots normally and accepts provisioning and all stuff without problems.

rockylinux-9 VM .ssh/authorized_keys contents match output of host ssh-keygen -yf ~/.vagrant.d/insecure_private_key plus vagrant insecure public key appended. rockylinux-8 VM .ssh/authorized_keys contents match output of host ssh-keygen -yf <Project dir>/.vagrant/machines/bento-rocky-8/virtualbox/private_key plus vagrant appended.

It seems some rockylinux-9 VM files are not created invagrant up`:

# From project dir, after creating both VMs

ls -A .vagrant/machines/bento-rocky-*/virtualbox
.vagrant/machines/bento-rocky-8/virtualbox:
action_provision  action_set_name  box_meta  creator_uid  id  index_uuid  private_key  synced_folders  vagrant_cwd

.vagrant/machines/bento-rocky-9/virtualbox:
action_set_name  creator_uid  id  index_uuid  vagrant_cwd

Possible Solution

It seems to me this box is failing to create the key pair, then keeps the insecure one. I couldn't find, in bento code, any significant difference between boxes.

Thanks, Emerson

EmersonPrado avatar Sep 10 '22 22:09 EmersonPrado