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

Centos 7: Error "Device eth1 does not seem to be present" with private network #970

Closed
jong99 opened this issue Jul 24, 2014 · 23 comments
Closed

Comments

@jong99
Copy link

jong99 commented Jul 24, 2014

Trying to use a private network with the new Centos 7 config doesn't work and results in the error below:

Steps to reproduce:

veewee vbox define 'centos70' CentOS-7.0-1406-x86_64-netinstall --force
veewee vbox build 'centos70' 
veewee vbox export 'centos70'
vagrant box add 'centos70' centos70.box
vagrant init 'centos70'

Now edit the Vagrantfile and uncomment the line:

  config.vm.network "private_network", ip: "192.168.33.10"

Then run:

vagrant up

This results in the following error:

==> default: Configuring and enabling network interfaces...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

ARPCHECK=no /sbin/ifup eth1 2> /dev/null

Stdout from the command:

ERROR    : [/etc/sysconfig/network-scripts/ifup-eth] Device eth1 does not seem to be present, delaying initialization.


Stderr from the command:
@jong99
Copy link
Author

jong99 commented Jul 25, 2014

Lots of discussion here on similar issues but nothing helps for Centos 7
hashicorp/vagrant#1777

@jong99
Copy link
Author

jong99 commented Jul 29, 2014

Eventually managed to get it to work by changing the Vagrantfile line to

config.vm.network "private_network", ip: "192.168.33.10", auto_config: false

Would be nice if this could work straight out of the box though!

@mpapis
Copy link
Collaborator

mpapis commented Oct 4, 2014

should we update docs for this?

@hlangeveld
Copy link

See also mitchell/vagrant#4195

@mpapis
Copy link
Collaborator

mpapis commented Oct 14, 2014

so does updating vagrant to latest version help with this problem? - always update your software :)

@jgough
Copy link

jgough commented Oct 24, 2014

Tried to reproduce with latest vagrant version but having issues with Guest Additions and can't get anything to work at the moment. Will let you know if I make progress.

@solomongifford
Copy link

I can confirm that upgrading to vagrant >=1.6.5 fixes the issue.

@mpapis
Copy link
Collaborator

mpapis commented Nov 5, 2014

thanks for confirming

@mpapis mpapis closed this as completed Nov 5, 2014
@mpapis mpapis removed the need info label Nov 5, 2014
@geerlingguy
Copy link

Another confirmation that simply upgrading to 1.6.5+ fixed the issue (I was running 1.6.3).

@ghost
Copy link

ghost commented Dec 28, 2014

I am running 1.7.1 and I am getting this issue. Was this reintroduced with all the issues in 1.7.0?

@mpapis
Copy link
Collaborator

mpapis commented Dec 28, 2014

@monomidev please test with version lower then 1.7.0 to be sure - if it fails again please comment on hashicorp/vagrant#4195 or hashicorp/vagrant#1777 - whichever looks more similar

@ghost
Copy link

ghost commented Dec 29, 2014

Sorry for the confusion but it looks like this is not caused by Vagrant. I was running into a couple of issues. When I first encountered this, I was getting an error with device eth1. I noticed there was a ifcfg-eth1 file but eth2 was the device vagrant was adding. It would then error on eth1 with the error mentioned in this thread. I found the following article on a similar issue with ubuntu and vagrant:

http://able.cd/b/2012/04/09/vagrant-broken-networking-when-packaging-ubuntu-boxes/

Quite old but was the case me. When I remove the rules file, vagrant was having the same error for eth2 and then eth3 was the actual device. I noticed the ifcfg-eth1 file was still present. The fix I did:

  1. In virtualbox, I removed all but one adapter.
  2. I removed the ifcfg-eth1 file.
  3. I removed the rules file "/etc/udev/rules.d/70-persistent-net.rules"

Now vagrant attempts to create device eth1 and writes a config file for eth1 when setting a private_network.

@mpapis
Copy link
Collaborator

mpapis commented Dec 29, 2014

are you saying that automated removal of /etc/udev/rules.d/70-persistent-net.rules during one of the steps would solve the problem? can you open pull request that automates it?

@klub
Copy link

klub commented Jan 5, 2015

Removing /etc/udev/rules.d/70-persistent-net.rules
seems to have worked for me too.

@ghost
Copy link

ghost commented Jan 5, 2015

@mpapis sorry for the delay, I think it is a combination of bad base box configuration (causing the extra ifcfg file) and the rules file. I will see what I can put together.

@dankeder
Copy link

I have vagrant 1.7.2 and I am encoutering this issue too.

As far as I can tell, the problem is that Vagrant expects the second network interface to be called eth1, and it wants to create configuration for it in /etc/sysconfig/network-scripts/ifcfg-eth1. But network interfaces have a different naming convention in Centos 7 (and Fedora as well) - the network interface in question is actually called like enp0s8 (or something similar - you can get the real interface name by running ip link in the VM shell).

The solution would be to explicitly specify the interface name in Vagrantfile - which I don't know how to do, but maybe somebody else does.

A possible workaround which I used is to disable interface renaming by adding net.ifnames=0 to GRUB_CMDLINE_LINUX=... line in /etc/sysconfig/grub in the base VM image, and running grub2-mkconfig > /etc/grub2.cfg.

@mpapis
Copy link
Collaborator

mpapis commented Feb 20, 2015

I think net.ifnames=0 is the best option, we actually want the old behavior for virtual machines, the new names are only trouble in our use case - btw. I think I used the same thing for openSUSE

@Stono
Copy link

Stono commented Mar 3, 2015

So I have this issue (I think) with RHEL7.
I have created an image using net.ifnames=0 etc so my interfaces are named correctly, however when I add a private network using Vagrant I get:

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

/sbin/ifdown 

Stdout from the command:



usage: ifdown <device name>

When i log onto a box there is a random file....

/etc/sysconfig/network-scripts/ifcfg-

Karl

@mpapis
Copy link
Collaborator

mpapis commented Mar 3, 2015

You will have to debug this process yourself, I'm stepping down to only advise on fixing the issues (see: http://niczsoft.com/2015/02/changes-in-my-open-source-life/)

@pebreo
Copy link

pebreo commented Jun 8, 2015

I was able to fix this issue by upgrading to Vagrant v1.7.2.

@pgporada
Copy link

This still happens to me on Vagrant v1.7.2

@anhcuong
Copy link

anhcuong commented Jul 2, 2015

the problem happens on Vagrant v1.7.2 !!!

@DanielAron
Copy link

Same problem here following this tutorial:
https://github.com/openMF/mifosx/wiki/MifosX-Vagrant-Box-Setup
Vagrant v1.7.2

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

No branches or pull requests