Search code examples
vagrantvagrantfilevagrant-windows

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!


Solution

  • 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