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

Remove hack used to disable Predictable Network Interface naming #2

Closed
geerlingguy opened this issue Apr 22, 2016 · 15 comments
Closed

Comments

@geerlingguy
Copy link
Owner

@geerlingguy
Copy link
Owner Author

Note: it seems VirtualBox 5.1.2 and Vagrant 1.8.5 with a freshly-built Packer box (not just this one, but all my boxes, with the exact same config that was working with VirtualBox 5.0.24) is resulting in the host-only network/private network interface not being brought up.

Looking at debug level output, it seems the hostonly adapter is brought up correctly:

...
Name:            vboxnet26
GUID:            786f6276-656e-4274-b600-0a002700001a
DHCP:            Disabled
IPAddress:       172.16.3.1
NetworkMask:     255.255.255.0
IPV6Address:     
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: 0a:00:27:00:00:1a
MediumType:      Ethernet
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-vboxnet26
...
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 0
DEBUG network: Adapter configuration: {:adapter=>2, :hostonly=>"vboxnet26", :mac_address=>nil, :nic_type=>nil, :type=>:hostonly}
 INFO network: Enabling adapters...
 INFO interface: output: Preparing network interfaces based on configuration...
 INFO interface: output: ==> ubuntu1604: Preparing network interfaces based on configuration...
==> ubuntu1604: Preparing network interfaces based on configuration...
 INFO interface: detail: Adapter 1: nat
 INFO interface: detail:     ubuntu1604: Adapter 1: nat
    ubuntu1604: Adapter 1: nat
 INFO interface: detail: Adapter 2: hostonly
 INFO interface: detail:     ubuntu1604: Adapter 2: hostonly
    ubuntu1604: Adapter 2: hostonly
 INFO subprocess: Starting process: ["/usr/local/bin/VBoxManage", "modifyvm", "a6adba53-7e78-47c2-8c81-8aa67e3e42ed", "--nic1", "nat", "--nic2", "hostonly", "--hostonlyadapter2", "vboxnet26", "--cableconnected2", "on"]
DEBUG subprocess: Command not in installer, not touching env vars.
 INFO subprocess: Command not in installer, restoring original environment...
DEBUG subprocess: Selecting on IO
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 0
 INFO warden: Calling IN action: #<VagrantPlugins::ProviderVirtualBox::Action::NetworkFixIPv6:0x00000102976320>
 INFO warden: Calling IN action: #<VagrantPlugins::ProviderVirtualBox::Action::ForwardPorts:0x00000100e0f898>
 INFO interface: output: Forwarding ports...
 INFO interface: output: ==> ubuntu1604: Forwarding ports...
==> ubuntu1604: Forwarding ports...

The output from the vagrant up command that now fails:

$ vagrant up ubuntu1604 --provider=virtualbox
Bringing machine 'ubuntu1604' up with 'virtualbox' provider...
==> ubuntu1604: Clearing any previously set forwarded ports...
==> ubuntu1604: Pruning invalid NFS exports. Administrator privileges will be required...
==> ubuntu1604: Clearing any previously set network interfaces...
==> ubuntu1604: Preparing network interfaces based on configuration...
    ubuntu1604: Adapter 1: nat
    ubuntu1604: Adapter 2: hostonly
==> ubuntu1604: Forwarding ports...
    ubuntu1604: 22 (guest) => 2222 (host) (adapter 1)
==> ubuntu1604: Running 'pre-boot' VM customizations...
==> ubuntu1604: Booting VM...
==> ubuntu1604: Waiting for machine to boot. This may take a few minutes...
    ubuntu1604: SSH address: 127.0.0.1:2222
    ubuntu1604: SSH username: vagrant
    ubuntu1604: SSH auth method: private key
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.

@geerlingguy
Copy link
Owner Author

During boot, if I inspect the VirtualBox console using v.gui = true, then I see the following timeout after 5 minutes:

a start job is running for raise network interfaces

Pictorially:

start-job-running

So something's not getting configured inside the VM correctly.

Glancing at the VM settings inside VirtualBox's GUI, everything seems correct with the 2nd network interface/adapter:

network-adapter-2-virtualbox

Inside the VM:

  • ip a returns lo, eth0, and eth1, but none have an IP4 address.
  • /etc/network/interfaces has an entry for auto eth1 with iface eth1 inet manual

I'm going to bring up a working 16.04 VM with my latest (old) published release and see if I can spot any differences.

@geerlingguy
Copy link
Owner Author

I'm going to try to revert the hack from #1 and see if just doing that works with Vagrant 1.8.5... maybe the manual network changes were causing an issue (but it seems they shouldn't be an issue, since the same config worked and still works in the previous build for the same box.

@geerlingguy
Copy link
Owner Author

Removing the hack seems to work-ish... but it still doesn't allow SSH to connect.

Tried running sudo ifup enp0s3 but that just looped in the 'waiting for DHCP' segment for a while.

I'm wondering if hashicorp/vagrant#6683 is still not fully resolved :-/

But the weirdest thing is, why is the older box that was generated with VirtualBox 5.0.24 working fine in 5.1.2, but a box with the exact same config generated in 5.1.2 isn't?

I'm also going to switch back to Ubuntu 16.04.0 (I switched to .1) and see if that helps. But it seems like it won't—Vagrant isn't happy connecting to any of my new boxes, CentOS 6/7, Ubuntu 12/14/16, if I build them in 5.1.2.

@Jalle19
Copy link

Jalle19 commented Aug 9, 2016

Just stumbled over the same issue myself (networking broken after updating to Vagrant 1.8.5 and VirtualBox 5.1). I'll downgrade and see what happens.

@geerlingguy
Copy link
Owner Author

@Jalle19 - :(

Yeah, after spending about 4 hours on this a couple weeks ago, I haven't had the time to devote to digging deep and finding the exact issue.

@Jalle19
Copy link

Jalle19 commented Aug 10, 2016

Me neither, I downgraded back to Vagrant 1.8.4 and VirtualBox 5.0.22 for now (newer VirtualBox 5.0 releases have the networking bug which can cause provisioning to stall unless you start pinging something from the virtual machine).

@chrisroberts
Copy link

Hi @geerlingguy! I'm curious if the problem you're hitting may be resolved by hashicorp/vagrant#7705. If you have a chance to give it a try, I'd be interested to know if it fixes things up. Thanks!

@geerlingguy
Copy link
Owner Author

@chrisroberts - Unfortunately with some crazy life events happening right now, I'm going to have to wait to test things out—if there's a new Vagrant release (1.8.6) soon, that could expedite things, but until that happens I am putting updating any of my base boxes on hold, because even if it does solve the issue (it seems like it will), I'd rather not require those using my public boxes have to apply patches to Vagrant to keep working.

For now, the existing versions of my boxes are working, and I've already burned a bit too much time on this issue :P

@geerlingguy
Copy link
Owner Author

But THANK YOU for posting that, and for referencing the upstream issue. I think that could be the problem, just looking over the details, what changed, etc.

@MiLk
Copy link

MiLk commented Sep 6, 2016

I had a similar issue where the "Cable connected" checkbox was not checked for the NAT interface, and by generating the box with VirtualBox 5.0.26, it's now working.

@geerlingguy
Copy link
Owner Author

The hack was removed in 9455d86, and I'm going to leave it out; it seems VirtualBox is working fine now, though I'm hitting a snag with VMware Fusion 8.5 builds. So I'll open a separate issue for that.

@MiLk
Copy link

MiLk commented Oct 28, 2016

I confirm that it has been fixed in VirtualBox 5.1.6.

@geerlingguy
Copy link
Owner Author

@MiLk - Thanks! I just tested in 5.1.8 and built a new base box, and it seems to be working well now.

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

4 participants