Время ожидания Vagrant истекло при ожидании загрузки машины - PullRequest
1 голос
/ 05 мая 2020

Я новый Бродяга. Моя текущая среда - Ubuntu -> работает в Virtual Box -> в книге Ma c.

Я успешно установил пакеты Virtualbox и Vagrant в свою установку Ubuntu. Я установил репо и начал сборку (бродяга). После успешного копирования образа у меня есть шаг в моем vagrantfile для подключения через S SH к виртуальной машине. Он просто зависает и в конечном итоге истекает время ожидания.

См. Ошибку ниже

==> default: Box 'ubuntu/trusty64' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'ubuntu/trusty64'
    default: URL: https://vagrantcloud.com/ubuntu/trusty64
==> default: Adding box 'ubuntu/trusty64' (v20190514.0.0) for provider: virtualbox
    default: Downloading: https://vagrantcloud.com/ubuntu/boxes/trusty64/versions/20190514.0.0/providers/virtualbox.box
==> default: Successfully added box 'ubuntu/trusty64' (v20190514.0.0) for 'virtualbox'!
==> default: Importing base box 'ubuntu/trusty64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Setting the name of the VM: postgres_default_1588691813886_34109
==> default: Clearing any previously set forwarded ports...

Vagrant is currently configured to create VirtualBox synced folders with
the `SharedFoldersEnableSymlinksCreate` option enabled. If the Vagrant
guest is not trusted, you may want to disable this option. For more
information on this option, please refer to the VirtualBox manual:

  https://www.virtualbox.org/manual/ch04.html#sharedfolders

This option can be disabled globally with an environment variable:

  VAGRANT_DISABLE_VBOXSYMLINKCREATE=1

or on a per folder basis within the Vagrantfile:

  config.vm.synced_folder '/host/path', '/guest/path', SharedFoldersEnableSymlinksCreate: false
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> 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

#<Thread:0x00005618d3a47468@/usr/share/rubygems-integration/all/gems/vagrant-2.0.2/lib/vagrant/batch_action.rb:71 run> terminated with exception (report_on_exception is true):

....
....
....

Timed out while waiting for the machine to boot. This means that (Vagrant::Errors::VMBootTimeout)

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.
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.

Vagrantfile

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

IMAGE_NAME = "bento/ubuntu-18.04"
N = 1

Vagrant.configure("2") do |config|

  config.vm.box = IMAGE_NAME
  config.vm.provision "shell", path: "provision/vagrant_provision.sh", privileged: true

  config.vm.provider "virtualbox" do |v|
    v.memory = 2048 
    v.cpus = 1
  end

  # Nodes
  (1..N).each do |number|
      config.vm.define "node-#{number}" do |node|
          node.vm.network "private_network", ip: "192.168.50.21#{number}"
          node.vm.hostname = "node-#{number}"
          node.vm.synced_folder "scripts/", "/scripts"
      end  
  end


end

1 Ответ

0 голосов
/ 14 мая 2020

Проблема была связана с использованием Vagrant / VirtualBox под виртуальной машиной Ubuntu, на которой уже был запущен VirtualBox на Ma c. Когда я изначально установил Vagrant / VirtualBox на Ma c, у меня не было проблем.

...