bento icon indicating copy to clipboard operation
bento copied to clipboard

Version 2.3.0 fails to connect network on VirtualBox

Open shusugmt opened this issue 10 years ago • 39 comments

SSH timeouts when vagrant up with this version. Network seems not to be configured correctly?

Open VirtualBox -> right click the Box base VM -> Open VM Configuration -> Network -> Adapter 1 -> "Cable connected" is not checked by default.

Reverted back to v2.2.9 solved the problem.

shusugmt avatar Oct 08 '16 03:10 shusugmt

VirtualBox had a regression, which is fixed in:

  • 5.1.6
  • 5.0.28

See mitchellh/packer/issues/3757

Solutions (any of):

  1. Upgrade VirtualBox (recommended)
  2. Downgrade your bento boxes to 2.2.9
  3. Add the following to your Vagrantfile
config.vm.provider 'virtualbox' do |vb|
  vb.customize ["modifyvm", :id, "--cableconnected1", "on"]
end

rickard-von-essen avatar Oct 08 '16 05:10 rickard-von-essen

This also seems to be effecting kitchen (1.13.0)

montge avatar Oct 10 '16 17:10 montge

@montge Any fixes for kitchen?

christopher-francisco avatar Oct 10 '16 21:10 christopher-francisco

For kitchen, you can use the box parameter under driver in kitchen.yml file to specify a different image. But the recommended VBOX upgrade solution should work for kitchen users too.

jpujari-cartera avatar Oct 11 '16 20:10 jpujari-cartera

@chris-fa there is no fix for kitchen, kitchen is not broken - this has to do with the virtualbox version more than anything else.

Closing this one as it's answered and we've got 3 dupes.

cheeseplus avatar Oct 11 '16 23:10 cheeseplus

@rickard-von-essen I believe this doesn't work for a vagrant reload --provision (or at least it isn't working for me); However, it does work doing vagrant destroy --force and then vagrant up

christopher-francisco avatar Oct 12 '16 00:10 christopher-francisco

@rickard-von-essen I'm using virtual box 5.1.6 and using bento/centos7.2 version 2.2.9 and added to my Vagrantfile vb.customize ["modifyvm", :id, "--cableconnected1", "on"], but it still hangs. Should I delete some kind of cache or global configuration file or similar, so that it works?

christopher-francisco avatar Oct 13 '16 21:10 christopher-francisco

I am also running VB 5.1.6 with the bento/ubuntu-16.04 box and am still running into the hanging on ssh issue.

EDIT: After testing again, adding the vb.customize ["modifyvm", :id, "--cableconnected1", "on"] to the Vagrantfile and destroying and upping the machine it did get past the hang.

bgroff avatar Oct 13 '16 22:10 bgroff

@bgroff what about vagrant halt and vagrant up? Does it get past the hang or it gets stuck again? (like me 😭 )

christopher-francisco avatar Oct 14 '16 12:10 christopher-francisco

@chris-fa Yes, a vagrant halt followed by a vagrant up hangs.

bgroff avatar Oct 14 '16 14:10 bgroff

@bgroff :( I am working with chef, so every vagrant up after destroying is 12 mins provision RIP

christopher-francisco avatar Oct 14 '16 15:10 christopher-francisco

Should this ticket be reopened? VB 5.1.6 does not fix this issue. Also as @chris-fa stated even if you add vb.customize ["modifyvm", :id, "--cableconnected1", "on"] to the Vagrantfile, a vagrant halt then vagrant up hangs on ssh auth.

bgroff avatar Oct 14 '16 17:10 bgroff

So the issue is for 2.3.0 but the issues above reference 2.2.9 with 5.1.6 (which flips the problem the other way) - in the interest of sanity if folks could report the complete matrix of what they are considering broken.

Basically: If using bento 2.3.0 then Virtualbox 5.1.6 and Vagrant 1.8.6 are required

If you're seeing that specific permutation fail then I'd like to get a repro case but I'm trying to separate some signal from noise here.

cheeseplus avatar Oct 14 '16 22:10 cheeseplus

@cheeseplus I tried with box 2.2.9 too, no luck. I then went back to bento/centos-6.7 (version 2.2.7) and it worked. I couldnt find a way of making it work with bento/centos-7.2

christopher-francisco avatar Oct 17 '16 13:10 christopher-francisco

In the interests of separating out precise problem, the condition is only if you're doing a vagrant halt correct?

(Trying to stem cross-posting still and get a repro)

cheeseplus avatar Oct 17 '16 13:10 cheeseplus

Also what version of Vagrant?

cheeseplus avatar Oct 17 '16 14:10 cheeseplus

I have to apologize for the noise. I thought I had upgraded to 5.1.6 which I had not. So please disregard my input for the moment.

bgroff avatar Oct 17 '16 14:10 bgroff

My issue was that on virtualbox 5.0.26 I could not run vagrant up with a clean init using bento/ubuntu-16.04. It had nothing to do with vagrant halt or reload. It was a fresh up.

I can confirm that if you upgrade to virtualbox 5.1.8 bento/ubuntu-16.04 will get past the SSH auth method: private key hang.

I can also confirm that the problem still exists if you only upgrade Virtual Box to 5.0.28.

Is this something that can be fixed in a later version of vagrant or should I put min versions on Virtual Box and Vagrants when people try to run our software?

baf139 avatar Nov 01 '16 17:11 baf139

As the person building bento I, by necessity have to lock down the versions of everything, because of unexpected regressions like we've seen here. On a fresh up, with no pre-existing vagrant box of the same name, it will fail as vagrant defaults to grabbing the latest off Atlas - this can be mitigated in your Vagrantfile by specifying a version and test-kitchen (via kitchen-vagrant) can do the same.

The issue here is trying to deal with upstream errors in several projects. This can't be fixed in Vagrant without HashiCorp testing every single new version of hypervisor and hard coding it in which would be an exercise in madness. So the aforementioned solutions are your best bet here @bradallenfisher - fwiw, 5.1.8 also has some serious regressions so we stuck with 5.1.6 across the board on bento until the situation improves.

cheeseplus avatar Nov 01 '16 17:11 cheeseplus

cool. Thanks @cheeseplus

baf139 avatar Nov 01 '16 18:11 baf139