'Vagrant hangs at "SSH auth method: Private key
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
Solution 1:[1]
I had this issue also and I fixed it by opening up the "Oracle Virtual Box Manager" GUI. 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.
Solution 2:[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.
Solution 3:[3]
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
Solution 4:[4]
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.
Solution 5:[5]
UPDATE AS OF MAY 2021: So I found that this was an actual bug in Vagrant. The solution comes directly from Hashicorps' GitHub.
Basically open the vagrantfile and add these lines under config.vm.provider :virtualbox do |v| and before end:
v.customize ["modifyvm", :id, "--uart1", "0x3F8", "4"]
v.customize ["modifyvm", :id, "--uartmode1", "file", File::NULL]
If the line is config.vm.provider :virtualbox do |vb| then the code will be:
vb.customize ["modifyvm", :id, "--uart1", "0x3F8", "4"]
vb.customize ["modifyvm", :id, "--uartmode1", "file", File::NULL]
Solution 6:[6]
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
Solution 7:[7]
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):
A more complex solution can be found here - but I didn't try it to see if it works:
Solution 8:[8]
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.
Solution 9:[9]
In my case, I had gotten into a sort of an invalid state. Running this command before vagrant up did the trick.
Note: Use with caution, as this will clear all data on the vagrant instance.
vagrant destroy --force
Solution 10:[10]
I was getting stuck in Windows too at the same SSH auth method: Private key (trying to SSH to an Ubuntu box), and then I get a timeout after a few minutes.
Beware if you are running multiple SSH agents (maybe involuntary). For example, in Windows, you could have both Pageant and OpenSSH Authentication Agent (the ladder you can find under Windows Services). In my case, the private key was added under Pageant but OpenSSH Authentication Agent seems to have taken priority after an OS restart.
Ended up disabling the latter, restarting the OS, loading the key again in Pageant, and then vagrant ssh worked.
Solution 11:[11]
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.
I tried this answer and found that this was already enabled by default. I Tried disabling and re-enabling and this first gave me the following message Warning: Connection aborted. Retrying... after which vagrant continued the startup and did so successfully
Solution 12:[12]
Well, i faced similar issue and got the resolution in the below thread: https://forums.virtualbox.org/viewtopic.php?f=6&t=97578 This was caused by me running docker desktop on windows 10, which uses windows SubsystemLinux and utilized Hyper-v to launch the Virtual env. This does not allow or makes Virtual box too slow to respond that the ssh times out and also results in File system errors. you should specially focus on the "turtle" icon which means Virtualbox too slow and i if everything is fine then you will see the "V" icon on virtualbox console. follow the instruction to stop hyper-v reboot the machine and it will work. To turn Hyper-V off completely, do this:
Shut down all programs. You will have to reboot your host.
See I have a 64bit host, but can't install 64bit guests. This tutorial has a couple more things to look for in step 2. Be sure these are all turned off.
Find the Command Prompt icon, right click it and choose Run As Administrator.
Enter this command: bcdedit /set hypervisorlaunchtype off
Enter this command: shutdown -s -t 2
When the computer turns off, unplug it for 20 seconds. Then plug it in again and boot up Windows 10.
Solution 13:[13]
Be sure to look at the VM terminal on VirtualBox while vagrant is hanging. For me the issue was a broken file system.
I ran:
fsck -yf /dev/mapper/homestead--vg--root
from the VirtualBox terminal and the issue was resolved.
Solution 14:[14]
Following the advice from user Kokokoko above I added the following lines to my vagrnt file.
vb.customize ["modifyvm", :id, "--uart1", "0x3F8", "4"]
vb.customize ["modifyvm", :id, "--uartmode1", "file", File::NULL]
installed the latest virtualbox, made sure the vm was halted properly and it worked for me.
using Virtualbox 6.1.32 with Vagrant 2.2.10 with Ubuntu/Xenial64
Solution 15:[15]
Having recently run into this problem myself, I concluded that installing Docker Destkop for Windows caused a series of changes to my system that essentially broke VirtualBox with Vagrant.
I have concluded the following steps as my minimum viable resolution:
- Uninstall Docker Desktop Client
- Disable a series of Windows Features that are related to virtualization or containers
- Check
CPU-ZandIntel Processor Identification Utilityto verify thatVT-xis now enabled - Run a
vagrant reloadon my VM in question - Uncheck
cable connectedand re-checkcable connected vagrant sshnow works.
I will need to restore each feature one at a time to see how far I can go before breaking this again.
Here's a screenshot of the various tidbits, and the pointers:
(1) Disabled Containers in Windows (2) Disabled Hyper-V (3) Disabled Virtual Machine Platform (4) Disabled Windows Hypervisor Platform (5) Disabled WSL (6) Now VT-x shows up again (it was not showing up previously) (7) Now SLAT shows up again (it was not showing up previously) (8) CPU-Z sees VT-x as well
I now also note that Enable Nested VT-x is no longer greyed out on my CPU settings menu in VirtualBox.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow


