Set up DHCP server IP for Vagrant
Asked Answered
C

1

9

I am using Vagrant 1.1.2 on Mac OS X 10.7.5

I am running into an issue with the default networking setup. The network seems to be configured to use a DHCP server providing IPs from 10.0.2.? network, with the gateway being set to 10.0.2.2

Sadly, in the organization I work for, there actually exists a server at 10.0.2.2, which causes huge network communication delays.

How can I configure Vagrant's VirtualBox to use DHCP server providing IPs from a different network? The documentation at http://www.vagrantup.com/ completely ignores this issue, which unfortunately renders my Vagrant useless.

When I disconnect from the corporate network, Vagrant works as expected. So I am quite sure the issue is in the IP collision.

Cyril answered 19/3, 2013 at 22:53 Comment(0)
H
15

That's more a VirtualBox issue so should have to get Vagrant to set a VirtualBox option for a different DHCP subnet like so:

  config.vm.provider :virtualbox do |vb|
    vb.customize ["modifyvm", :id, "--natnet1", "192.168/16"]
  end
Haggard answered 20/3, 2013 at 8:13 Comment(1)
... if you mess with the subnet (like I did), you won't be able to vagrant up. You'll have to use VBoxManage modifyvm "yourVMname" --natnet1 "yourcorrectsubnet"Musket

© 2022 - 2024 — McMap. All rights reserved.