Open jhakonen opened 7 years ago
Hi @jhakonen - have you seen this behavior if you use a different vagrant box? Thanks!
I tried with Centos 7 guest, on same host (Windows 10 x64 pro). Took more repeated up/destroys, but got the same error message:
vagrant destroy -f; vagrant up
==> wotsources: VM not created. Moving on...
Bringing machine 'wotsources' up with 'virtualbox' provider...
==> wotsources: Importing base box 'centos/7'...
==> wotsources: Matching MAC address for NAT networking...
==> wotsources: Checking if box 'centos/7' is up to date...
==> wotsources: Setting the name of the VM: tools_wotsources_1507059705933_44968
==> wotsources: Clearing any previously set network interfaces...
==> wotsources: Preparing network interfaces based on configuration...
wotsources: Adapter 1: nat
==> wotsources: Forwarding ports...
wotsources: 22 (guest) => 2222 (host) (adapter 1)
==> wotsources: Running 'pre-boot' VM customizations...
==> wotsources: Booting VM...
==> wotsources: Waiting for machine to boot. This may take a few minutes...
wotsources: SSH address: 127.0.0.1:2222
wotsources: SSH username: vagrant
wotsources: SSH auth method: private key
The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'unknown' state. Please verify everything is configured
properly and try again.
If the provider you're using has a GUI that comes with it,
it is often helpful to open that and watch the machine, since the
GUI often has more helpful error messages than Vagrant can retrieve.
For example, if you're using VirtualBox, run `vagrant up` while the
VirtualBox GUI is open.
The primary issue for this error is that the provider you're using
is not properly configured. This is very rarely a Vagrant issue.
Vagrantfile:
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'etc'
WOTPATH = ENV["WOTPATH"]
OUTPATH = ENV["OUTPATH"]
CPU_COUNT = Etc.nprocessors
MEMORY = 4 * 1024 # In Megabytes
def install_plugins(plugins)
not_installed = []
plugins.each do |plugin|
unless Vagrant.has_plugin?(plugin)
not_installed << plugin
end
end
unless not_installed.empty?
puts "The following required plugins must be installed:"
puts "'#{not_installed.join("', '")}'"
print "Install? [y]/n: "
unless STDIN.gets.chomp == "n"
not_installed.each { |plugin| install_plugin(plugin) }
else
exit
end
$? ? continue : ( raise 'Plugin installation failed, see errors above.' )
end
end
def install_plugin(plugin)
system("vagrant plugin install #{plugin}")
end
# If plugins successfully installed, restart vagrant to detect changes.
def continue
exec("vagrant #{ARGV[0]}")
end
required_plugins = ["vagrant-vbguest"]
install_plugins(required_plugins)
Vagrant.configure("2") do |config|
config.vm.define :wotsources
config.vm.box = "centos/7"
config.vm.synced_folder WOTPATH, "/world_of_tanks"
config.vm.synced_folder OUTPATH, "/extracts"
config.vm.synced_folder ".", "/vagrant", type: "virtualbox"
config.vbguest.auto_update = true
config.vbguest.auto_reboot = true
config.vm.provider "virtualbox" do |vb|
vb.memory = MEMORY
vb.cpus = Etc.nprocessors
end
config.vm.provision "ansible_local" do |ansible|
ansible.playbook = "playbook.yml"
end
end
Same here with default Homestead (laravel) vagrant box (https://github.com/laravel/homestead).
At least once a day when I do vagrant halt
and vagrant up
i have the same error.
Same here with Homestead and other custom boxes...
The same here, various Linux boxes (not using other anyway), sometimes just repeating vagrant up is enough. It gladly happens when I want to show someone how it all works with a single command. :-)
vagrant reload
Virtualbox ver 6.1.18.r...
and virtualization Windows 10
if processor intel run command as administrator in cmd
dism.exe /Online /Enable-Feature:Microsoft-Hyper-V-All
Reboot
I've just tried the solution from @Rutman to enable Hyper-V and has been working well for me with Virtualbox 6.1.22
Same error here.
Vagrant 2.2.16 Virtualbox 6.1.22 Box: centos/8
When I execute vagrant up
, sometimes the machine boots and connect ssh, sometimes don't. Really strange 🤔
If I downgrade the vagrant version, to 2.2.10 for example, the error disappears. Maybe can be related to some change in versions between 2.2.10 and 2.2.16 🤝
Vagrant version
Host operating system
Windows 10 pro x64
Guest operating system
Windows 10 pro x64
Vagrantfile
Also here: https://github.com/jhakonen/wot-teamspeak-mod/blob/master/Vagrantfile
Debug output
https://www.dropbox.com/s/624gk2v422nplqs/output.log?dl=1
Expected behavior
Vagrant should have noticed that machine booted up ok.
Actual behavior
It did not, it gave error:
I'm getting intermittently this error. The machine boots up nicely, but vagrant sometimes gives this error, and sometimes it does not. In VirtualBox GUI, the guest machine shows up running fine.
vagrant up --debug
didn't help much, so I added some extra output (see https://www.dropbox.com/s/vrnr18752behpwf/logging.diff?dl=1 ).Starting from scratch, with previous machine destroyed:
vagrant up --debug 2>&1 | Tee-Object -file c:\temp\output.log
Search the debug output for string
read_state
. State isrunning
on line 11176,nil
on line 11190, andrunning
again on line 11696.It looks like
showvminfo <uuid> --machinereadable
command exits with 0 exit code, and has empty stdout and stderr (log line 11188). Which read_state() in Version_5_0 class can't parse and returns nil. Command executions both before and after the failed execution show that the machine info was returned just fine.Steps to reproduce