端くれプログラマの備忘録 Vagrant [Vagrant] vagrant upがタイムアウトになるときの対処法

[Vagrant] vagrant upがタイムアウトになるときの対処法

Vagrantbox.esからWindows Vista with IE7 (32bit)をゲットして立ち上げたらタイムアウトになった。Windows系のBoxだと、立ち上がりに時間が掛かるのだろう。

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'vista-ie7'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: vista-ie7_default_1454528248664_66668
==> 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
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に以下の設定を追加する。

config.vm.boot_timeout = 600

単位は秒で、デフォルトは300秒。

参考サイト

config.vm – Vagrantfile – Vagrant by HashiCorp
https://www.vagrantup.com/docs/vagrantfile/machine_settings.html