3

命令vagrant up失败,我不知道为什么。

$ egrep -v '^ *(#|$)' Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "precise32"
end
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'precise32'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
The VM failed to remain in the "running" state while attempting to boot.
This is normally caused by a misconfiguration or host system incompatibilities.
Please open the VirtualBox GUI and attempt to boot the virtual machine
manually to get a more informative error message.
$ vagrant status
Current machine states:

default                   poweroff (virtualbox)

The VM is powered off. To restart the VM, simply run `vagrant up`
$ VBoxManage list runningvms
$

以下是 VirtualBox 日志文件 VBoxSVC.log 中的消息:

$ cat ~/.VirtualBox/VBoxSVC.log
VirtualBox XPCOM Server 4.2.16 r86992 linux.amd64 (Jul  4 2013 16:29:59) release log
00:00:00.000499 main     Log opened 2013-08-13T18:40:45.907580000Z
00:00:00.000508 main     OS Product: Linux
00:00:00.000509 main     OS Release: 3.6.11-4.fc16.x86_64
00:00:00.000510 main     OS Version: #1 SMP Tue Jan 8 20:57:42 UTC 2013
00:00:00.000537 main     DMI Product Name: X8DA3
00:00:00.000547 main     DMI Product Version: 1234567890
00:00:00.000647 main     Host RAM: 24103MB total, 17127MB available
00:00:00.000654 main     Executable: /usr/local/VirtualBox/VBoxSVC
00:00:00.000655 main     Process ID: 9417
00:00:00.000656 main     Package type: LINUX_64BITS_GENERIC
00:00:00.110125 nspr-2   Loading settings file "/opt/tomcat/.VirtualBox/VirtualBox.xml"     with version "1.12-linux"
00:00:00.110817 nspr-2   Failed to retrive disk info: getDiskName(/dev/md126p1) --> md126p1
00:00:00.264367 nspr-2   VDInit finished
00:00:00.275173 nspr-2   Loading settings file "/opt/tomcat/VirtualBox VMs/vagrant_getting_started_default_1376419129/vagrant_getting_started_default_1376419129.vbox" with version "1.12-linux"
00:00:05.288923 main     ERROR [COM]: aRC=VBOX_E_OBJECT_IN_USE (0x80bb000c) aIID={29989373-b111-4654-8493-2e1176cba890} aComponent={Medium} aText={Medium '/opt/tomcat/VirtualBox VMs/vagrant_getting_started_default_1376419129/box-disk1.vmdk' cannot be closed because it is still attached to 1 virtual machines}, preserve=false
00:00:05.290229 Watcher  ERROR [COM]: aRC=E_ACCESSDENIED (0x80070005) aIID={3b2f08eb-b810-4715-bee0-bb06b9880ad2} aComponent={VirtualBox} aText={The object is not ready}, preserve=false
$ 

任何建议将不胜感激。

4

5 回答 5

11

在 OSX 上有同样的错误。重新启动 VirtualBox 修复了它:S

sudo /Library/StartupItems/VirtualBox/VirtualBox restart

另见:https ://forums.virtualbox.org/viewtopic.php?t=5489

于 2013-11-10T13:24:40.900 回答
2

我通过重新安装 VirtualBox 并将自己添加到vboxusers组中解决了这个问题。重新安装过程会打印一条消息,指示 VM 用户必须是该组的成员。我不知道是否需要重新安装,或者是否添加到组中就足够了。

于 2013-08-14T20:13:25.453 回答
2

主机是 32 位(Ubuntu),来宾是 64 位,我将来宾更改为 32,它解决了问题。

于 2013-10-02T10:12:07.760 回答
0

我有同样的问题。这是因为我在提供程序部分对我的 Vagrantfile 进行了错误的配置。当我在机器主机上只有一个时,我试图让我的 VM 机器更强大,只有 2 个 cpu。当您尝试向 VM 机器添加更多硬件但您的主机没有最低要求时,通常会发生这种情况

于 2014-01-17T16:29:47.573 回答
0

我的理解是 vboxusers 组与访问来宾中的 USB 设备有关。不知道为什么会导致问题。通常,作为 vagrant base box 构建指南,音频和 USB 都被禁用。

根据 VirtualBox 手册 => vboxusers 组

Linux 安装程序vboxusers在安装期间创建系统用户组。任何要使用来自 VirtualBox 来宾的 USB 设备的系统用户都必须是该组的成员。可以通过 GUI 用户/组管理或在命令行中使用户成为组 vboxusers 的成员sudo usermod -a -G vboxusers username

请注意,将活动用户添加到该组将要求该用户注销并重新登录。这应该在成功安装软件包后手动完成。

于 2013-08-14T21:19:39.297 回答