Hello Ben
First and foremost, welcome to the mailing list. feel free to send all the questions you have, don't be shy, some questions may be already answered on the documentation, so we can help point where that is.
other questions may be real issues that can be tracked, may be new, etc. so have patience and enjoy the ride.
So, starting point in the documentation is here:
Them you will see the options on the left. They are grouped since Vagrant does the abstraction. ie, adding a new network in Virtualbox and VMWare is the same.
To reply your questions.
Vagrant interact with VBoxManage, so all what vagrant does, is a combinations of commands using VBoxManage.
You can learn more about VBoxManage on the documentation:
So for your questions.
Vagrant try to do things on your behalf, some are nice and clean and work, other may be still some edge cases that need polish. Whats the best way to deal with those?
- Get something that can be reproduced, if you can reproduced with the lastest version of Vagrant and Virtualbox, then will be easier to reproduce so developers can have a look.
- If you think you have found a bug, you can open a issue on GitHub, the more information and repro case the better. Host OS, versions, guest os, happen on other guest os? you can open issues here:
https://github.com/mitchellh/vagrant/issues
So, in your use case here.
Lets say you want to have a VM in Vagrant and you want use whatever network is defined,and get dhcp.
In Vagrant looks like this:
So, you need to make sure the network have dhcp enabled and its created.
You can have something like this by default:
So once the VM got created, we can inspect the VM and see where it got connected:
$ ./VBoxManage.exe list vms
"p64_default_1489148194517_15337" {ff9bb485-84a2-4896-9d9f-cf8ac39d869a}
$ ./VBoxManage.exe showvminfo ff9bb485-84a2-4896-9d9f-cf8ac39d869a | grep -i Ether
NIC 2: MAC: 080027D071C2, Attachment: Host-only Interface 'VirtualBox Host-Only Ethernet Adapter #2', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
Vagrant created this network.
And we can check the IP on the guest:
$ vagrant ssh -c 'ifconfig eth1'
eth1 Link encap:Ethernet HWaddr 08:00:27:d0:71:c2
inet addr:172.28.128.3 Bcast:172.28.128.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fed0:71c2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:25 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4006 (4.0 KB) TX bytes:1152 (1.1 KB)
Vagrant created a VM, eth1 private, and assigned it to the 'VirtualBox Host-Only Ethernet Adapter #2' with ip 172.28.128.3
If I create a new VM, with the same configuration, on my machine I am used, Windows 10 Host, got in the same network:
$ vagrant ssh -c 'ifconfig eth1'
eth1 Link encap:Ethernet HWaddr 08:00:27:f7:c1:74
inet addr:172.28.128.4 Bcast:172.28.128.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fef7:c174/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1180 (1.1 KB) TX bytes:1152 (1.1 KB)
so both VMs are on the same private network, so they will see each other over that ip.
From here,
- What do you want to do?
- What do you see is happening ?
- What do you think is right / wrong ?
Thanks!
Alvaro.