Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not detecting network adapter #8646

Open
jmarais opened this issue Jun 5, 2017 · 3 comments
Open

Not detecting network adapter #8646

jmarais opened this issue Jun 5, 2017 · 3 comments

Comments

@jmarais
Copy link

jmarais commented Jun 5, 2017

Vagrant version

Vagrant 1.9.5
Virtualbox version 5.1.22r115126

Host operating system

Linux 3.10.0-514.21.1.el7.x86_64 #1 SMP Thu May 25 17:04:51 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
CentOS Linux release 7.3.1611 (Core)

Guest operating system

fedora-20

Vagrantfile

Vagrant.configure(2) do |config|
  config.vm.box = "fedora-20"
  config.vm.network "public_network", ip: "172.16.101.43", bridge: "em1"

  config.vm.provider "virtualbox" do |vb|
    vb.name = "dev vm"
    vb.memory = "5000"
    vb.cpus = "4"
    vb.gui = false
  end
end

Debug output

https://gist.github.com/jmarais/4a12c47f3446ed9c29e45f72e63b1b68

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

/sbin/ifdown ''
mv -f '/tmp/vagrant-network-entry--1496643356-0' '/etc/sysconfig/network-scripts/ifcfg-'
(test -f /etc/init.d/NetworkManager && /etc/init.d/NetworkManager restart) || ((systemctl | grep NetworkManager.service) && systemctl restart NetworkManager)
/sbin/ifup ''

Stdout from the command:

NetworkManager.service loaded active running Network Manager

Stderr from the command:

usage: ifdown
Usage: ifup

Expected behavior

The vm should successfully start and vagrant should bridge the vm's public adapter to the host adapter 'em1'

Actual behavior

Vagrant stops provisioning the vm because of a ifdown/ifup command error

Steps to reproduce

  1. Use Vagrantfile on a fresh CentOS 7.3 host and vagrant 1.9.5

From the error output it seems that vagrant is not picking up that the host's network adapter is 'em1'?
I am guessing the /sbin/ifdown '' command should be /sbin/ifdown 'em1'
as well as the tmp file: '/tmp/vagrant-network-entry--1496643356-0' should be '/tmp/vagrant-network-entry-em1-1496643356-0'

edit: I even tried with
virtualbox 5.1.22r115126 + vagrant 1.8.7
virtualbox 5.0.40r115130 + vagrant 1.9.5
virtualbox 5.0.40r115130 + vagrant 1.8.7

And I get the same problem.

edit: I just tried it with:
virtualbox 5.1.4r110228 + vagrant 1.8.5
and my vm provisions and comes up now.
Does anyone have insight to why the latest versions do not work?

edit: I just updated vagrant to 1.9.5 (with virtualbox 5.1.4r110228) and I am getting the same problem. again.

@IzakMarais
Copy link

Tested with same host and guest OS, but with newer Vagrant and VirtualBox. Same error.
Tested with:
Vagrant 1.9.7
VirtualBox 5.1.24_117012_el7-1

@IzakMarais
Copy link

Found the commit that resulted in this regression. Installing vagrant 1.8.6 and removing the sorting introduced by ce3329e allows the box to succesfully provision network interfaces.

@IzakMarais
Copy link

For reference, in the guest running ifconfig gives:

enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
       ...

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
      ...

p2p1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ...

uname -a:

    Linux localhost.localdomain 3.11.10-301.fc20.x86_64 #1 SMP Thu Dec 5 14:01:17 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

The sorting algorithm needs to work for these naming conventions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants