» Networking

» VirtualBox Internal Network

The Vagrant VirtualBox provider supports using the private network as aVirtualBox internal network.By default, private networks are host-only networks, because those are theeasiest to work with. However, internal networks can be enabled as well.

To specify a private network as an internal network for VirtualBoxuse the virtualboxintnet option with the network. The virtualbox(double underscore) prefix tells Vagrant that this option is only for theVirtualBox provider.

  1. Vagrant.configure("2") do |config|
  2. config.vm.network "private_network", ip: "192.168.50.4",
  3. virtualbox__intnet: true
  4. end

Additionally, if you want to specify that the VirtualBox provider joina specific internal network, specify the name of the internal network:

  1. Vagrant.configure("2") do |config|
  2. config.vm.network "private_network", ip: "192.168.50.4",
  3. virtualbox__intnet: "mynetwork"
  4. end

» VirtualBox NIC Type

You can specify a specific NIC type for the created network interfaceby using the nictype parameter. This is not prefixed by virtualbox_for legacy reasons, but is VirtualBox-specific.

This is an advanced option and should only be used if you know whatyou are using, since it can cause the network device to not work at all.

Example:

  1. Vagrant.configure("2") do |config|
  2. config.vm.network "private_network", ip: "192.168.50.4",
  3. nic_type: "virtio"
  4. end