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

Networking configuration fails on Ubuntu with systemd > v197 #6653

Closed
gMagicScott opened this issue Dec 8, 2015 · 3 comments
Closed

Networking configuration fails on Ubuntu with systemd > v197 #6653

gMagicScott opened this issue Dec 8, 2015 · 3 comments

Comments

@gMagicScott
Copy link

In Ubuntu 15.10, systemd now uses "predictable network interface names".

When Vagrant sets up the networking during vagrant up, it ends with an error that /sbin/ip addr flush dev eth#{interface} 2> /dev/null fails.

For network setup, currently Ubuntu falls back to the Debian networking capability. The template being used hard codes eth followed by a number from the options[:interface]. When I tried it, it compiled to eth2.

The command is failing because there is no interface eth2, there aren't any that start with eth. In my test, the interface you would want is enp0s3.

The only OS that's using these predictable interface names that I know of is Ubuntu 15.10, but there are probably more, or will be in the near future. You can read more on how the predictable names are determined here.

I saw this issue was reported in boxcutter/ubuntu#34, but I don't think it's an issue for the base box to solve.

@sethvargo
Copy link
Contributor

Hi @gMagicScott

This has been fixed in the master branch. I don't recall the other issue, but I know we fixed it. I was able to successfully bring up an ubuntu 15.10 box just now with virtualbox (using ubuntu/wily64) without error. Sorry I don't recall the exact issue, but this is fixed and will be part of Vagrant 1.8 😄

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/wily64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/wily64' is up to date...
==> default: A newer version of the box 'ubuntu/wily64' is available! You currently
==> default: have version '20151120.0.0'. The latest is version '20151203.0.0'. Run
==> default: `vagrant box update` to update.
==> default: Setting the name of the VM: scratch_default_1449611249397_72470
==> 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: Forwarding ports...
    default: 22 (guest) => 2222 (host) (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: Remote connection disconnect. Retrying...
    default:
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => /Users/sethvargo/Desktop/scratch

@gMagicScott
Copy link
Author

It took more effort than I expected to get Ruby setup to try the latest master branch.

Using 038276f, I still get the same error.

My current Vagrantfile:

Vagrant.configure(2) do |config|
  config.vm.box = "boxcutter/ubuntu1510"
  config.vm.network "private_network", ip: "192.168.50.4"
end

Here's the output I'm getting:

$ ../vagrant/exec/vagrant up    
Vagrant appears to be running in a Bundler environment. Your 
existing Gemfile will be used. Vagrant will not auto-load any plugins
installed with `vagrant plugin`. Vagrant will autoload any plugins in
the 'plugins' group in your Gemfile. You can force Vagrant to take over
with VAGRANT_FORCE_BUNDLER.

You appear to be running Vagrant outside of the official installers.
Note that the installers are what ensure that Vagrant has all required
dependencies, and Vagrant assumes that these dependencies exist. By
running outside of the installer environment, Vagrant may not function
properly. To remove this warning, install Vagrant using one of the
official packages from vagrantup.com.

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'boxcutter/ubuntu1510'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'boxcutter/ubuntu1510' is up to date...
==> default: A newer version of the box 'boxcutter/ubuntu1510' is available! You currently
==> default: have version '2.0.10'. The latest is version '2.0.11'. Run
==> default: `vagrant box update` to update.
==> default: Setting the name of the VM: testing_default_1450129248330_1762
==> 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 (guest) => 2222 (host) (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: 
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default: 
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> 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!

/sbin/ip addr flush dev eth1 2> /dev/null

Stdout from the command:



Stderr from the command:



I made a gist of full output from $ ../vagrant/exec/vagrant up --debug &> vagrant-debug.log. https://gist.github.com/gMagicScott/75d2fa67f2203c4c1ebc

On another note, I tried both the current version of vagrant and the master branch to bring up the box with the network line commented out. Both succeeded.

@richardmcsong
Copy link

Also getting this error with ubuntu 15.10 with vagrant 1.8.1

rade added a commit to weaveworks/weave that referenced this issue Jan 21, 2016
wzur pushed a commit to wzur/vagrant-boxes-ubuntu that referenced this issue Mar 2, 2016
wzur pushed a commit to wzur/vagrant-boxes-ubuntu that referenced this issue Mar 2, 2016
wzur pushed a commit to wzur/vagrant-boxes-ubuntu that referenced this issue Mar 2, 2016
@ghost ghost locked and limited conversation to collaborators Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants