-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
bridged network failing #921
Comments
I've been hitting the same problem with CentOS. The vagrant box was produced using the veewee centos 6.2 template, and actually works fine. The interface is up and running and bridged, but Vagrant seems a little confused about it. I've put a copy of the box up here: http://paulgraydon.co.uk/master.box. The relevant Vagrantfile section: config.vm.define :master do |master|
master.vm.box = "Centos6"
master.vm.network :bridged
end Running that command manually without redirect:
|
I also sometimes hit the same problem running CentOS 6.0 x86_64 using the Veewee template. |
I'm getting the same on RHEL 6.2 and CentOS 6.2 guests and I believe that I figured out why this is happening: on RHEL like distros, ifup fails if the interface is already up and has dhclient listening on it. @twirrim: I booted your box with no eth1 and saw a /etc/sysconfig/network-scripts/ifcfg-eth1 of:
This means that before vagrant comes in to change out that file, dhclient has already requested an address and an ifup command will fail. My RHEL 6.2 box's original /etc/sysconfig/network-scripts/ifcfg-eth1 doesn't exist. The first boot with an additional nic works fine. But on a reload, the VM boots with dhcp configured and dhclient will not allow for a clean ifup:
Looking at |
I can confirm this behavior on a (different) CentOS 6.2 box, also built from the veewee template. I've confirmed as well that setting |
I'm also having this problem with |
Yep same issue here. Makes working with :bridged interfaces frustrating. |
This is probably related to #997 (maybe a duplicate). FWIW, the error went away for me after restarting VirtualBox... |
Has anyone made progress on this in figuring out a fix? It seems to be that the RedHat guest is "broken" when configuring network interfaces. I'm not a big RedHat or CentOS user so I'm unsure where the root issue is, would love community help here. |
I think the key is in @gregburek's comment above: #921 (comment) |
It appears if you get this error, doing the following works:
Change I literally just did this and it worked. I also have this in my networking.sh:
This is for CentOS 6.4 (Final). |
My solution to the problem was to ignore simple the exit code of the ifup command. The advantage of this solution is that if a user reboots the machine (without vagrant) that the network connection will re-established.
|
@chilicat I don't quite follow how you're using that, as 'communicate' seems to be an undefined method. |
I have this issue with Centos63, Vagrant 1.1.4, VirtualBox 4.2.10 on OSX Lion. I am unable to have the private_network working on my guest. The real problem is that the networking isn't being setup correctly on the guest system. Even if you try to ignore the error, by adding the line: vm.communicate.sudo("/sbin/ifup eth#{interface} 2> /dev/null", :error_check => false) to the Vagrant code (plugins/guests/redhad/guest.rb), the network bridge isn't brought up, so your VM isn't reachable by the IP that you try to assign it. I tried with latest Vagrant 1.2 and it was even worse, I had some "network_scripts_dir" capability error for the redhat guest. I saw that there was a huge refactoring in the network code for all guests, maybe something is broken there, or then it's my system. Anyway, a real fix would be greatly appreciated! |
Alright, so the main issue I'm confused about is that RedHat guest does an |
My guess (off the top of my head) is that there is something in the network initialization section that reverts the bridged connection on boot, CentOS boots, then Vagrant tries to replace the network configuration and restarts networking. In that time CentOS freaks out and doesn't know where to get its networking information from. Using the steps I posted above seem to resolve the issue (6.4 w/ Vagrant 1.1.4). |
Your approach does work, but I'm afraid of changing things to |
I can test when I get into the office tomorrow, but I'm pretty sure that change still holds when running "shutdown -(r,h) now". The reason we need this is because we have a cluster of VMs for each dev to simulate load balancing and MySQL replication so we need IPs to stick after the VMs come online. (Curse you Percona!) Sent from my iPhone On Apr 7, 2013, at 4:26 PM, Mitchell Hashimoto [email protected] wrote:
|
Steps to reproduce:
|
FIXED! It ended up being a race condition with booting. So I was able to keep the ONBOOT, and just fixed this by adding a retry loop around it. Heh. |
Woo hoo! Thanks! |
Sweeeeeet!! Sent from my iPhone On Apr 8, 2013, at 12:09 PM, Brian Lalor [email protected] wrote:
|
👍 |
Awesome! Today I've run into that issue, glad that it's now fixed! |
Cheetos. |
Any ETA on 1.1.6 being released? I'm now seeing this behavior with 1.1.5 on Ubuntu as well... |
@awellis13 I just installed the gem from source and it seems to work well, you can do that until an official release is made. |
Eh, I'll do that for my personal dev. I need an official release for work so we can go through our Nazi process of pushing new software to our developers. haha On Apr 15, 2013, at 10:40 AM, Christopher Najewicz [email protected] wrote:
|
@jprosevear I've turned on the logging and created a gist for your review: https://gist.github.com/michael-harrison/5746092 Following is the Vagrant file in full:
|
Need VAGRANT_LOG=DEBUG |
@jprosevear sorry, the gist has been updated with the debug log. I did note the following error:
|
@jprosevear Quick FYI for the interim I've commented out the network configuration to continue the work that I'm doing. |
You have a different error than I fixed: |
@jprosevear I agree based on the debug logs. Do you think it's worthwhile raising another issue? |
@Aigeruth The environment variable is already being set in the master (which I did my testing with) but made no real difference to what I'm seeing. Based on my logging the error isn't happening on the ifup, it's on the ifdown: https://gist.github.com/michael-harrison/5746092) 7178 INFO ssh: Execute: /sbin/ifdown eth1 2> /dev/null (sudo=true) |
Call it a hunch, but if you're having an device not found on ifdown I feel this the base box you're using was not built correctly. Sent from my iPhone
|
@awellis13 It is possible. The box I'm having problems with is based on two other boxes. By that I mean I have a box created using the 'centos-64-x64-vbox4210-nocm' template from https://github.com/puppetlabs/puppet-vagrant-boxes then used the resulting box to create the second box which is in turn used by the third box (the one having the problem). I'm in the process of rebuilding the second box to see if that resolves the issue. |
@awellis13 I've done the rebuild and it hasn't resolved the issue :( I do think this is more related. I do believe this issues sounds more like #1577 |
@michael-harrison yes, that commit is on master (1029538), when I pulled that into my fork and pushed it, GH placed this reference automatically (notice that it links to my fork: https://github.com/Aigeruth/vagrant/commit/982010e8d1d53d7187b7dd8b281ad66659b6cdfb), I didn't made this commit |
I've managed to resolve my immediate problem by not specifying network details when creating my base box. So you don't have to re-read the trail of comments here's the steps: BOX 1 Once the bear metal box is created package the VM
BOX 2
Build the box and package it
Add it to Vagrant
BOX 3
Notes
When it should look something like:
Hope this helps in resolving the issue at hand :) |
Before packaging your base box did you run: rm -f /etc/sysconfig/networking-scripts/ifcfg-eth1 There is also a persistent-net file somewhere that you should remove but I can't remember it off the top of my head. Sent from my iPhone
|
Hi @awellis13, I didn't do that but I'll have a look at doing it. If this is needed then I think I'll add it to my puppet scripts to prepare the VM for packaging. |
I still experience this problem (with eth1 'not seeming to be present') with vagrant 1.2.7. The solution that worked for me is from one of the veewee definitions for centos:
This was from veewee's cleanup.sh script for centos. After
|
@bryan - Make sure your base box has ran those two commands successfully before building with Vagrant. If you grabbed those from Veewee I assume you're building it with Veewee? Check your definitions.rb file and make sure cleanup.sh is in the list of scripts to be ran. Sent from my iPhone On Aug 25, 2013, at 5:42 PM, Bryan Bishop [email protected] wrote:
|
@awellis13 Thank you for the heads up, but no I am not using veewee at the moment. I was curious why my veewee builds from before were working, so I compared what veewee was doing against the advice in this bug report thread. |
I used to have these issues all the time up until 1.2.0; which is also when I discovered Veewee and started using it. Try rebuilding your base box and see if the issue goes away. Sent from my iPhone On Aug 25, 2013, at 6:31 PM, Bryan Bishop [email protected] wrote:
|
I'm experiencing the same problem. What's frustrating is that my configuration was working perfectly until a few hours ago. I have no idea what (if anything) changed; it just stopped working this morning after an entire day's successful testing yesterday. Here's my setup: OSX 10.8.4 Relevant lines from my Vagrantfile: $bridge_name = "en0: Wi-Fi (AirPort)" global_config.vm.define "CentOS_VM" do |lxc| Steps to reproduce:
ifcfg-eth1 has this in it: #VAGRANT-BEGIN |
Having this issue with Vagrant 1.4.0, VMware Fusion 6 and CentOS 6.4 64-bit box from Puppetlabs. I tried re-building that box manually (#921 (comment)) but after adding private network settings to Vagrantfile it fails. I tested this with Vagrant's officially supported precise64 and it works, but I need CentOS base with no luck. |
It might be worth looking over at this bug regarding ifup and ARPCHECK in Fedora |
@mjuarez the patch included in the bug report you mentioned fixed the problem for me. Now I'm able to use I'm running Vagrant 1.4.2 with Vritualbox 4.3.6. The box I'm using is based on the Fedora 19 template from veewee. For those interested, the following code applies the patch from Bug 974603 on your VM (run as root). yum -y install patch
wget https://git.fedorahosted.org/cgit/initscripts.git/patch/?id=ce8b72f604079a5516a12f840ed6a64629b0131e -O ifup-eth.patch
patch -p1 -f -b -d /etc < ifup-eth.patch
rm -f ifup-eth.patch |
I packaged a Centos 7.1 virtualbox where I run the following and am still encountering issues starting up a vagrant.
The output from the gui shows "work still pending". I can login but no IP address is every assigned. I have the following lines relevant to networking in my Vagrantfile.
I can run vagrant destroy -f and vagrant up till the cows come home and SOMETIMES I can get the vagrant to actually start successfully. |
@pporada-gl Try using the following. It's a snippet I found somewhere at some point to package our CentOS 7.1 VM using Packer. This is in our
|
@pporada-gl Actually, it appears this is the root cause of your issue. I just added it to our Vagrantfile to test and it caused the SSH timeout to occur:
Remove that and see if you can boot. |
@ellisthedev, |
@pporada-gl Cheers mate, happy coding! |
Hi,
My vagrant box is having issues recently trying to connect through a bridged network. This is the output:
The text was updated successfully, but these errors were encountered: