summaryrefslogtreecommitdiff
path: root/devdocs/vagrant/virtualbox%2Fnetworking.html
blob: 0290178f93b640dde3f4537f636b0e9ec27b9830 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<h1 id="networking">  Networking </h1> <h2 id="virtualbox-internal-network">  VirtualBox Internal Network </h2> <p>The Vagrant VirtualBox provider supports using the private network as a VirtualBox <a href="https://www.virtualbox.org/manual/ch06.html#network_internal">internal network</a>. By default, private networks are host-only networks, because those are the easiest to work with. However, internal networks can be enabled as well.</p> <p>To specify a private network as an internal network for VirtualBox use the <code>virtualbox__intnet</code> option with the network. The <code>virtualbox__</code> (double underscore) prefix tells Vagrant that this option is only for the VirtualBox provider.</p> <div class="highlight"><pre class="highlight ruby" data-language="ruby">Vagrant.configure("2") do |config|
  config.vm.network "private_network", ip: "192.168.50.4",
    virtualbox__intnet: true
end
</pre></div>
<p>Additionally, if you want to specify that the VirtualBox provider join a specific internal network, specify the name of the internal network:</p> <div class="highlight"><pre class="highlight ruby" data-language="ruby">Vagrant.configure("2") do |config|
  config.vm.network "private_network", ip: "192.168.50.4",
    virtualbox__intnet: "mynetwork"
end
</pre></div>
<h2 id="virtualbox-nic-type">  VirtualBox NIC Type </h2> <p>You can specify a specific NIC type for the created network interface by using the <code>nic_type</code> parameter. This is not prefixed by <code>virtualbox__</code> for legacy reasons, but is VirtualBox-specific.</p> <p>This is an advanced option and should only be used if you know what you are using, since it can cause the network device to not work at all.</p> <p>Example:</p> <div class="highlight"><pre class="highlight ruby" data-language="ruby">Vagrant.configure("2") do |config|
  config.vm.network "private_network", ip: "192.168.50.4",
    nic_type: "virtio"
end
</pre></div><div class="_attribution">
  <p class="_attribution-p">
    &copy; 2010&ndash;2018 Mitchell Hashimoto<br>Licensed under the MPL 2.0 License.<br>
    <a href="https://www.vagrantup.com/docs/virtualbox/networking.html" class="_attribution-link">https://www.vagrantup.com/docs/virtualbox/networking.html</a>
  </p>
</div>