Vagrant 1.8.5
OSX El Capitan 10.11.6
CentOS 7.1
VAGRANTFILE_API_VERSION = '2'
Vagrant.require_version '>= 1.5.0'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.hostname = 'my-vm'
config.vm.box = 'opscode-centos-7.1'
config.vm.box_url = "https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-7.1_chef-provisionerless.box"
config.vm.box_check_update = "true"
config.vm.boot_timeout = 600
if Vagrant.has_plugin?("vagrant-vbguest")
config.vbguest.auto_update = false
config.vbguest.no_install = true
end
config.berkshelf.enabled = false if Vagrant.has_plugin?("vagrant-berkshelf")
config.vm.provider :virtualbox do |p|
p.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
p.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
p.customize ["modifyvm", :id, "--memory", "4096"]
p.customize ["modifyvm", :id, "--cpus", "2"]
p.customize ["modifyvm", :id, "--vram", "32"]
end
end
https://gist.github.com/rishabhtulsian/770970e80fa2f556af98b7a140345448
Vagrant should have connected to the VM and provisioned it.
Vagrant kept retrying and authentication failed.
vagrant upI did take a look at the existing bugs and the fixes/suggestions they provide. None of those worked for me. However I tried something different which fixed it, hence I am opening this issue.
I tried suggestions from these issues
This workaround worked for me config.ssh.insert_key = false
I changed all the chmod 0700 ~/.ssh to chmod 0600 ~/.ssh
Modify /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/guests/linux/cap/public_key.rb
on line 57 insert chmod 0600 ~/.ssh/authorized_keys
This issue has been fixed in 1.8.6
Thanks that worked!
You're welcome, I struggled with that one for a few days as well, its buried in the comment section of one of the tickets you linked. Glad I could help you, my first contribution to github!
If this is a self-made box and you do not use config.ssh.insert_key = false, make sure that you delete private key before you package the box!
rm .vagrant/machines/default/virtualbox/private_key
You may need to replace default with the actual box name.
If you forget it, than this private key part gets packaged with the box and than you have auth failures when you try to use the imported box. Vagrant will not try to use insecure key and will not regenerate the key for the new instance based on this box.
I discovered it after 3 hours of fighting the problem...
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
If this is a self-made box and you do not use
config.ssh.insert_key = false, make sure that you delete private key before you package the box!You may need to replace
defaultwith the actual box name.If you forget it, than this private key part gets packaged with the box and than you have auth failures when you try to use the imported box. Vagrant will not try to use insecure key and will not regenerate the key for the new instance based on this box.
I discovered it after 3 hours of fighting the problem...