New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vagrant ssh only possible after restart network #391
Comments
Ah, so we tried to fix this in the thread. I'm not entirely sure what the cause of this is, although it has something to do with the setup of the box. I've put a sleep in the bootup process. Please verify you have a Otherwise, any other hints would be helpful :-\ |
I too am having this problem. I've tried both lucid32 & lucid64, which I downloaded today. Before running
Afterward restarting the networking and running
Any ideas? |
ssh doesn't like two hosts at the one address. Now it turns out SSH doesn't like two redirected port connections to the same port. Symptom:
Now I see two connections to 127.0.0.1:222
Confirm that this is vagrant:
Confirm there is only one vm running:
So it seems the problem is that somewhere in vagrant two connections are being established to port 2222. Correct? |
Could this be some sort of timing issue with the linux networking trying to start (or get an IP) before Virtualbox has finished setting up the interface? Must admit that I don't know the internals so not sure if this is even likely. |
If this was the case then switching VirtualBox versions back would fix the issue, which I'm not sure is the case (it may be, I don't know). I say this because previous versions of Vagrant worked just fine. This is still an isolated issue but annoying enough that I'd like to really figure it out, but haven't been able to yet. |
@mitchellh, in my case switching VB back to 4.0.4 seems to have eliminated the issue. VB 4.0.10 was a problem. From memory I upgraded from 4.0.6 because I was hitting some issues. At the time I had 4.06 I wasn't using vagrant much. Anyway, stepping back to VB 4.0.4 is definitely a fix for this issue in my case. |
@judev, what happens if you |
@judev, please add your failing and passing configuration details to this page: The page has an example script that makes it easy to test (change the Ruby and gem versions to what you have). |
sorry for the delay - I've tried with each version of VirtualBox from 4.0.4 to 4.0.10, same problem when using the latest lucid32 box, but everything works fine using "ubuntu 11.04 server i386" from http://vagrantbox.es @hedgehog, when I did Thanks for your help, am happy to say things are working really well with ubuntu 11.04. |
@judev, Do I understand correctly: |
I get the same issue.. latest version of vagrant, vbox on win7 x64 using jruby (as mentioned in the docs). Running |
@mabroor could you give the additional cmd output, in sequence, requested above? |
I tried after a
|
Same issue but @sudo /etc/init.d/networking restart@ didn't solve it for me. I'm trying another box now, let's hop it works. |
@grimen: try sudo dhclient |
@mabroor, is it the case that, according to |
That's correct.
|
@mabroor Do you maybe know the OS X corresponding solution? |
@grimen the command I mentioned has to be run in the vm. I didn't know the problem existed in OSX, I had the issue on Windows 7 x64. |
@mabroor Ouch, yes of course then it even makes sense. :) Problem though is that I cannot get into the vm - how did u do that? |
|
@mabroor Thanks - will try that! |
I got the GUI now but none of the proposals in this thread works for me (for "lucid32" and "lucid64" that is - those seems to be flawed as 'talifun' works). :( |
My combo shows the same issue: Mac OS X 10.7.1, Vagrant 0.8.5, Virtualbox 4.1.0, lucid64 with correct guest additions After first boot vagrant could not connect to vm. In vm (GUI) there was no IP-address set. Did a Meanwhile I did |
I'm using Mac OS X 10.7.1, Vagrant 0.8.6, VirtualBox 4.1.2, lucid32 with the 4.1.0 guest additions. I've added the following line to my It's not the ideal situation, but it works without needing to go into the GUI. UPDATE: Okay. I've run this a few times and it doesn't always work. Especially when I'm connected to the internal network without an internet connection it seems. |
that works for me:
|
There are no technic without hacking on gui mode ? |
I've repeated the below process at least 5 times now for all scenarios. Running vagrant up after I've started the VirtualBox application works every time. Running vagrant up without starting the VirtualBOX application fails every time, with or without the ":gui" option. From my simple testing it seems to be an issue with running headless. UPDATE: I've just found this article http://serverfault.com/questions/91665/virtualbox-headless-server-on-ubuntu-missing-vrdp-options. I've just installed the Extensions pack and I've had no issues since. VRDP was removed from VirtualBox 4.0 and moved into the extension pack. I believe this might also be related to this issue #455. UPDATE: I jumped the gun on this I think. I'm having trouble with lucid32 and lucid64 running without the ":gui" option. |
…others too This should help the ssh connections refused errors. It seems that it might also make redundant the new ssh session caching code, but I really couldn't follow what was trying to be achieved there.
Can people with this issue confirm that the following pull request fixes this issue for them? |
Is there an agreed upon solution for this? I'm running VirtualBox 4.3.6 and Vagrant 1.4.1 on RHEL 6.2 and unable to run |
i had a problem the vagrant was freezing after restore from hibernate. probably the problem is like a 'broken pipe' kind of problem. something with the network device. because network device is diconnected before hibernate and on startup |
Seeing this issue running Vagrant 1.4.3 with Virtualbox 4.3.6r91406 on Ubuntu 12.04. Are there specific host network settings that are required for Vagrant to work correctly? |
Vagrant set and use local port 2222 to first nic on port 22 are you setting config.ssh ? can you paste your vagrantfile ? On Wed, Feb 26, 2014 at 11:59 AM, Curtis Stewart
|
I'm using test-kitchen and this is the generated Vagrantfile: Vagrant.configure("2") do |c|
c.vm.box = "opscode-ubuntu-12.04"
c.vm.box_url = "https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-12.04_chef-provisionerless.box"
c.vm.hostname = "host-ubuntu-1204.vagrantup.com"
c.vm.synced_folder ".", "/vagrant", disabled: true
c.vm.provider :virtualbox do |p|
p.customize ["modifyvm", :id, "--memory", "512"]
end
end |
@cstewart87 Worked for my with your vagrantfile, no issues at all. |
I added a public network to my VM. This booted fine and worked great. Then I tried to restart. Subsequently:
|
@jean I see you are posting in a bug that is closed, perhaps you want to try the mailing list. I can tell you that I have seen issues when the vagrant file have some errors in the logic, or the base box had the issues. you can send an email tot he mailing list, with the Vagrantfile and we can take it from there., |
@kikitux thanks for your answer, posting to the list 🙇 |
@axsuul I am getting this issue with a CentOS box running on Ubuntu 12.04 host. The issue appeared after a kernel update in Ubuntu which caused the DKMS entry for VirtualBox to be corrupted. This may be related or may be coincidence. |
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/797544 This is pretty much to root of the isse |
I ran into a similiar issue with Ubuntu 14.04 Cloud Image. Turns out Vagrant adds
to the interface configuration. Manually removing this before rebooting fixes the issue (i.e. I can immediately |
Impressed there are people, including myself, still struggling with this. |
Thank you @mikhailov ! The... |
Is there an equivalent of the |
I'm experiencing this issue at least once a week and it's driving me nuts. Doing this from the wiki page fixes the issue but it is really time consuming and takes up a good chunk of my morning. I've tried a number of the fixes listed here and they haven't helped. Is there no way to get a fix for this into Vagrant and skip this runaround of workarounds? |
I came up with a fix that works fine so far for me. Disclaimer: this is more a hack than a fix, as it does not solves the real problem, which I have no clue how to fix, however, it works... Ok, so first, you have to make sure your /etc/networks/interface file is 'clean'.
Then, once you make sure your file is ready, you just create a simple bash script, put it on /etc/init.d and add it to the startup of the VM:
And to add it, you just run this command:
That will make a backup copy of your /etc/network/interfaces file, that you will copy over again when you shutdown the machine. The script that does it is as simple as the first one:
and then you create a symbolic link to it on /etc/rc0.d like this:
and that's it. Every time the machine starts, it will backup the file, and every time it shutdown it will reverse the file to it's original state, thus, allowing Vagrant to do it's ssh magic. |
I think shoe-horning all these issues into one has actually had a negative effect. that said here seems to be the only viable place to talk through the issues I'm facing. Virtualbox fails to configure virtual network adapters when launched via
|
I am going to put my fix here in case it helps somebody who had the same issue as me. I received this error when trying to ssh_exchange_identification: Connection closed by remote host after changing my config.vm.synced_folder ".", "/var", type: "nfs" Turns out this folder is owned by config.vm.synced_folder ".", "/var/<dir not owned by root>", type: "nfs" where |
I have the same problem with virtualbox 5.0.2 and vagrant 1.7.4 on ubuntu 14.04 (all x86). |
Thanks @Xitsa it works for me too,
to /etc/rc.local upd: also, tried to enable intel virtualization in BIOS, and it helped as well, it seems virtualization is required even for 32 bit operation systems (ubuntu/trusty32) |
Thought I would add some details around the solution that I employed to work around this issue. This appeared on my end to be bound to the existence of a private network ... so something like this in my Vagrantfile:
The end result was mixed up
My solution, and it is kind of hacky, was to employ a
and to push my private network config up to the Vagrant layer:
so it runs after When running the following:
I was able to get my VM to come up |
Hey,
i can not log into my VM after "vagrant up"
i have to start it in gui-mode, then retart my network adapter "sudo /etc/init.d/networking restart"
after this, my VM gets an ip (v4) address and my mac is able to ssh the VM and do the provisioning.
any idea on this?
same isse as here: http://groups.google.com/group/vagrant-up/browse_frm/thread/e951417f59e74b9c
the box is about 5 days old!
Thank you!
Seb
The text was updated successfully, but these errors were encountered: