Git Product home page Git Product logo

Comments (9)

terrywang avatar terrywang commented on August 23, 2024

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 have 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 its own code, an easy temporary workaround is to pass net.ifnames=0 to kernel boot parameters to revert to the old NIC naming scheme.

That's why I updated the Arch Linux and Oracle Linux 7.0 base box with the information.

from vagrantboxes.

root-io avatar root-io commented on August 23, 2024

Thanks for clarification :)

from vagrantboxes.

ibizaman avatar ibizaman commented on August 23, 2024

I wanted to set a private_network in my Vagrantfile and vagrant complained that eth1 did not exist.
My goal was to ssh in the vagrant box with putty so I needed an ip (so no vagrant ssh).

But there's a workaround: by parsing the output of vagrant ssh-config, you can get the ip address and the port (127.0.0.1 and 2222 for me). So no need for eth1!

from vagrantboxes.

terrywang avatar terrywang commented on August 23, 2024

@ibizaman 127.0.0.1 port 2222 was the default Vagrant networking mode. It is set through a port forwarding rule of the first virtual NIC. It is how vagrant ssh connects to the vagrant box.

Please note private network in Vagrant is different networking mode. Private network is equivalent to Host-only networking in VirtualBox.

from vagrantboxes.

ibizaman avatar ibizaman commented on August 23, 2024

My bad, you are totally right!

I suppose the port changes when there are multiple vagrant boxes active? Parsing vagrant ssh-config should be useful then, right?

from vagrantboxes.

terrywang avatar terrywang commented on August 23, 2024

@ibizaman You are right. I haven't used vagrant ssh-config to be honest ;-D

When using port forwarding with NAT networking, we can use auto_correct in Vagrantfile to auto correct any collisions. Like below.

Vagrant.configure("2") do |config|
  config.vm.network "forwarded_port", guest: 80, host: 8080,
    auto_correct: true
end

In addition, VAGRANT_LOG=info vagrant up or vagrant up --debug should also be helpful if things like that happen. Hope it helps.

from vagrantboxes.

seekshiva avatar seekshiva commented on August 23, 2024

@terrywang I'm a bit of a noob in this. How do I set the kernel boot parameters?

from vagrantboxes.

root-io avatar root-io commented on August 23, 2024

@seekshiva

$ sed -i -e "s/GRUB_CMDLINE_LINUX=\"\"/GRUB_CMDLINE_LINUX=\"net.ifnames=0\"/g" /etc/default/grub
$ grub-mkconfig -o /boot/grub/grub.cfg

from vagrantboxes.

lmmarsano avatar lmmarsano commented on August 23, 2024

@terrywang

pass net.ifnames=0 to kernel boot parameters

Another solution is

sudo ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules

PS
I see a symbolic link from /etc/udev/rules.d/80-net-name-slot.rules to /dev/null.
This was the old name for 80-net-setup-link.rules, and it no longer works, evidently.
According to systemd documentation, the new name is the one I wrote above; I suggest updating the file name.
Anyone curious should see the documentation for all 4 solutions, which include terrywang's.

I hope vagrant figures out systemd soon, so we can forget this.

from vagrantboxes.

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.