我想使用 Vagrant 为开发环境创建一个虚拟机。尝试将虚拟机安装到 VirtualBox 时出现错误。 VBoxManage 导入的输出如下。我的同事能够毫无问题地运行此命令。我在 Mac OS X 10.6.8 上,他在 Debian 上。
有没有人知道这个错误的含义?
20:41:26:haitran:vagrant $ vagrant up
[default] Box ubuntu1104 was not found. Fetching box from specified URL...
[default] Downloading with Vagrant::Downloaders::HTTP...
[default] Downloading box: http://dl.dropbox.com/u/7490647/talifun-ubuntu-11.04-server-amd64.box
[default] Extracting box...
[default] Verifying box...
[default] Cleaning up downloaded box...
[default] Importing base box 'ubuntu1104'...
The VM import failed! Try running `VBoxManage import` on the box file
manually for more verbose error output.
21:06:54:haitran:vagrant $ VBoxManage import ~/.vagrant.d/boxes/ubuntu1104/box.ovf
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interpreting /Users/haitran/.vagrant.d/boxes/ubuntu1104/box.ovf...
OK.
Disks: vmdisk1 41943040000 -1 http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized box-disk1.vmdk -1 -1
Virtual system 0:
0: Suggested OS type: "Ubuntu_64"
(change with "--vsys 0 --ostype <type>"; use "list ostypes" to list all possible values)
1: Suggested VM name "talifun-ubuntu-11.04-server-amd64"
(change with "--vsys 0 --vmname <name>")
2: Number of CPUs: 1
(change with "--vsys 0 --cpus <n>")
3: Guest memory: 360 MB
(change with "--vsys 0 --memory <MB>")
4: Network adapter: orig NAT, config 2, extra slot=0;type=NAT
5: CD-ROM
(disable with "--vsys 0 --unit 5 --ignore")
6: IDE controller, type PIIX4
(disable with "--vsys 0 --unit 6 --ignore")
7: IDE controller, type PIIX4
(disable with "--vsys 0 --unit 7 --ignore")
8: SATA controller, type AHCI
(disable with "--vsys 0 --unit 8 --ignore")
9: Hard disk image: source image=box-disk1.vmdk, target path=/Users/haitran/VirtualBox VMs/talifun-ubuntu-11.04-server-amd64/box-disk1.vmdk, controller=8;channel=0
(change target path with "--vsys 0 --unit 9 --disk path";
disable with "--vsys 0 --unit 9 --ignore")
0%...
Progress state: VBOX_E_FILE_ERROR
VBoxManage: error: Could not create the clone medium '/Users/haitran/VirtualBox VMs/talifun-ubuntu-11.04-server-amd64/box-disk1.vmdk' (VERR_GENERAL_FAILURE)
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component Appliance, interface IAppliance, callee
Context: "ImportAppliance" at line 793 of file VBoxManageAppliance.cpp
最佳答案
似乎这个问题已经坐在这里一段时间了,所以也许你已经解决了这个问题。我们也在使用 Vagrant 并遇到一个奇怪的问题,即盒子损坏了。
对我们来说,这导致配置在给定的笔记本电脑上失败,但可以在所有其他笔记本电脑上工作。除了供应过程刚刚卡住之外,没有明确的失败迹象。
您是否检查过 sha1-sum 或类似文件,以验证您下载的 box 文件是否与您的同事完全相同?所有磁盘镜像文件都缓存在 ~/.vagrant.d/boxes 下,因此您可以在导入后立即比较该目录下的校验和。
关于使用 Vagrant 时出现 VirtualBox 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7527384/