1

I am trying to run vagrant inside a VM and unfortunately it fails at random counts (It used to fail every other time). But when I set the log level to debug and run vagrant up it does not error out. Looking for advice on how to debug this issue.

host machine: rhel 6.5 (Santiago) 2 core 4G ram, ESXi 5.1 guest machine: rhel 6.5 (Guest Additions Version: 4.1.18)/centOS 6.5 (Guest Additions Version: 4.3.8)

Vagrant version - 1.6.5 VirtualBox 4.3.20 Chef Development Kit Version: 0.3.6 vagrant plugins vagrant-berkshelf (4.0.2) vagrant-login (1.0.1, system) vagrant-omnibus (1.4.1) vagrant-share (1.1.3, system)

failed run

Bringing machine 'default' up with 'virtualbox' provider...
    default: The Berkshelf shelf is at "/root/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150206-18541-kdy12t-default"
==> default: Sharing cookbooks with VM
==> default: Importing base box 'rhel65-1.0.0'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: XXXXXXXXXX_1423257225720_47393
==> default: Clearing any previously set forwarded ports...
==> default: Updating Vagrant's Berkshelf...
==> default: Resolving cookbook dependencies...
==> default: Fetching 'XXXXXXXXXX' from source at .
==> default: Using XXXXXXXXXX (1.2.0) from source at .
==> default: Vendoring XXXXXXXXXX (1.2.0) to /root/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150206-18541-kdy12t-default/XXXXXXXXXX
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 => 2200 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2200
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
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.

UPDATE: I took a snapshot of my VM, based on the instructions from this blog: http://www.dedoimedo.com/computers/virtualbox-screenshot.html

The error I get in the guest VM:

MP-BIOS bug: 8254 timer not connected to IO-APIC
kernel panic - not syncing: IO-APIC + timer doesn't work! Boot with apic-debug and send a report. Then try booting with the 'noapic' option.

pid: 1, comm: swapper Tainted: G W -------- 2.6.32-431.el6.x86_64 #1
nimesh
  • 93
  • 1
  • 1
  • 7
  • It might be the way my infrastructure is setup. To get it working consistently I had turn ioapic: 'off'. – nimesh Mar 12 '15 at 19:45

3 Answers3

3

have a look here Vagrant stuck connection timeout retrying it should give you all the answers you need.

What I would recommend to do in the first place is:

  1. Upgrade your Vagrant to the latest version right now it looks it is 1.7.2 and you are using 1.6.5.

  2. Add this to your Vagrantfile

    Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    
      config.vm.provider "virtualbox" do |vb|
        vb.gui = true
      end
    
    end
    

    It will make VBox to start your Vagrant build VM in GUI mode. Make sure it starts properly and you are able to log in to it with username: vagrant password: vagrant (this should be standard credentials set up on your base box).

  3. Then try to SSH to your running VM from host system. Using the same vagrant/vagrant credentials.

  4. If 2 & 3 are working fine then you could try to add this to your Vagrantfile: (you can leave the previously specified GUI for VBox there as well if you wish)

    Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    
      config.ssh.username = "vagrant"
      config.ssh.password = "vagrant"
    
    end
    

vagrant up your VM again and see if this will work.

  1. If all previous steps won't work for you I would go through all recommendations in the link I've provided above. Mainly VT-x enabled in BIOS, firewall off settings on Guest VM.

Hope this helps a bit. I am also starting with Vagrant now and it is not as easy as I thought it will be :) Good luck !!

Community
  • 1
  • 1
  • Thanks for your post. It contains a lot of useful information but unfortunately none would work for me. – nimesh Feb 11 '15 at 20:33
  • Hi, so I understand that all the step including SSH to your VM from host system is working and you still get Connetcion timeout error right?? And then none of the guides in the post I've linked does not work either ?? Not sure where this base box is from maybe it is wrongly created ?? Can you try to add to your Vagrant official boxes and see if you will make them work namely ubuntu/trusty64 and/or ubuntu/trusty32. You can do that easily by issuing 'vagrant box add ubuntu/trusty64' then try to create VM based on this base box and see if this will work for you?? – Arek Czarnogłowski Feb 12 '15 at 13:03
  • I should have been a little more elaborate on my earlier comment, I apologize. I had already tried all the steps you listed. I couldnt try step 2 since the environment I am testing on is locked down. Even with the community boxes we run into the same issue. I am trying to figure out why I am not able to consistently bring up boxes. I get a connection timeout error after every 10 to 15 successful runs.. We even installed zabbix to see if we are running out of memory in the host VM when vagrant errors out. They have on an average around 1.7 G of memory free when they error out. – nimesh Feb 16 '15 at 17:01
  • Sorry for the late reply. This looks like a networking issue to me then. While you can make some error creating your own base box when it comes to community ones I am pretty sure they are correctly set up. Not sure what is your environment you are working on as you write it is 'locked down'. Maybe there are some rules blocking you from connecting to those VMs ? Just an idea. Sorry I could not be of much help. – Arek Czarnogłowski Feb 25 '15 at 20:13
0

After trying various options available on different portals, Finally, I did avagrant destroy followed by vagrant up and it worked for me... :)

Ravindra
  • 101
  • 2
0

In VMbox got to setting -> system -> motherboard there you will find extended features "Disable" all the features. Now start at the boot time press esc after the logo disappear. there you will get 3 options in that select the second option having "recovery" written and your system will work. By this your error "MP-BIOS bug: 8254 timer not connected to IO-APIC kernel panic - not syncing: IO-APIC + timer doesn't work! Boot with apic-debug and send a report. Then try booting with the 'noapic' option." is solved.