12.04 - Vagrant up timeout

16
2014-04
  • lozadaOmr

    I'm running Ubuntu 12.04 , and trying to use Vagrant 1.4.3 to run a virtual server, my Virtual Box version is 4.3.6

    What I'm trying to do is create a virtual server using precise32.box , After executing the command

    vagrant box add base http://files.vagrantup.com/precise32.box

    There are no errors, then I proceed to

    vagrant init

    and edit the generated Vagrantfile

    The last step was now just to simply Vagrant up so the VM will be running.

    Unfortunately I got the error

    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. This can mean a number of things.

    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.

    What is strange is when I try to view it in Virtual Box, it states that it is running.

  • Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

    Related Question

    12.04 - Vagrant: VirtualBox: Headless Ubuntu: How to set up bridged networking?
  • Jay Godse

    I am trying to set up a Vagrant VirtualBox (v4.2.4) virtual machine with a Ubuntu "box" which I got from www.vagrantbox.es.

    I was able to use Vagrant to set it up as a headless box and start it, and then I was able to ssh locally into it (using 127.0.0.1:2222), connect the internet and sun a bunch of "sudo apt-get" commands to update it and install new software.

    I would like to be able to access this virtual machine on my network, so I need a bridged network adapter for the virtual box. When I went to the VirtualBox console for this device, and tried to set up bridged networking, it said that I needed the "guest additions". I tried to install them and I couldn't get the .iso file for the guest additions.

    I went elsewhere on the 'net and it seems that I had to run "sudo apt-get install virtualbox-guest-additions-iso" from the virtual machine in order to get bridged networking. I tried this, and it installed fine after a couple of reboots. I then tried to set up bridged networking again (VirtualBox console to Devices->Network Adaptors...) but it didn't work.

    -------------- EDIT more clarification-------------------

    My Vagrantfile looks like this:

    # -*- mode: ruby -*-
    # vi: set ft=ruby :
    
    Vagrant::Config.run do |config|
      config.vm.box = "ubuntu1204"
      config.vm.box_url = "http://dl.dropbox.com/u/4031118/Vagrant/ubuntu-12.04.1-server-i686-virtual.box"
      config.vm.network :bridged
    end
    

    When I tried "vagrant up", here is what I got:

    C:\Users\Jay\vagrantprojects\vagrant_guide>vagrant up
    [default] VM already created. Booting if it's not already running...
    [default] Clearing any previously set forwarded ports...
    [default] Forwarding ports...
    [default] -- 22 => 2222 (adapter 1)
    [default] Creating shared folders metadata...
    [default] Clearing any previously set network interfaces...
    [default] Preparing network interfaces based on configuration...
    [default] Booting VM...
    [default] Waiting for VM to boot. This can take a few minutes.
    [default] Failed to connect to VM!
    Failed to connect to VM via SSH. Please verify the VM successfully booted
    by looking at the VirtualBox GUI.
    
    C:\Users\Jay\vagrantprojects\vagrant_guide>vagrant ssh
    `vagrant ssh` isn't available on the Windows platform. You are still able
    to SSH into the virtual machine if you get a Windows SSH client (such as
    PuTTY). The authentication information is shown below:
    
    Host: 127.0.0.1
    Port: 2222
    Username: vagrant
    Private key: C:/Users/Jay/.vagrant.d/insecure_private_key
    

    I tried to ssh to the VM using putty.exe, but it would not let me in. So what do I need to do?

    ---- end EDIT ------------------------------------------------------

    What, or what else do I need to do to set up bridged networking in this virtual machine?

    I appreciate any help that I can get.


  • Related Answers
  • jefflunt

    If you're using Vagrant, then you should be able to specify the bridged network option in your Vagrantfile, rather than trying to configure it by hand on the VM itself.

    Here's a sample Vagrantfile (note line #8) - just change your config.vm.network line to be:

    config.vm.network :bridged
    

    See the docs for reference.

    The Vagrantfile just goes at the root of your project - the same folder from where you run vagrant up and such.

    Also, you can ssh into the box using vagrant ssh - you don't need to specify the IP address and port - vagrant will take its config file (Vagrantfile - see a theme here? - most everything having to do with the basic VM config goes in the Vagrantfile), and it will take care of creating, configuring, connecting, and tearing down the VM.