Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vagrant: Network type 'bridged' is invalid. Please use a valid network type

Can anyone explain why I am getting the following error

"Vagrant: Network type 'bridged' is invalid. Please use a valid network type."

when I try to bring vagrant up on Virtual Box with the following Vagrantfile

# -*- mode: ruby -*-    
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.hostname = "gitserver"
  config.berkshelf.enabled = true
  config.vm.box = "centos57"
  config.vm.box_url = "http://xx.xx.xx.xx/os/centos-5.7-x86_64.box"
  config.vm.network :bridged, :bridge => 'eth0'

  # Provision VM using chef
  config.vm.provision :chef_solo do |chef|
    chef.cookbooks_path = "cookbooks"
    chef.add_recipe "mysqlserver"
  end

  config.vm.customize ["modifyvm", :id, "--memory", 1024]
end

I have tried all possible combinations with bridged configuration, but it simply does not like it. I cannot find any additional info as to why. Any help here would be hugely appreciated.

like image 839
Noel King Avatar asked May 24 '13 17:05

Noel King


3 Answers

Since you are using a Vagrant config file version 2 (and therefore Vagrant 1.1+) instead of :bridge there is now the new type :public_network.

like image 119
cmur2 Avatar answered Nov 20 '22 01:11

cmur2


To use v1 code, you can insert it into a config 1 block like this:

Vagrant.configure("1") do |config|
    config.vm.network :bridged, :bridge => 'eth0'
end
like image 31
bfitzpatrick Avatar answered Nov 19 '22 23:11

bfitzpatrick


For Vagrant 1.3.5 in used the following:

config.vm.network :public_network, bridge: "en0: Wi-Fi (AirPort)"

It worked for me.

like image 45
Rubens Dourado Avatar answered Nov 20 '22 00:11

Rubens Dourado