命令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
$
非常感谢任何建议。
答案 0 :(得分:11)
在OSX上有同样的错误。重新启动VirtualBox修复了它:S
sudo /Library/StartupItems/VirtualBox/VirtualBox restart
答案 1 :(得分:2)
我通过重新安装VirtualBox并将自己添加到vboxusers
组来解决了这个问题。重新安装过程打印一条消息,指示VM用户必须是该组的成员。我不知道重新安装是否必要,或者是否加入该组是否足够。
答案 2 :(得分:2)
主机是32位(Ubuntu),访客是64位,我将访客更改为32,它解决了问题。
答案 3 :(得分:0)
我的理解是vboxusers组与访问guest虚拟机中的USB设备有关。不知道为什么会导致这个问题。 通常情况下,作为流浪者基本框构建指南,音频和USB都被禁用。
根据VirtualBox手册=> The vboxusers group
Linux安装程序在安装期间创建系统用户组vboxusers
。要从VirtualBox guest虚拟机使用USB设备的任何系统用户必须是该组的成员。用户可以通过GUI用户/组管理或命令行使用sudo usermod -a -G vboxusers username
请注意,将活动用户添加到该组将要求该用户再次注销并重新登录。这应该在成功安装包后手动完成。
答案 4 :(得分:0)
我遇到了同样的问题。这是因为我在提供程序部分的Vagrantfile上进行了错误的配置。当我在机器主机上只有一个时,我试图使我的VM机器更强大,2 cpu。 当您尝试向VM计算机添加更多硬件但主机没有最小化要求时,通常会发生这种情况