Vagrant: Vagrant can't launch because ssh host key verification

Created on 18 Sep 2018  ยท  5Comments  ยท  Source: hashicorp/vagrant

/usr/lib/ruby/vendor_ruby/net/ssh/transport/session.rb:298:in 'select_host_key_verifier': Invalid argument to :verify_host_key (or deprecated :paranoid): :never (ArgumentError)

This seems to be an error fixed a while ago so I don't understand why I'm getting it.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:        18.04
Codename:       bionic

$ vagrant --version
Vagrant 2.1.5

$ ruby --version
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]

$ cat Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|

  config.vm.box = "ubuntu/bionic64"
  # Create a private network, which allows host-only access to the machine
  # using a specific IP.

  config.vm.provider "virtualbox" do |vb|
  #   # Display the VirtualBox GUI when booting the machine
  #   vb.gui = true
  #
  #  Customize the amount of memory on the VM:
     vb.memory = "2048"
     vb.cpus = "2"
  end

end

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/bionic64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/bionic64' is up to date...
==> default: Setting the name of the VM: jenkins_default_1537232661681_69775
==> 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: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
/usr/lib/ruby/vendor_ruby/net/ssh/transport/session.rb:298:in `select_host_key_verifier': Invalid argument to :verify_host_key (or deprecated :paranoid): :never (ArgumentError)
        from /usr/lib/ruby/vendor_ruby/net/ssh/transport/session.rb:81:in `initialize'
        from /usr/lib/ruby/vendor_ruby/net/ssh.rb:237:in `new'
        from /usr/lib/ruby/vendor_ruby/net/ssh.rb:237:in `start'
        from /tmp/.mount_vagranP89Bl3/usr/gembundle/gems/vagrant-2.1.5/plugins/communicators/ssh/communicator.rb:415:in `block (2 levels) in connect'
        from /usr/lib/ruby/2.4.0/timeout.rb:93:in `block in timeout'
        from /usr/lib/ruby/2.4.0/timeout.rb:33:in `block in catch'
        from /usr/lib/ruby/2.4.0/timeout.rb:33:in `catch'
        from /usr/lib/ruby/2.4.0/timeout.rb:33:in `catch'
        from /usr/lib/ruby/2.4.0/timeout.rb:108:in `timeout'
        from /tmp/.mount_vagranP89Bl3/usr/gembundle/gems/vagrant-2.1.5/plugins/communicators/ssh/communicator.rb:389:in `block in connect'
        from /tmp/.mount_vagranP89Bl3/usr/gembundle/gems/vagrant-2.1.5/lib/vagrant/util/retryable.rb:17:in `retryable'
        from /tmp/.mount_vagranP89Bl3/usr/gembundle/gems/vagrant-2.1.5/plugins/communicators/ssh/communicator.rb:388:in `connect'
        from /tmp/.mount_vagranP89Bl3/usr/gembundle/gems/vagrant-2.1.5/plugins/communicators/ssh/communicator.rb:84:in `block in wait_for_ready'
        from /usr/lib/ruby/2.4.0/timeout.rb:93:in `block in timeout'
        from /usr/lib/ruby/2.4.0/timeout.rb:33:in `block in catch'
        from /usr/lib/ruby/2.4.0/timeout.rb:33:in `catch'
        from /usr/lib/ruby/2.4.0/timeout.rb:33:in `catch'
        from /usr/lib/ruby/2.4.0/timeout.rb:108:in `timeout'
        from /tmp/.mount_vagranP89Bl3/usr/gembundle/gems/vagrant-2.1.5/plugins/communicators/ssh/communicator.rb:62:in `wait_for_ready'
        from /tmp/.mount_vagranP89Bl3/usr/gembundle/gems/vagrant-2.1.5/lib/vagrant/action/builtin/wait_for_communicator.rb:16:in `block in call'
appimage bug

Most helpful comment

This is fixed by this commit https://github.com/hashicorp/vagrant-installers/commit/3bc7fb4d7771f13efdd7408461ee69866247a67d which will be included in the next release. Cheers!

All 5 comments

I think my system is just hosed somehow...

$ rm -rf ~/.vagrant.d/

$ mkdir temp

$ cd temp

$ vagrant init hashicorp/precise64
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'hashicorp/precise64' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'hashicorp/precise64'
    default: URL: https://vagrantcloud.com/hashicorp/precise64
==> default: Adding box 'hashicorp/precise64' (v1.1.0) for provider: virtualbox
    default: Downloading: https://vagrantcloud.com/hashicorp/boxes/precise64/versions/1.1.0/providers/virtualbox.box
==> default: Successfully added box 'hashicorp/precise64' (v1.1.0) for 'virtualbox'!
==> default: Importing base box 'hashicorp/precise64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'hashicorp/precise64' is up to date...
==> default: Setting the name of the VM: temp_default_1537233354456_50912
Vagrant is currently configured to create VirtualBox synced folders with
the `SharedFoldersEnableSymlinksCreate` option enabled. If the Vagrant
guest is not trusted, you may want to disable this option. For more
information on this option, please refer to the VirtualBox manual:

  https://www.virtualbox.org/manual/ch04.html#sharedfolders

This option can be disabled globally with an environment variable:

  VAGRANT_DISABLE_VBOXSYMLINKCREATE=1

or on a per folder basis within the Vagrantfile:

  config.vm.synced_folder '/host/path', '/guest/path', SharedFoldersEnableSymlinksCreate: false
==> 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: 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: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
/usr/lib/ruby/vendor_ruby/net/ssh/transport/session.rb:298:in `select_host_key_verifier': Invalid argument to :verify_host_key (or deprecated :paranoid): :never (ArgumentError)
        from /usr/lib/ruby/vendor_ruby/net/ssh/transport/session.rb:81:in `initialize'
        from /usr/lib/ruby/vendor_ruby/net/ssh.rb:237:in `new'
        from /usr/lib/ruby/vendor_ruby/net/ssh.rb:237:in `start'
        from /tmp/.mount_vagranUmt8Ct/usr/gembundle/gems/vagrant-2.1.5/plugins/communicators/ssh/communicator.rb:415:in `block (2 levels) in connect'
        from /usr/lib/ruby/2.4.0/timeout.rb:93:in `block in timeout'
        from /usr/lib/ruby/2.4.0/timeout.rb:33:in `block in catch'
        from /usr/lib/ruby/2.4.0/timeout.rb:33:in `catch'
        from /usr/lib/ruby/2.4.0/timeout.rb:33:in `catch'
        from /usr/lib/ruby/2.4.0/timeout.rb:108:in `timeout'
        from /tmp/.mount_vagranUmt8Ct/usr/gembundle/gems/vagrant-2.1.5/plugins/communicators/ssh/communicator.rb:389:in `block in connect'
        from /tmp/.mount_vagranUmt8Ct/usr/gembundle/gems/vagrant-2.1.5/lib/vagrant/util/retryable.rb:17:in `retryable'
        from /tmp/.mount_vagranUmt8Ct/usr/gembundle/gems/vagrant-2.1.5/plugins/communicators/ssh/communicator.rb:388:in `connect'
        from /tmp/.mount_vagranUmt8Ct/usr/gembundle/gems/vagrant-2.1.5/plugins/communicators/ssh/communicator.rb:84:in `block in wait_for_ready'
        from /usr/lib/ruby/2.4.0/timeout.rb:93:in `block in timeout'
        from /usr/lib/ruby/2.4.0/timeout.rb:33:in `block in catch'
        from /usr/lib/ruby/2.4.0/timeout.rb:33:in `catch'
        from /usr/lib/ruby/2.4.0/timeout.rb:33:in `catch'
        from /usr/lib/ruby/2.4.0/timeout.rb:108:in `timeout'
        from /tmp/.mount_vagranUmt8Ct/usr/gembundle/gems/vagrant-2.1.5/plugins/communicators/ssh/communicator.rb:62:in `wait_for_ready'
        from /tmp/.mount_vagranUmt8Ct/usr/gembundle/gems/vagrant-2.1.5/lib/vagrant/action/builtin/wait_for_communicator.rb:16:in `block in call'

So I tried older versions of vagrant and I get the same issue with 2.1.4 and 2.1.3. However, 2.1.2 does work.

@chizou It looks like some system things are being picked up when they shouldn't. I'll dig into this some more and figure out why.

This is fixed by this commit https://github.com/hashicorp/vagrant-installers/commit/3bc7fb4d7771f13efdd7408461ee69866247a67d which will be included in the next release. Cheers!

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cbednarski picture cbednarski  ยท  3Comments

janw-me picture janw-me  ยท  3Comments

tomhking picture tomhking  ยท  3Comments

luispabon picture luispabon  ยท  3Comments

barkingfoodog picture barkingfoodog  ยท  3Comments