vagrant setting a specific virtualbox host-only network

708 views
Skip to first unread message

Just Anidiot

unread,
May 30, 2013, 3:42:17 PM5/30/13
to vagra...@googlegroups.com
In general I have two host-only networks defined in virtualbox, vboxnet0 which is the 192.168.56.xxx network, and vbox58 which is 192.168.58.xxx.

Now I have been setting the ip address through the Vagrantfile (192.168.56.24).  However I just tried it where I did
config.vm.network :private_network, type: :dhcp, :adapter => 2
I was rather expecting it to use the vboxnet0 network.  Vagrant created a third vboxnet1 network on 172.28.128.xxx.  Is there a way to tell it use a specific virtualbox host-only network.  In my case I want it to use the vboxnet0 network.

Thanks in advance.

Just Anidiot

unread,
Jun 3, 2013, 9:59:50 AM6/3/13
to vagra...@googlegroups.com


So I found adding 

  config.vm.provider :virtualbox do |vb|
    vb.customize ["modifyvm", :id, "--hostonlyadapter2", "vboxnet0"]
  end

will set it to what I want.   However doing a vagrant reload results in a disaster:

There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["showvminfo", "76fd613f-aa40-4a2d-b515-018c856f6c3d", "--machinereadable"]

Stderr: VBoxManage: error: The object is not ready
VBoxManage: error: Details: code E_ACCESSDENIED (0x80070005), component SessionMachine, interface IMachine, callee nsISupports
VBoxManage: error: Context: "GetBootOrder(i, &bootOrder)" at line 615 of file VBoxManageInfo.cpp

What am I doing wrong?


Thiago Lima

unread,
Apr 24, 2014, 12:44:03 PM4/24/14
to vagra...@googlegroups.com
Any update on this subject? Just, could you find a way to solve it?

BR,
Reply all
Reply to author
Forward
0 new messages