Code Monkey home page Code Monkey logo

Comments (14)

geerlingguy avatar geerlingguy commented on August 29, 2024 1

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.

from packer-boxes.

sl4m avatar sl4m commented on August 29, 2024 1

@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.

from packer-boxes.

blowski avatar blowski commented on August 29, 2024 1

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.

from packer-boxes.

geerlingguy avatar geerlingguy commented on August 29, 2024

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.

from packer-boxes.

geerlingguy avatar geerlingguy commented on August 29, 2024

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.

from packer-boxes.

geerlingguy avatar geerlingguy commented on August 29, 2024

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

from packer-boxes.

geerlingguy avatar geerlingguy commented on August 29, 2024

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.

from packer-boxes.

geerlingguy avatar geerlingguy commented on August 29, 2024

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.

from packer-boxes.

geerlingguy avatar geerlingguy commented on August 29, 2024

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

from packer-boxes.

geerlingguy avatar geerlingguy commented on August 29, 2024

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

from packer-boxes.

geerlingguy avatar geerlingguy commented on August 29, 2024

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

from packer-boxes.

geerlingguy avatar geerlingguy commented on August 29, 2024

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

from packer-boxes.

dsbaars avatar dsbaars commented on August 29, 2024

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

from packer-boxes.

ikekwame avatar ikekwame commented on August 29, 2024

@dsbaars your fix does not work for me

from packer-boxes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.