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

Host only adapter cannot be configured when its name not is a standard eth* name #4288

Closed
ogarcia opened this issue Aug 2, 2014 · 8 comments
Labels

Comments

@ogarcia
Copy link
Contributor

ogarcia commented Aug 2, 2014

When you configure a Vagrantfile to set up a Host Only Adapter in a distro that not use standard eth names the "vagrant up" script stops and give an error.

The config line is:
config.vm.network "private_network", ip: "192.168.33.10"

And the output 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!

ip link set eth1 down

Stdout from the command:

Stderr from the command:

Cannot find device "eth1"

The interface name in this case is enp0s8 not eth1.

If you wish, you can reproduce:
$ vagrant init ogarcia/archlinux-201408-x64
Edit Vagrantfile to add: config.vm.network "private_network", ip: "192.168.33.10"
$ vagrant up

@mitchellh mitchellh added the bug label Aug 6, 2014
@rockxsj
Copy link

rockxsj commented Aug 7, 2014

I have get the same error on my Mac:
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> 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!

ip link set eth1 down

Stdout from the command:

Stderr from the command:

Cannot find device "eth1"

the soft version is:
Vagrant 1.6.3
Virtualbox 4.3.14

@terrywang
Copy link

From Linux guest perspective, ethX to enpXsY naming scheme change is due to the move from SysV init to systemd (systemd-udevd).

The following distributions already switched to systemd

  • Arch Linux
  • Fedora 20
  • openSUSE 13.1
  • RHEL 7
  • CentOS 7
  • Oracle Linux 7
  • Debian jessie testing (can use systemd as default init system)

Before Vagrant fixes this in code, an easy temporary workaround is to pass net.ifnames=0 to kernel boot parameters to revert to the old NIC naming scheme.

@mitchellh
Copy link
Contributor

This is fixed now.

@mitchellh
Copy link
Contributor

(in master).

I agree with @terrywang we need to make Vagrant more systemd-aware in the future. But for a 1.6.4 release I think this will work fine.

@denderello
Copy link

@mitchellh: Sorry, but this won't work for me with vagrant version 1.6.5. Used a self created box as well as terrywang/archlinux. When using the config.vm.network "private_network", ip: "192.168.33.10" vagrant still ends up 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!

ip link set eth1 down

Stdout from the command:



Stderr from the command:

Cannot find device "eth1"

@terrywang
Copy link

@denderello Have you tried to pass net.ifnames=0 as kernel boot parameter and try again?

@ogarcia
Copy link
Contributor Author

ogarcia commented Sep 25, 2014

I think that while the bug is not fixed this issue must be open.

@denderello
Copy link

@terrywang helps with your image, but not on my own one. If I use the parameter there vagrant won't even be able to connect to the machine. :(

l0b0 added a commit to l0b0/root that referenced this issue Nov 5, 2014
l0b0 added a commit to l0b0/root that referenced this issue Nov 6, 2014
Can't test `ping` because of a Vagrant bug
<hashicorp/vagrant#4288> (closed but it seems not
yet fixed).

Gem installs are borked (the executable is only readable by root), so we
have to install as vagrant.

<https://github.com/terrywang/vagrantboxes/blob/master/archlinux-x86_64.md>
via <https://wiki.archlinux.org/index.php/Vagrant#Base_Boxes_for_Vagrant>.
akovacs added a commit to alex-grover/CS244b-final-project that referenced this issue Dec 7, 2014
@ghost ghost locked and limited conversation to collaborators Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants