Vagrant hangs at "SSH auth method: Private key

你。 提交于 2020-12-01 09:22:39

问题


I am running VirtualBox 5.0.24 and Vagrant 1.8.5 on Digital Ocean VPS running on Ubuntu 14.04 LTS Precise I am using the box ubuntu/precise64 Everything works fine but when i do vagrant up it hangs at the

SSH auth method: Private key

and the exit out giving time out. Now, i can consider increasing the execution time but it already takes a fare amount of time before giving that error. I don't know what I am doing wrong. Here is my VAGRANTFILE

# -*- mode: ruby -*-
# vi: set ft=ruby :

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

  config.vm.box = "ubuntu/precise64"
  
  config.vm.provider :virtualbox do |vb|
    vb.customize ['modifyvm', :'1cf9e703-607e-4338-9162-20abbeca94b0', '--pae', 'on']
    vb.customize ['modifyvm', :'1cf9e703-607e-4338-9162-20abbeca94b0', '--hwvirtex', 'off']
    vb.customize ['modifyvm', :'1cf9e703-607e-4338-9162-20abbeca94b0', '--vtxvpid', 'off']
  end

end

回答1:


I had this issue also and I fixed it by opening up the "Oracle Virtual Box Manager" GUI and go to "Settings" -> "Network" and choose "Adapter 1" then expand the option by clicking on the arrow and make sure that "Cable Connected" is checked.




回答2:


Found the following solution on some arcane forum, it works by adding it to the bottom of your Vagrantfile just before the line that says end:

    config.vm.provider "virtualbox" do |vb|
        vb.customize ["modifyvm", :id, "--cableconnected1", "on"]
    end

Does the same as manually changing the setting in VirtualBox AFAIK, but I personally prefer infrastructure as code solutions. That way a colleague doesn't have to deal with the same problem somewhere down the line.




回答3:


I found that my WSL enabled on my Windows 10 so disabled it by using this command

bcdedit /set hypervisorlaunchtype off

but it didn't helped me so i went through Windows features and found that Virtual Machine Platform was turned ON so i look it up and it was linked to WSL so i turned it OFF and my ssh key problem solved.




回答4:


Seems like the latest versions are not working on a VPS. I had to choose the older versions of the softwares to run them on this ubuntu VPS The versions i chose was

VirtualBox >= 4.3.12

AND

Vagrant >= 1.5.3

This works but you will have to configure ssh




回答5:


After spending weeks reading and testing all the answers I found, even the answers that were not marked as correct, I don't remember where, someone mentioned something about Guest Additions... I found the plugin and installed it:

    vagrant plugin install vagrant-vbguest

It works like a charm. Problem solved.

Stack: Virtualbox 6.0, Vagrant 2.2.7, OS Fedora 31




回答6:


I came across this issue when trying use virtualisation (virtualbox + vagrant) on an AWS EC2 Ubuntu 16.04 instance. Apparently, it seems it's not possible because Amazon decided to block that option - virtualbox installation will fail / you will get the message in the title when trying 'vagrant up'. As said in this article (a bit old, but convinced me):

http://cloudstacking.com.s3-website-us-east-1.amazonaws.com/posts/running-hyper-v-vmware-or-xen-on-an-aws-ec2-instance.html

A more complex solution can be found here - but I didn't try it to see if it works:

HVX: Virtual infrastructure for the cloud




回答7:


My version virtualbox(5.1.20), vagrant(1.9.3). I solve this error by deleting

v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]

I´m newbie, hope this help.




回答8:


After spending 6 hours trying to fix this problem the solution for me was:

  1. Downgrade VirtualBox from version 6.x to version 5.x

  2. Disable Hypervisior by opening the command prompt as administrator and running

    bcdedit /set hypervisorlaunchtype off

  3. Restarting computer then destroying and relaunching vagrant box.



来源:https://stackoverflow.com/questions/38463579/vagrant-hangs-at-ssh-auth-method-private-key

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!