I am using Vagrant version 1.3.5 and I am experiencing exactly the same as in Issue #1969. I've found the follow up of this issue (Issue #1975) which was solved by setting root as the owner of the private key (Issue #1921). However it does not solve the problem in my case.
I am using a base box using VirtualBox as provider and I've tried with a generated keys and the insecure keys provided by Vagrant. I'll post the logs in the following comment.
VAGRANTFILE:
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "ubuntu64-precise-mini"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
config.vm.box_url = "./box/ubuntu64-precise-mini.box"
# Run bootstrapping
config.vm.provision :shell, :path => "bootstrap.sh"
# Private key for SSH
config.ssh.private_key_path = "./ssh_key/id_rsa"
# Timeout
config.vm.boot_timeout = 300
SOME LOG OUTPUT:
INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "showvminfo", "8e060ed2-0063-4731-a509-7e30630fa9af", "--machinereadable"]
INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "showvminfo", "8e060ed2-0063-4731-a509-7e30630fa9af", "--machinereadable"]
INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "showvminfo", "8e060ed2-0063-4731-a509-7e30630fa9af", "--machinereadable"]
INFO ssh: Attempting SSH connnection...
INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "showvminfo", "8e060ed2-0063-4731-a509-7e30630fa9af", "--machinereadable"]
INFO ssh: Attempting to connect to SSH...
INFO ssh: - Host: 127.0.0.1
INFO ssh: - Port: 2222
INFO ssh: - Username: vagrant
INFO ssh: - Key Path: /home/mjuarez/Workspace/webfp/data_collection/vm/ssh_key/id_rsa
INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "showvminfo", "8e060ed2-0063-4731-a509-7e30630fa9af", "--machinereadable"]
INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "showvminfo", "8e060ed2-0063-4731-a509-7e30630fa9af", "--machinereadable"]
INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "showvminfo", "8e060ed2-0063-4731-a509-7e30630fa9af", "--machinereadable"]
INFO ssh: SSH not up: # Vagrant::Errors::SSHAuthenticationFailed: SSH authentication failed! This is typically caused by the public/private
keypair for the SSH user not being properly set on the guest VM. Please
verify that the guest VM is setup with the proper public key, and that
the private key path for Vagrant is setup properly as well.
The problem was that I had to set passwordless mode of SSH by modifying /etc/ssh/sshd_config.
For Windows users using Puttygen to generate their key pairs... this can be caused by a public key saved in "Putty" format (RFC 4716) as well.
Replace the content of the local public key (which is used by vagrant provisioning as well) with the content of the Puttygen window "Public key for pasting into OpenSSH authorized_keys file" and your timeouts will disapper.
Passwordless mode can be left disabled too that way, as is recommended.
Adding bellow two lines to Vagrantfile I can figure it out.
config.ssh.username = "vagrant"
config.ssh.password = "vagrant"
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.
Most helpful comment
Adding bellow two lines to Vagrantfile I can figure it out.