0

I have the following Vagranfile. When I vagrant up, I'm getting the following error. However, if I switch to use a config.vm.network "public_network", everything works fine.

But I still want to use config.vm.network "private_network" so I can assign fixed IP address for development.

[Error]

    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection aborted. Retrying...
    default: Warning: Connection aborted. Retrying...

[Vagrantfile]

Vagrant.configure("2") do |config|
  config.vm.box = "pef"

  config.vm.network "private_network", ip: "192.168.33.12"
  #config.vm.network "public_network"

  config.vm.synced_folder "C:/Users/user1/myprj", "/home/vagrant"

  config.vm.provider "virtualbox" do |vb|
     # Display the VirtualBox GUI when booting the machine
     vb.gui = true

     # Customize the amount of memory on the VM:
     vb.memory = "1024"

     # For host-only adapter
     vb.customize ["modifyvm", :id, "--uartmode1", "disconnected" ]
     vb.customize ["modifyvm", :id, "--nictype1", "Am79C973"]
     vb.customize ["modifyvm", :id, "--nictype2", "Am79C973"]
  end
end
user1187968
  • 7,154
  • 16
  • 81
  • 152

1 Answers1

0

I had this issue which is confusing. First thing you need to know, is the problem causing timeout.

If you're using VirtualBox, you can add this to your VagrantFile :

   config.vm.provider "virtualbox" do |vb|
  #   # Display the VirtualBox GUI when booting the machine
     vb.gui = true

That will launch VirtualBox window and help you understand the potential error you have during the booting process of your VM.

In my case, I tried several things and ended up raising Vagrant time out to 600 :

  config.vm.boot_timeout = 600 

You can also read to this feed on StackOverflow , it describes the same issue : Vagrant up timeout

gallien
  • 121
  • 1
  • 3
  • 11