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
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.
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.
config.vm.network "private_network", ip: "192.168.10.10", auto_config: false
to the Vagrantfile and also tick the 'Cable connected' as well. Not sure both were necessary to fix the issue. 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.
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:
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.
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
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.
I had docker installed, this is why i had this issue. To solved it, i did the following:
systemctl stop docker.service
systemctl stop docker.socket
vagrant destroy
vagrant up
Now it works fine.
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
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
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
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
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.
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.
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]
Solved on Windows 11, Virtual Box Version 6.1.40 r154048 (Qt5.6.2), Vagrant 2.3.4
Let's first understand some basic DHCP concepts. If you open up Virtual Box and go to File > Host Network Manager OR type Ctrl + H you will see the following window.
What you need to understand is that a DHCP server simple allocates IPs to new virtual machines in this context.
Click on the DCHP Server tab to see the range of available IP addresses.
What this picture is telling us is that we can allocate IP's ranging from 101 < n < 254 where n is placed on 192.168.56.n
So in our Vagrant file we can do, I picked an arbitrary box:
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.define "web" do |web|
web.vm.network "private_network", ip: "192.168.56.101", virtualbox__intnet: false
end
config.vm.define "db" do |db|
db.vm.network "private_network", ip: "192.168.56.102", virtualbox__intnet: false
end
end
If you want to see the progress of your VM, click on Show
It will show you a command line displaying logs of the process
Once that is done, you can ping both of your machines from your host command line:
ping 192.168.56.101
Pinging 192.168.56.101 with 32 bytes of data:
Request timed out.
Request timed out.
Reply from 192.168.56.101: bytes=32 time=1ms TTL=64
Reply from 192.168.56.101: bytes=32 time=1ms TTL=64
As you can see, oddly enough the first pings timed out but after that they start reaching the VM. For this, I don't have an explanation but it works afterwards.
The virtualbox__intnet: false option basically tells Vagrant to allow connectivity from the host to the VMs. Otherwise, the VMs would only be able to communicate between each other but not the outside world. Here's the doc reference for that
uninstall "open ssh server" & "open ssh client" from "apps => optional feautures",
and reinstal "open ssh server" & "open ssh client"
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:
CPU-Z
and Intel Processor Identification Utility
to verify that VT-x
is now enabledvagrant reload
on my VM in questioncable connected
and re-check cable connected
vagrant ssh
now 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
.