Code Monkey home page Code Monkey logo

Comments (18)

jerenkrantz avatar jerenkrantz commented on August 23, 2024

Were you using a vagrant build in vbox_create.sh or was it a bare bones VirtualBox setup? We should be deleting the DHCP server in both cases in that script, but it'd help to know which code path to focus on.

from chef-bcpc.

PeterMartini avatar PeterMartini commented on August 23, 2024

That was with vbox_create.sh. I just installed CentOS 6.4 on my laptop, then installed VirtualBox 4.2 from Oracle's site, and then ran vbox_create.sh to generate the actual images.

from chef-bcpc.

jerenkrantz avatar jerenkrantz commented on August 23, 2024

Okay - then it sounds like you didn't have vagrant installed. I'll take a quick look, but @mihalis68 was taking care of the non-vagrant code path in that script.

from chef-bcpc.

PeterMartini avatar PeterMartini commented on August 23, 2024

Sorry, I'll try to clarify the issue: the vbox_create.sh script created the profiles for the boostrap node and for vm[1-3], and it did successfully start and build (with vagrant) the bootstrap node; the issue is, both the bootstrap node and VirtualBox itself had DHCP servers running, and the other VMs were picking up their DHCP settings from VirtualBox instead of the bootstrap node. Once I turned off the DHCP server built into VirtualBox, everything worked fine.

from chef-bcpc.

jerenkrantz avatar jerenkrantz commented on August 23, 2024

Yup yup. If you look at vbox_create.sh around line 99, you'll see a few places where we try to kill the built-in DHCP server in VirtualBox. It's possible that CentOS had a different network name that our script didn't catch.

from chef-bcpc.

PeterMartini avatar PeterMartini commented on August 23, 2024

Ah! Thanks

from chef-bcpc.

mihalis68 avatar mihalis68 commented on August 23, 2024

Let me know where this ends up. I do want to extend the setup scripts to as many platforms as possible, but VirtualBox isn't fully uniform across platforms (even ignoring the madness on Windows!).

from chef-bcpc.

PeterMartini avatar PeterMartini commented on August 23, 2024

Found the issue. I do have vagrant installed, and line 99, where the dhcpserver is removed, is in the non-vagrant code path. I don't know if the best fix is to have vagrant take care of removing the dhcp server, or put that into vbox_create.sh itself.

from chef-bcpc.

jerenkrantz avatar jerenkrantz commented on August 23, 2024

What version of vagrant do you have installed? (vagrant -v)

It should be removing the DHCP server (per the Vagrantfile specification which only sets private_network). Specifically, we've tested versions 1.2.2 and up - I'm currently using 1.2.7 on my Mac OS X machines.

from chef-bcpc.

PeterMartini avatar PeterMartini commented on August 23, 2024

I'm using 1.3.1

from chef-bcpc.

jerenkrantz avatar jerenkrantz commented on August 23, 2024

Can you please halt your vagrant box, delete all of the VirtualBox network interfaces, and then run:

VAGRANT_LOG=debug vagrant up

Looking at the Vagrant code base, there should be a line in plugins/providers/virtualbox/action/network.rb that will emit a debug message when it think it needs to create a DHCP server on the hostonly interface. In looking at the Vagrant code path, I don't see why it would think to create a DHCP server as config[:type] should be :static...but, maybe I'm missing something.

Time permitting, I'll see if I can re-create this on a Mac with Vagrant 1.3.1. (You could also try 1.2.7 as well if you have cycles.)

from chef-bcpc.

jerenkrantz avatar jerenkrantz commented on August 23, 2024

For the record, I just confirmed this on CentOS 6.4/VirtualBox 4.2.18r88780/Vagrant 1.3.3. vboxnet0 is getting configured with VirtualBox's internal DHCP server. However, the other interfaces do not appear to have the internal DHCP server set. Investigating.

from chef-bcpc.

jerenkrantz avatar jerenkrantz commented on August 23, 2024

Data point: if I manually delete vboxnet0 and relaunch the VM via vagrant up, vboxnet0 gets recreated without the DHCP server enabled. Sigh.

from chef-bcpc.

jerenkrantz avatar jerenkrantz commented on August 23, 2024

Another data point: if you run vagrant destroy, clear out the network interfaces from VirtualBox, and then run vagrant up, vboxnet0 gets correctly recreated without the DHCP server. So, it seems that the first host-only network that is ever configured via VirtualBox is getting the DHCP server. I'll try to dig through the VirtualBox issues, but this leads me to guess that Vagrant is most likely doing the right thing here...

from chef-bcpc.

cbaenziger avatar cbaenziger commented on August 23, 2024

I have tested with a fresh machine running Ubuntu 12.04.3, VirtualBox 4.3.0 r 89960 and Vagrant 1.3.5.

After running vbox_create.sh, I had a seemingly working bootstrap node and three bcpc-vms. However, I saw vboxnet0 through vboxnet2; while the DHCP server was not present on vboxnet1 or vboxnet2 -- vboxnet0 was configured as follows.

Originally, the DHCP server was enabled. Even after disabling it I still was getting a lease from it and not my bootstrap node.

The server at that point was configured as:
cbaenzig@clay-desktop:~/chef-bcpc$ VBoxManage list dhcpservers
NetworkName: HostInterfaceNetworking-vboxnet0
IP: 192.168.56.100
NetworkMask: 255.255.255.0
lowerIPAddress: 192.168.56.101
upperIPAddress: 192.168.56.254
Enabled: No

I then tried removing the dhcpserver entirely via:
VBoxManage dhcpserver remove --netname HostInterfaceNetworking-vboxnet0

Still, VBoxManage list dhcpservers didn't show a DHCP server but it was still answering for that VM.

Lastly, I rebooted my desktop and the Cobbler server properly answered. After deleting all four VMs and re-running vbox_create.sh, the DHCP server did not return.

from chef-bcpc.

jerenkrantz avatar jerenkrantz commented on August 23, 2024

Disabling the DHCP server in VirtualBox is not enough to kill the running DHCP server process. (My Mac had same issue.)

from chef-bcpc.

cbaenziger avatar cbaenziger commented on August 23, 2024

For what it's worth the errant process on a Ubuntu host looks like:

ubuntu    1771  1535  0 Mar03 ?        00:00:00 /usr/lib/virtualbox/VBoxNetDHCP --network HostInterfaceNetworking-vboxnet0 --trunk-type netflt --trunk-name vboxnet0 --mac-address 08:00:27:7D:9F:D8 --ip-address 192.168.56.100 --lower-ip 192.168.56.101 --upper-ip 192.168.56.254 --netmask 255.255.255.0 --begin-config

Interestingly this was on a rather old VBox:

$ vboxmanage --version
4.2.12r84980

from chef-bcpc.

ericvw avatar ericvw commented on August 23, 2024

The root issue is that a fresh install of VirtualBox automatically adds a host-only interface (i.e., vboxnet0) with DHCP automatically enabled. Thus, when using Vagrant, DHCP is already enabled for vboxnet0. I will be submitting a pull-request with using an alternative iface prefix so it does not collide with VirtualBox's default naming scheme.

from chef-bcpc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.