-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Handle new 'predictable' network interface naming style #7241
Handle new 'predictable' network interface naming style #7241
Conversation
Explicitly discover the names of the ethernet interfaces, and don't assume that they are eth0, eth1 etc as this does not hold true under newer systemd-based distributions.
I would love to be able to try this out; it looks like it fixes a number of the issues I am having building an Ubuntu 16.04 LTS dev VM. Where do the scripts live to build a binary release locally? I tried building the vagrant gem from source and installing it along with its dependencies. But when I run it, I just get the 'vagrant doesn't run as a gem anymore' warnings. |
Hey @cnk - not sure on the process for doing a local build but you should be able to run it from the checked out source tree: https://github.com/mitchellh/vagrant/wiki/Installing-Vagrant-from-Source |
Yeh I figured that out. I still need to figure out how to run with a salt provisioner. @dougneal I am still getting the error from |
I ran into that too, it's because the image doesn't have |
if type == :stdout then | ||
data.split("\n").each do |line| | ||
if (line =~ /^\/sys\/class\/net\/(enp[0-9]+s[0-9]+|eth[0-9]+)$/) then | ||
kernel_ifnames << $1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is technically correct. My systemd based machine (though not Ubuntu) has an ethernet adapter named enp0s31f6
. This wouldn't be caught by this RE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would only be for debian-based guests... is your machine running a Debian derivative, or something else (e.g. RHEL)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debian GNU/Linux stretch/sid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name format appears to be described in systemd's udev-builtin-net_id.c
+1 for this fix |
Here's a workaround for those interested in getting a Xenial base box working prior to this PR getting pulled in: geerlingguy/packer-boxes#1 (comment) |
for now I use the following script in ubuntu/xenial64, after that I can reload box with provisioning
|
I created a simpler pull request #7253 to fix this issue and also a patch to vagrant 1.8.1 #7253 (comment) |
when is this going to be merged? |
Just tested it out with
and it works. |
Explicitly discover the names of the ethernet interfaces, and don't assume that they are eth0, eth1 etc as this does not hold true under newer systemd-based distributions.
Addresses: #7155 #6871