How to automatically select bridged network interfaces in Vagrant?

aldrien.h picture aldrien.h · Oct 21, 2015 · Viewed 23.3k times · Source

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!

Answer

Frederic Henri picture Frederic Henri · Oct 21, 2015

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