0

更新(2014 年 2 月 5 日):当机器在没有正确关机的情况下重新启动时出现此错误

我正在尝试通过远程机器上的开发 vagrant box 安装 EdX 的开源学习管理系统。但是,我收到与虚拟机 GUI 相关的错误。有什么可以通过 CLI/ssh 完成的吗?这是确切的错误。

The guest machine entered an invalid state while waiting for it       
to boot. Valid states are 'starting, running'. The machine is in the  
'poweroff' 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.           

以下是 VagrantFile 的内容


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

Vagrant.configure("2") do |config|
  config.vm.box = "precise32"
  config.vm.box_url = "http://files.vagrantup.com/precise32.box"

  config.vm.network :forwarded_port, guest: 8000, host: 9000
  config.vm.network :forwarded_port, guest: 8001, host: 9001

  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  config.vm.network :private_network, ip: "192.168.20.40"

  nfs_setting = RUBY_PLATFORM =~ /darwin/ || RUBY_PLATFORM =~ /linux/
  config.vm.synced_folder ".", "/opt/edx/edx-platform", id: "vagrant-root", :nfs => nfs_setting

  # Make it so that network access from the vagrant guest is able to
  # use SSH private keys that are present on the host without copying
  # them into the VM.
  config.ssh.forward_agent = true

  config.vm.provider :virtualbox do |vb|
    # Use VBoxManage to customize the VM. For example to change memory:
    vb.customize ["modifyvm", :id, "--memory", "2048"]

    # This setting makes it so that network access from inside the vagrant guest
    # is able to resolve DNS using the hosts VPN connection.
    vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
  end

  config.vm.provision :shell, :path => "scripts/install-acceptance-req.sh"
  config.vm.provision :shell, :path => "scripts/vagrant-provisioning.sh"
end
4

2 回答 2

1

不,在此阶段您无法使用 CLI 或 Ssh 进行/诊断,因为 VM 无法正确初始化并且未处于“工作”状态。

您应该遵循错误消息中包含的建议。

销毁您当前的虚拟机:

vagrant destroy

然后打开 VirtualBox GUI,并使用以下命令重新启动 Vagrant 设置:

vagrant up

然后,您可以在 VM 控制台/窗口(来自 Virtualbox GUI)中查看失败并阻止安装程序运行。

使用控制台 GUI 启动 VM 的另一种方法是修改您的Vagrantfile

# 你会在 Vagrantfile 中找到这一行
Vagrant.configure("2") 做 |config|

  #添加这个指令
  config.vm.provider "virtualbox" 做 |v|
    v.gui = 真
  结尾


结尾

(销毁你现有的和失败的虚拟机,vagrant destroy然后运行vagrant up

如果远程机器(VirtualBox 运行的地方)是使用 SSH 访问的 Unix 机器,您可以使用 SSH 连接到本地机器时的-X选项将 GUI 导出到本地机器。有关更多详细信息,请参阅此答案ssh -X

于 2014-01-22T09:39:09.180 回答
-1

此消息出现在我的环境中,因为有两件事:

1 - 如果您的 VirtualBox 软件 GUI 已关闭,只需打开它。Ps.:vagrant destroy再试vagrant up一次

2 - 如果问题仍然存在,只需更新您的 VirtualBox GUI。 VirtualBox 下载

让我知道它是否完成。

于 2014-03-09T00:22:43.883 回答