我发出' vagrant up'随机获得以下错误。在我的centos盒子上:
客户机在等待时进入无效状态 开机有效状态是“开始,正在运行”。机器在 '未知'州。请验证所有配置 正确再试一次。
如果您使用的提供商有自带的GUI, 打开它并观察机器通常很有帮助,因为 GUI通常比Vagrant可以检索更多有用的错误消息。 例如,如果您正在使用VirtualBox,请运行
vagrant up
VirtualBox GUI已打开。此错误的主要问题是您正在使用的提供商 未正确配置。这很少是一个流浪问题。
它每3次发生2次(随机估计),当它运行时,它会起到瑕疵的作用。它总是在SSH auth method: private key
之后发生。在Virtualbox GUI机器启动,运行并提示用户和密码(我可以运行GUI,它工作正常)。
主机操作系统是Windows 10.这是我的Vagrantfile:
VAGRANTFILE_API_VERSION = "2"
VAGRANTFILE_BOX_NAME = "centos-drupal-vm"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Base config
config.vm.box = "enemy-of-the-state/centos-7.1_kernel-devel-fixed"
config.vm.hostname = VAGRANTFILE_BOX_NAME
config.vbguest.auto_update = true
config.vm.define VAGRANTFILE_BOX_NAME do |plxbox|
config.ssh.insert_key = false
end
# Port forwarding
config.vm.network :private_network, ip: "10.0.0.10"
config.vm.network :forwarded_port, guest: 80, host: 80 # httpd
config.vm.network :forwarded_port, guest: 443, host: 443 # ssl
config.vm.network :forwarded_port, guest: 3306, host: 3306 # mysql
config.vm.network :forwarded_port, guest: 8025, host: 8025 # mailhog
# Provider settings
config.vm.provider "virtualbox" do |v|
v.name = VAGRANTFILE_BOX_NAME
v.memory = "2048"
v.cpus = 1
end
# Ansible provisioning (from guest)
# : From shell
config.vm.provision "shell", path: "ansible/init.sh"
# : From plugin
# config.vm.provision :guest_ansible do |guest_ansible|
# guest_ansible.playbook = "ansible/playbook.yml"
# guest_ansible.sudo = false
# end
# Virtualbox synced folder
config.vm.synced_folder "./html", "/var/www/html", type: "nfs"
# A private dhcp network is required for NFS to work (on Windows hosts, at least)
config.vm.network :private_network, type: "dhcp"
# Reload network config
config.vm.provision :shell, inline: "echo Everything done: http://10.0.0.10"
end
任何可能有用的线索或任何其他信息?谢谢!
编辑:
添加vagrant up
输出:
$ vagrant up
Bringing machine 'centos-drupal-vm' up with 'virtualbox' provider...
==> centos-drupal-vm: Clearing any previously set forwarded ports...
==> centos-drupal-vm: Clearing any previously set network interfaces...
==> centos-drupal-vm: Preparing network interfaces based on configuration...
centos-drupal-vm: Adapter 1: nat
centos-drupal-vm: Adapter 2: hostonly
centos-drupal-vm: Adapter 3: hostonly
==> centos-drupal-vm: You are trying to forward to privileged ports (ports <= 1024). Most
==> centos-drupal-vm: operating systems restrict this to only privileged process (typically
==> centos-drupal-vm: processes running as an administrative user). This is a warning in case
==> centos-drupal-vm: the port forwarding doesn't work. If any problems occur, please try a
==> centos-drupal-vm: port higher than 1024.
==> centos-drupal-vm: Forwarding ports...
centos-drupal-vm: 80 (guest) => 80 (host) (adapter 1)
centos-drupal-vm: 443 (guest) => 443 (host) (adapter 1)
centos-drupal-vm: 3306 (guest) => 3306 (host) (adapter 1)
centos-drupal-vm: 8025 (guest) => 8025 (host) (adapter 1)
centos-drupal-vm: 22 (guest) => 2222 (host) (adapter 1)
==> centos-drupal-vm: Running 'pre-boot' VM customizations...
==> centos-drupal-vm: Booting VM...
==> centos-drupal-vm: Waiting for machine to boot. This may take a few minutes...
centos-drupal-vm: SSH address: 127.0.0.1:2222
centos-drupal-vm: SSH username: vagrant
centos-drupal-vm: 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.