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

4

22

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.

Hartzke answered 24/5, 2013 at 17:17 Comment(1)
Which vagrant version you are using?Maes
I
41

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.

Intern answered 24/5, 2013 at 17:53 Comment(0)
W
9

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
Wilmoth answered 24/5, 2013 at 22:16 Comment(0)
W
5

For Vagrant 1.3.5 in used the following:

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

It worked for me.

Wells answered 26/10, 2013 at 5:19 Comment(0)
C
0

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.

Caius answered 30/6, 2013 at 0:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.