重新安装Vagrant和Virtualbox获取Appliance文件必须具有.ovf扩展名错误

时间:2016-02-10 20:13:32

标签: vagrant virtualbox

在Windows Server 2012 R2上卸载并重新安装了VirtualBox和Vagrant,现在有了任何流浪盒,我收到一个引用.ovf文件的错误。这是一个简单的例子

C:\Users\dremy\projects\deleteme> vagrant init precise32 http://files.vagrantup.com/precise32.box

A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on `vagrantup.com` for more information on using Vagrant.

C:\Users\dremy\projects\deleteme> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'precise32' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Box file was not detected as metadata. Adding it directly...
==> default: Adding box 'precise32' (v0) for provider: virtualbox
    default: Downloading: http://files.vagrantup.com/precise32.box
    default: Progress: 100% (Rate: 8986k/s, Estimated time remaining:     --:--:--)
==> default: Successfully added box 'precise32' (v0) for 'virtualbox'!
==> default: Importing base box 'precise32'...
There was an error while executing `VBoxManage`, a CLI used by Vagrant for controlling VirtualBox. The command and stderr is shown below.

Command: ["import", "-n", "P\u2219("]

Stderr: VBoxManage.exe: error: Appliance file must have .ovf extension
VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004),
    component ApplianceWrap, interface IAppliance, call ee IUnknown
VBoxManage.exe: error: Context: "Read(Bstr(pszAbsFilePath).raw(),
   progressRead.asOutParam())" at line 303 of file VBoxManageAppliance.cpp

2 个答案:

答案 0 :(得分:0)

我认为http://files.vagrantup.com/precise32.box是该版本的旧版本,可能与VirtualBox最新版本不兼容。

新版的流浪盒现在托管在https://atlas.hashicorp.com上,你应该可以从那里挑选盒子。以下应该工作

vagrant init hashicorp/precise32
vagrant up --provider virtualbox

请务必清理旧方框

vagrant box remove precise32

答案 1 :(得分:0)

问题已解决。我在Windows Server 2012 R2上运行,并且Hyper-v角色处于活动状态。 VirtualBox和Hyper-v无法运行(https://www.vagrantup.com/docs/hyperv/)。要在PowerShell中删除Hyper-V,我做了:

Remove-WindowsFeature -Name Hyper-V

之后不再有问题了。我从这篇关于构建一个Windows流浪盒的非常好的文章中得到了线索:http://www.hurryupandwait.io/blog/in-search-of-a-light-weight-windows-vagrant-box