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

Get provisioning working on Xenial #1

Closed
geerlingguy opened this issue Apr 21, 2016 · 14 comments
Closed

Get provisioning working on Xenial #1

geerlingguy opened this issue Apr 21, 2016 · 14 comments

Comments

@geerlingguy
Copy link
Owner

See upstream(ish) PR: chef/bento#545

There are probably few changes required to the boot sequence and kickstart config.

@geerlingguy
Copy link
Owner Author

Upstream issue to get Ansible's official PPA working on Xenial: ansible/ansible#15524

For now, I think I can install Ansible differently, and we should be okay.

@geerlingguy
Copy link
Owner Author

geerlingguy commented Apr 21, 2016

Maybe:

# Install pip.
apt -y install python-setuptools python-dev
easy_install pip

# Install Ansible.
pip install ansible

Otherwise I think Xenial has pip via python-pip as well.

@geerlingguy
Copy link
Owner Author

I think I've run into: hashicorp/vagrant#6871

@geerlingguy
Copy link
Owner Author

geerlingguy commented Apr 21, 2016

Adding net.ifnames=0 biosdevname=0 to the boot command didn't seem to help; if inside the built machine, ifconfig doesn't list an eth0 interface :/

If I remove those two lines, I get an enp0s3 interface, which allows Packer to complete the build by connecting over SSH.

Tried from http://unix.stackexchange.com/a/88619/16194, but might need to do some other hackish thing, like was suggested in the original issue in bento.

@geerlingguy
Copy link
Owner Author

Trying ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules to turn off the naming scheme for now. Will add to cleanup.sh if it works.

@geerlingguy
Copy link
Owner Author

That didn't work. And neither did echo 'GRUB_CMDLINE_LINUX="net.ifnames=0"' >>/etc/default/grub (both tested after a reboot).

@geerlingguy
Copy link
Owner Author

geerlingguy commented Apr 21, 2016

So some other places to read:

Trying this now:

echo 'GRUB_CMDLINE_LINUX="biosdevname=0 net.ifnames=0"' >> /etc/default/grub
sudo grub-mkconfig -o /boot/grub/grub.cfg
sudo shutdown now

@geerlingguy
Copy link
Owner Author

Using the above gives the same result as my testing earlier—no eth[x] interfaces are created (ifconfig just lists the lo interface).

@geerlingguy
Copy link
Owner Author

Er, actually there is an eth0 and eth1. Needed to use sudo ifconfig -a.

@geerlingguy
Copy link
Owner Author

So the networking fix looks to be a combination of:

  1. Add GRUB_CMDLINE_LINUX="biosdevname=0 net.ifnames=0" to /etc/default/grub

  2. Run sudo grub-mkconfig -o /boot/grub/grub.cfg and reboot

  3. Edit /etc/network/interfaces and add in (replacing the existing default adapter1):

      auto eth0
      iface eth1 inet dhcp
      auto eth1
      iface eth1 inet manual
    
  4. Restart

  5. vagrant up should complete successfully.

1 The definition of a semi-complete eth1 adapter should not be required, but is currently because Ubuntu 16.04 (unlike previous releases) balks when there's an error message output during it's run of ifdown eth1. There's a commit that fixes this in vagrant master, but it's not in a stable release yet: hashicorp/vagrant@0505771

Also, the overarching problem is that Vagrant currently doesn't handle predictable network interfaces, which are now used by most of the major distros; there's a PR (hashicorp/vagrant#7241) which aims to add in support, but it could be some time before that gets in.

I'm testing adding in all the above to cleanup.sh for now.

@sl4m
Copy link

sl4m commented Apr 27, 2016

@geerlingguy Had followed your steps in #1 (comment), but it has a mistake. The edit to /etc/network/interfaces should be:

auto eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet manual

I figured it out from 6ff7948. Thanks for posting this fix.

@blowski
Copy link

blowski commented Apr 27, 2016

For future reference, having done the first two steps mentioned above:

  1. Add GRUB_CMDLINE_LINUX="biosdevname=0 net.ifnames=0" to /etc/default/grub
  2. Run sudo grub-mkconfig -o /boot/grub/grub.cfg and reboot

The first time I booted the VM, it hung for about 2 minutes on a message about "Started Journal Service". Then it was all fine and it fixed the problem. Future boots were normal.

Thanks for the fix.

@dsbaars
Copy link

dsbaars commented Apr 27, 2016

I "fixed"/worked around this by using the networking.d folder:

echo "auto eth1" >> /etc/network/interfaces.d/eth1
echo "iface eth1 inet manual" >> /etc/network/interfaces.d/eth1

echo "auto eth2" >> /etc/network/interfaces.d/eth2
echo "iface eth2 inet manual" >> /etc/network/interfaces.d/eth2

echo "auto eth3" >> /etc/network/interfaces.d/eth3
echo "iface eth3 inet manual" >> /etc/network/interfaces.d/eth3

@ikekwame
Copy link

ikekwame commented Nov 2, 2016

@dsbaars your fix does not work for me

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

5 participants