Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automatically select bridged network interfaces in Vagrant?

What should I add in Vagrant file to prevent asking (after vagrant up command)

Which interface should the network bridge to?

Available bridged network interfaces: 1) Intel(R) 82579LM Gigabit Network Connection 2) VMware Virtual Ethernet Adapter for VMnet1 3) VMware Virtual Ethernet Adapter for VMnet8 

I want to select the #1 option. Current I need to enter "1" manually. Please help!

like image 523
aldrien.h Avatar asked Oct 21 '15 03:10

aldrien.h


People also ask

Which interface should the network bridge to in vagrant?

Default Network Interface If more than one network interface is available on the host machine, Vagrant will ask you to choose which interface the virtual machine should bridge to. A default interface can be specified by adding a :bridge clause to the network definition.

How do I find my vagrant IP?

The IP address can be determined by using vagrant ssh to SSH into the machine and using the appropriate command line tool to find the IP, such as ifconfig .

How do I change my IP address on Vagrant?

To configure private or host-only networking in Vagrant with static IP address, open the Vagrantfile, find the following line and uncomment it. Here, 192.168. 121.60 is the IP address of the VM. Replace this with your own IP.


1 Answers

in your Vagrantfile, you should add

config.vm.network "public_network", bridge: "Intel(R) 82579LM Gigabit Network Connection" 

Then it should make vagrant happy (actually its more VirtualBox that is getting happy in this case) and select the correct network adapter for the VM

like image 85
Frederic Henri Avatar answered Sep 25 '22 06:09

Frederic Henri