Reputation: 555
I am using Vagrant to created Virtual Box images. Can anyone tell me the configuration I can set that the Virtual Box VM Network that attaches the VM to a Bridged Adapter before starting up.
I can set the following configuration in my Vagrantfile
, but it sets the Network adapter to NAT not bridged adapter that I need.
config.vm.network :public_network
Thank you
Upvotes: 10
Views: 24480
Reputation: 786
Vagrant will setup a default NAT network, you can add a bridge network by uncommenting the following line in Vagrantfile:
config.vm.network "public_network"
However, if you have multiple network devices in your host, You can specify which one to use by the bridge
parameter:
config.vm.network "public_network", bridge: 'en4: AX88179 USB 3.0 to Gigabit Ethernet'
Upvotes: 5
Reputation: 186
I had the same issue today, what I have really done using Vagrant 2.2.0, use this directive inside my Vagrantfile:
config.vm.network "public_network", bridge: "wlp3s0: Wi-Fi (Hackathon)"
it is also possible to use:
config.vm.network "public_network"
and Vagrant will ask whether you use WLAN or nic!IF THE
Upvotes: 2
Reputation: 1964
I am installing vagrant on ubuntu 10.04 with Virtualbox VirtualBox 4.1.24 from https://www.virtualbox.org/wiki/Linux_Downloads and then downloaded recent version of vagrant.
$ vagrant -v
Vagrant version 1.2.2
$ dpkg -l virtualbox*
ii virtualbox-4.1 4.1.26-84997~U Oracle VM VirtualBox
In order to use bridge network and specifically wifi i just added the line below inside Vagrantfile
config.vm.network :public_network, :public_network => "wlan0"
When you will do
$ vagrant up
You will see option asking for device for bridge interface you can use 1 for wlan0. Hope it helps.
Upvotes: 6