Ubuntu 14.04 guest, dual homed, NAT and host-only adapters: booting is fast once, then it's forever slow

663 views
Skip to first unread message

Florin Andrei

unread,
Aug 28, 2014, 9:38:05 PM8/28/14
to vagra...@googlegroups.com
Host is: OS X 10.9, VirtualBox 4.3.14, Vagrant 1.6.3

Vagrantfile:

###################################################
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "ubuntu-1404-server-lts"

  config.ssh.username = "XXXXXXXXXXXXX"
  config.ssh.private_key_path = "XXXXXXXXXXXXXX"
  config.ssh.forward_x11 = true

  config.vm.synced_folder "vagrant", "/vagrant"

  config.vm.network "private_network", type: "dhcp", :adapter => 2
end
###################################################

Booting was very snappy until I've added the last line (the private network). Then all hell broke loose. It booted up quickly once, then all subsequent boot-ups were very slow.

If I do now "vagrant up", it's very slow. It stumbles here (screenshot taken with a Remote Desktop client):


It gets to "Starting configure virtual network devices                [ OK ]", it prints out that whole line at once just fine and quick, but after that it waits for a while.
Then it prints "Waiting for network configuration..." and it waits again for a while.
Then it prints "Waiting for up to 60 more seconds for network configuration..." and it waits again for a while.

Then it says "Booting system without full network configuration" and resumes booting at normal speed.

All these waits add up and make the boot process extremely slow, maybe 3...5 minutes total.

I've commented out the private network statement in Vagrantfile, and it's still slow. I've launched the VM outside of Vagrant (direct from VBox) and it's still slow. Only eth0 is activated, but /etc/network/interfaces looks like this:

##############################################
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

#auto eth1
#iface eth1 inet dhcp
#VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify.
auto eth1
iface eth1 inet dhcp
    post-up route del default dev $IFACE
#VAGRANT-END
##############################################

I've removed the VAGRANT section from the end and did a reboot, it was super-quick.

Powered off the VM, launched from Vagrant, again super-quick.

Powered off again, edited Vagrantfile, uncommented the line with "private_network", up the VM from Vagrant - it was super-quick ONCE. /etc/network/interfaces looked just like above, with the Vagrant part re-added at the end.

Then I did "sudo reboot" in the VM, and it was slow again, and it remains slow forever and ever after that.

All of the above is very consistent and reproducible. If I use two network interfaces, one NAT, the other host-only, booting up is quick exactly once, then it's slow forever.

I've edited /etc/default/ntpdate and removed everything from NTPSERVERS...

NTPSERVERS=""

...but it makes no difference.

Uh... please help, I guess? :)

Alvaro Miranda Aguilera

unread,
Aug 28, 2014, 9:49:02 PM8/28/14
to vagra...@googlegroups.com
hello,  from where this configuration is coming from?

I check on the manual vagrantup.com and is a little bit different the line.




--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Florin Andrei

unread,
Aug 28, 2014, 9:53:15 PM8/28/14
to vagra...@googlegroups.com
Most of it is stock. The line for the second interface at the end is copied from somewhere on the Internet. Is there something wrong with it?


--
You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/pF1prO8La8A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Alvaro Miranda Aguilera

unread,
Aug 28, 2014, 10:00:05 PM8/28/14
to vagra...@googlegroups.com
I will go first as the documentation state:

http://docs.vagrantup.com/v2/networking/index.html


config.vm.network "private_network", type: "dhcp"

not sure about the final part in your one


Florin Andrei

unread,
Sep 3, 2014, 6:38:13 PM9/3/14
to vagra...@googlegroups.com
I've done this and it's slow (except the first boot):

config.vm.network "private_network", type: "dhcp"

I've done this and it's slow (except the first boot):

config.vm.network "public_network"

The two are pretty different - one sets up the second interface on a private network, the other on a public. But the behavior is the same.

Not sure what's going on here. Again, Ubuntu 14.04 guest on OS X 10.9 host, VirtualBox 4.3.14, Vagrant 1.6.3. The instance boots quickly the first time, but after that booting up gets stuck for a few minutes after "Starting configure virtual network devices                [ OK ]". After the booting sequence is complete, the instances are perfectly fine.

I can't possibly be the only one having this issue.

Alvaro Miranda Aguilera

unread,
Sep 3, 2014, 6:53:35 PM9/3/14
to vagra...@googlegroups.com
for private network, you should be able to use a fixed ip, rite?

that should be quicker.




--

Bruce Wang

unread,
Sep 4, 2014, 12:27:22 AM9/4/14
to vagra...@googlegroups.com
What about try to use official box from vagrantcloud https://vagrantcloud.com/ubuntu/trusty64

i.e. change your Vagrant file to use: config.vm.box = "ubuntu/trusty64"

And try to not use any custom network setting first.

HTH

Florin Andrei

unread,
Sep 4, 2014, 1:55:18 PM9/4/14
to vagra...@googlegroups.com
Same behavior with the official box. Default networking - always fast, no matter how many times I reboot.

But if I add...

config.vm.network "private_network", type: "dhcp"

...then it's fast the first time, and then all subsequent boot ups are slow. It gets stuck at "waiting 120 seconds for network device"


...then prints out "net device info", and then gets stuck again at "waiting up to 60 more seconds for network configuration"



--
You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/pF1prO8La8A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Florin Andrei

unread,
Sep 4, 2014, 2:14:34 PM9/4/14
to vagra...@googlegroups.com
I've changed the instances to fixed private addresses, mainly because it works better with what I'm doing now.

config.vm.network "private_network", ip: "172.28.128.205"

And here's the weird thing: it was very slow again, just like before, only the first time the instances booted up. But forever after that, the instances are booting up quickly.

I looked around the first time, when it was slow. ifconfig looked normal, route -n looked normal, /etc/network/interfaces looked normal. After subsequent reboots, all those things looked unchanged.

I'm happy that my instances are fast now, but why the weird delay with DHCP on private network, and why is then the first boot different when enabling/disabling DHCP with private networking?


--
You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/pF1prO8La8A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Alvaro Miranda Aguilera

unread,
Sep 4, 2014, 6:35:04 PM9/4/14
to vagra...@googlegroups.com
I can say this is the cause, but, I can say that some SO will check there is no conflict, so they will get the IP, wait for conflict, ping the GW/ARP, etc, do some sanity checks that can explain the dealy

in EL (Rh/centos/oracle) this is what happen.

What you can do to test is this:

ps aux | grep -i dhcp

kill any process you have there

ifconfig eth1 down

from here, do 2 test.

a. service network restart

and take time. then do the same to clean dhcp, and remove ip from interface


b. dhcp-client eth1, seems in ubuntu is dhclient eth1

at least this should confirm where is the delay.

alvaro.


don...@crowdtap.com

unread,
Sep 11, 2014, 11:19:19 AM9/11/14
to vagra...@googlegroups.com
I want to throw my hat into the ring and say that I am also having roughly exactly this problem and would love a better solution.

Setting a static IP is not a great solution for me because I am doing ~layered chef cookbook development where I want to bake an image/box with the results of the base cookbook config and then use that to develop on top of without reconverging from scratch - all of which to say there may be an unpredictable number of VMs from the same box running at a time. 
Reply all
Reply to author
Forward
0 new messages