Vagrant Connection Refused Error - vagrant

Virtual Box 4.3.14
Vagrant 1.6.3
and when I vagrant up I get this error
default: warning: connection refused. Retying...
it goes on and on until it gives up and says
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
I am on windows 7, I even tried running cmd on administrator mode same thing
I even tried vagrant reload as I read on on other web resources, still same thing, it outputs the same thing
I did not tweak my virtualbox after install, basically just install virtualbox and install vagrant then run vagrant up
and oh by the way my vagrantfile and provisioning script is from here
https://gist.github.com/JeffreyWay/9244801
https://gist.github.com/JeffreyWay/9244714
Been googling and unfurtunately I can't find clear answer
Tnx in advance

It seems its a virtual box / vagrant version incompatibility issue
I uninstalled Virtual Box 4.3.14 and installed Virtual Box 4.3.12 and it worked. Basically I downgraded virtual box.
I hope this gets fixed soon.
Hope this helps anyone.

Open your vagrantfile using notepad and edit it so that it looks like this:
Please tally your vagrantfile with this one word by word. Then open BIOS and turn on virtualisation. Watch this video to learn how to do it. It is a very short video.
PS: You may need to uninstall vagrant before doing this. And in your Users folder in C:, there will be a folder named .vagrant.d, please delete that as well before following these steps.
Uninstalling vagrant will require that you run your machine as administrator. You can right click on Command Prompt (search cmd in windows search box) and click run as administrator. Type the following command: net user administrator /active:yes
You will get a message called command completed successfully. Now you can log off and see that there are two accounts, one of them is admin. You can log in from that and uninstall vagrant.

Related

Can't get vagrant destroy to work

I just deleted a large directory that I no longer needed. Unfortunately, it had a number of vagrant instances that I neglected to halt and destroy first within it and I'm having trouble getting them to go away now.
If I run "vagrant global-status", I receive four results, all have the name "default", three use hyperv and one uses virtualbox (not sure why I have a virtualbox instance at all), all but the virtualbox is running, and all in directories that no longer exist.
I just opened up the hyper-v manager and none of these instances actually exist.
If I attempt to use "vagrant destroy" against any of the ids in the global-status output, I get the following error:
There are errors in the configuration of this machine. Please fix the following errors and try again:
vm:
* A box must be specified
If I look in the "vagrant box list" command, it yields a single named box, but I don't appear to be able to do anything with it as I'll get the same error as above when I attempt to remove it.
What can I do to 1) get rid of the last of the directories that wouldn't delete since vagrant appears to be using the files and 2) clear out these entries that shouldn't be here anymore from the vagrant global-status command?
Thanks!
To clean Vagrant's global status, use the --prune flag.
I'm not sure why you don't see the Hyper-V machines in your Hyper-V manager though.
I wound up uninstalling Vagrant and deleting the directories Vagrant was using. Then I re-installed and there were no more ghost Vagrant instances.
I managed to remove the vagrant VM entry from global-status using vagrant destroy <id> after I manually deleted the VM from "Oracle VM VirtualBox". VM was ubuntu 14.04, host was windows 10.

docker does not run on windows error

I've installed docker and followed the directions here: https://docs.docker.com/installation/windows/#installation but when I run boot2docker start this happens:
Trying to get IP one more time
exit status 255
Docker client does not run on Windows for now. Please use
"boot2docker" ssh
to SSH into the VM instead
Trying boot2docker ssh results in the same 255 error. I tried to get the VM IP with boot2docker IP but that also yielded nothing - I presume because boot2locker wasn't successful in the start process.
A couple of observations...I lloked at the vm settings and there wasn't any network or storage settings specified and the memory allocation in the vm settings didn't match the values in the config (boot2docker config). The boot2docker start/stop commands work.
I'm stumped.
I observed similar issue. Following steps helped me:
Open VirtualBox GUI.
Remove boot2docker-vm virtual machine.
Start Boot2Docker Start --- it will recreate boot2docker-vm virtual machine.
We had exactly this on someone's machine.
The solution for us was to find the
Run the VirtualBox UI (C:\program files\oracle....)
locate the VM (at the top)
select 'power off'
Once all that was done, boot2docker started correctly again.
In extremis, you could delete the boot2docker-vm image out of virtualbox, and it ought to re-install it.
go to the Oracle VM VirtualBox Manager, power off boot2docker-vm and start again. It worked for me.
just in case it helps. My problem was because boot2docker's default settings is beyond my laptop's capability (I know). I fixed the problem by changing the properties of boot2docker-vm through the VirtualBox GUI. Soon as I open thr properties I saw a few warnings at the bottom of the dialogue box, so I followed the hint and resolve those warnings, save the setttings and was able to start docker then.
I changed the CPU from 4->1, memory from 2G to 1.5G and video memory to 20M. Hope it helps.
Mostly you didn't enable the "Virtualization" in your BIOS. boot2docker needs to install 64bit OS in Virtualbox.
Its worth noting I had some huge problems trying to run docker on windows. Boot2docker would install OK with VritualBox 4.3.20. I could NOT run boot2docker or docker itself.
It took me ages to figure out that I had uninstall VirtualBox 4.3.20 and use 4.3.12 instead which worked first time like a treat!
So.. for Windows boot2docker only use VirtualBox 4.3.12.

Unable to run vagrant up due to Vbox error (MS 81.)

I am on Windows 8.1
When i attempt to install vagrant and run it with virtual box i always get the following error.
"The provider 'virtualbox' that was requested to back the machine
'default' is reporting that it isn't usable on this system. The
reason is shown below:
Vagrant could not detect VirtualBox! Make sure VirtualBox is properly installed.
Vagrant uses the VBoxManage binary that ships with VirtualBox, and requires
this to be available on the PATH. If VirtualBox is installed, please find the
VBoxManage binary and add it to the PATH environmental variable."
I have tried different things such as uninstalling both virtual box and vagrant and re-installing them.
I have tried installing vagrant first then vbox and the other way around also but no change.
I am new to vagrant so if anyone can assist please.
I bet that you're using the latest VirtualBox version (4.3.12). If so, there's a known issue which will be addressed in Vagrant 1.6.3:
https://github.com/mitchellh/vagrant/issues/3852
As a workaround you can install VirtualBox 4.3.10 and it will work flawlessly.
As Emyl said, you can either downgrade your VirtualBox or upgrade your Vagrant to 1.6.3(as the issue has been fixed in this version).
But if you want to have a quick fix on this issue you can simply change the environmental variable name for the Virtual Box installation path from VBOX_MSI_INSTALL_PATH to VBOX_INSTALL_PATH
(This PC -> Advanced System Settings -> Environmental Variables -> Search for VBOX_MSI_INSTALL_PATH and change it to VBOX_INSTALL_PATH)
Make sure to restart your terminal before doing vagrant up again.
You are done!
changing VBOX_MSI_INSTALL_PATH and change it to VBOX_INSTALL_PATH in environment variables and then restarting terminal resolved my issue :)
I also had this problem on Windows 8.1 and solved it by restarting my computer. If you have just installed VirtualBox, you may need to restart your command prompt or Windows for the environment variables to get read correctly when you run "vagrant up".
i had to run the cmd.exe as administrator to make this work after using Sri Harsha Kappala solution

Vagrant ssh in Windows: ssh_exchange_identification

So I'm writing guides to get vagrant working on all different operating systems, and I've saved the worst for last... Windows. I've installed virtualbox, vagrant, and a native ssh command line client so I can execute ssh servername successfully. I am also able to run vagrant up, and it brings up the machine (I can see in the VBox GUI), but hangs at "waiting for VM to boot. This can take a few minutes...".
Trying to run vagrant ssh from the command prompt yields an error, sure enough.
ssh_exchange_identification: Connection closed by remote host
I'm fairly new to networking, and I have no idea what is going wrong here. Is it an issue with the private key? (I have the paths for the private key configured properly), or is it a Windows network issue? I haven't been able to find the answer online yet and would appreciate some help. Thanks! A fix would be amazing.
You can try rebooting the machine with
vagrant reload (CTRL + C if it takes too long)
And then try
vagrant up
Now you should be able to ssh back in with
vagrant ssh

vagrant fails to start up in osx mountain lion

I am using Vagrant version 1.1.5 and virtual box 4.2.22. when i do vagrant up, It fails with the following error
Error: The VM failed to remain in the "running" state while attempting to boot. This is normally caused by a misconfiguration or host system incompatibilities. Please open the VirtualBox GUI and attempt to boot the virtual machine manually to get a more informative error message.
I check the virtual box logs, It says /Applications directory is writable by everyone. So I fixed it by removing the write permission for the work for /Applications directory.
But the problem is the permission gets reset almost daily. I have to redo the above the fix daily to use vagrant. Any body know why this is happening or any direction I could take to fix this ?
Regards
Rajesh
I dont think the issue is to do with the permissions - well probably not... that will probably just be a warning.
Try running vagrant in Gui mode to see if you can see any errors in the VM itself.
http://docs.vagrantup.com/v2/virtualbox/configuration.html
First check if you are able to do
VAGRANT_LOG=debug vagrant ssh
if not the following solution is most probable.
One of the common error is configuration of ssh key .which one the notice using.
VAGRANT_LOG=debug vagrant up
There if you see vagrant looping for ssh key.
you can easily fix that using following commands .
vkey() { sudo chown "$*":staff ~/.vagrant.d/insecure_private_key;
vkey <new_owner_username>
here vkey() is the zsh function.
credits: https://superuser.com/questions/612376/vagrant-vm-fails-to-boot
-let me know if problem still exists
Cheers

Resources