4

Anyone know what is going on with Vagrant?

Using Windows 10, VScode, Virtualbox 6.1.10

i have done googling and not found anything helpful

one person said to Use config.ssh.insert_key = false in your Vagrantfile and then try.

but doing so did not work (or not sure where to put it in my vagrantfile)

VAB: Booting VM...
==> VAB: Waiting for machine to boot. This may take a few minutes...
VAB: SSH address: 127.0.0.1:2222
VAB: SSH username: vagrant
VAB: SSH auth method: private key
VAB: Warning: Remote connection disconnect. Retrying...
VAB: Warning: Remote connection disconnect. Retrying...
VAB: Warning: Remote connection disconnect. Retrying...
VAB: Warning: Remote connection disconnect. Retrying...
VAB: Warning: Remote connection disconnect. Retrying...
VAB: Warning: Remote connection disconnect. Retrying...
VAB: Warning: Remote connection disconnect. Retrying...
VAB: Warning: Remote connection disconnect. Retrying...
VAB: Warning: Remote connection disconnect. Retrying...
VAB: Warning: Remote connection disconnect. Retrying...
VAB: Warning: Remote connection disconnect. Retrying...
VAB: Warning: Remote connection disconnect. Retrying...
VAB: Warning: Remote connection disconnect. Retrying...
VAB: Warning: Remote connection disconnect. Retrying...
VAB: Warning: Remote connection disconnect. Retrying...
VAB: Warning: Remote connection disconnect. Retrying...
VAB: Warning: Remote connection disconnect. Retrying...
VAB: Warning: Remote connection disconnect. Retrying...
VAB: Warning: Remote connection disconnect. Retrying...
VAB: Warning: Remote connection disconnect. Retrying...
VAB: Warning: Remote connection disconnect. Retrying...
VAB: Warning: Remote connection disconnect. Retrying...
VAB: Warning: Remote connection disconnect. Retrying...
VAB: Warning: Remote connection disconnect. Retrying...
VAB: Warning: Remote connection disconnect. Retrying...
VAB: Warning: Remote connection disconnect. 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.

here is the vagrant file without any modifications.

# -*- mode: ruby -*-
# vi: set ft=ruby :

require 'json'
require 'yaml'

VAGRANTFILE_API_VERSION ||= "2"
confDir = $confDir ||= File.expand_path("vendor/laravel/homestead", File.dirname(__FILE__))

homesteadYamlPath = File.expand_path("Homestead.yaml", File.dirname(__FILE__))
homesteadJsonPath = File.expand_path("Homestead.json", File.dirname(__FILE__))
afterScriptPath = "after.sh"
customizationScriptPath = "user-customizations.sh"
aliasesPath = "aliases"

require File.expand_path(confDir + '/scripts/homestead.rb')

Vagrant.require_version '>= 1.9.0'

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    if File.exist? aliasesPath then
        config.vm.provision "file", source: aliasesPath, destination: "/tmp/bash_aliases"
        config.vm.provision "shell" do |s|
            s.inline = "awk '{ sub(\"\r$\", \"\"); print }' /tmp/bash_aliases > /home/vagrant/.bash_aliases"
        end
    end

    if File.exist? homesteadYamlPath then
        settings = YAML::load(File.read(homesteadYamlPath))
    elsif File.exist? homesteadJsonPath then
        settings = JSON::parse(File.read(homesteadJsonPath))
    else
        abort "Homestead settings file not found in " + File.dirname(__FILE__)
    end

    Homestead.configure(config, settings)

    if File.exist? afterScriptPath then
        config.vm.provision "shell", path: afterScriptPath, privileged: false, keep_color: true
    end

    if File.exist? customizationScriptPath then
        config.vm.provision "shell", path: customizationScriptPath, privileged: false, keep_color: true
    end

    if defined? VagrantPlugins::HostsUpdater
        config.hostsupdater.aliases = settings['sites'].map { |site| site['map'] }
    end
end
user3058423
  • 69
  • 3
  • 8

2 Answers2

2

Steps

  1. vagrant destroy -f
  2. deleted the old '.vagrant' directory
  3. vagrant up
skpaik
  • 360
  • 5
  • 12
0

Best solution is not destroying the VM every time this error pops out (I did it for a while), since that will require a lot of time for the VM re-creation.

The straight forward solution is to just go into the oracle box and open the remote terminal and press S to skip the mounting since the box is hanging when booting up (do this just after you run vagrant up).

Oscar Muñoz
  • 439
  • 1
  • 5
  • 18