Некоторое время я создавал и использую образы Linux в Vagrant, но только недавно расширил охват до Windows. Я работал с образами для поддержки sysprep, но это привело к очень медленной загрузке, и последующие тайм-ауты WinRM также были проблематичными. Я пробовал установить очень высокие значения тайм-аута, но они, похоже, не имеют никакого эффекта, т.е. вдвое больше таймаута загрузки, но он упал
Vagrant.configure(2) do |config|
config.vm.boot_timeout = 1200
config.vm.guest = "windows"
config.vm.communicator = 'winrm'
config.winrm.timeout = 120
config.winrm.retry_limit = 10
В этом примере я распечатал системное время
Mon Mar 20 18:14:21 NZDT 2017
Ожидается 20-минутное время ожидания
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'WindowsDocker'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: cbe_default_1489986988330_5366
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 3389 (guest) => 13389 (host) (adapter 1)
default: 5985 (guest) => 15985 (host) (adapter 1)
default: 5986 (guest) => 15986 (host) (adapter 1)
default: 5985 (guest) => 55985 (host) (adapter 1)
default: 5986 (guest) => 55986 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: WinRM address: 127.0.0.1:15985
default: WinRM username: vagrant
default: WinRM execution_time_limit: PT2H
default: WinRM transport: negotiate
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.
Это вышло через 4 минуты
Mon Mar 20 18:18:42 NZDT 2017
Детали платформы
Это сообщение вводило в заблуждение
This means that Vagrant was unable to communicate with the guest machine within the configured ("config.vm.boot_timeout" value) time period
Я изменил тайм-аут WinRM со 120 секунд на 30 минут, и теперь гость завершает загрузку, и компьютер пытается подключиться.
config.winrm.timeout = 1800 # 30 minutes
config.vm.boot_timeout = 1800 # 30 minutes