vb.net Vagrant 错误,盒子无法正确解包
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25575898/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Vagrant Error, The box failed to unpackage properly
提问by Johnathon22
I have a question for help that I could not find on any of these topics already.
我有一个问题寻求帮助,我已经在这些主题中找不到任何问题。
I am trying to implement vagrant against my pre-existing virtual box. Most of the topics online right now are referring to using a box from vagrant cloud, or building one from scratch etc. My issue is I have an already built virtual box using Virtualbox as the provider specifically 1.4.3 as the version. The box is 124GB so remaking it is not exactly ideal. I have the vagrant config file set to locate the virtual box at path /users/desktop/foldername/filename.vbox. Every time it tries to add the box I get the error
我正在尝试对我预先存在的虚拟框实施 vagrant。现在在线的大多数主题都是指使用来自 vagrant cloud 的盒子,或者从头开始构建一个盒子等等。我的问题是我已经使用 Virtualbox 作为提供者构建了一个虚拟盒子,特别是 1.4.3 作为版本。盒子是 124GB,所以重新制作它并不完全理想。我将 vagrant 配置文件设置为在路径 /users/desktop/foldername/filename.vbox 中定位虚拟框。每次尝试添加框时,我都会收到错误消息
"The box failed to unpackage properly. Please verify that the box file you're trying to add is not corrupted and try again. The output from attemtping to unpackage (if any):
Bsdtar: Error opening archive: Unrecognized archive format."
My knowledge is that this is because Vagrant is looking to add a .tar file and the file is not a tar extension.
我知道这是因为 Vagrant 想要添加一个 .tar 文件,而该文件不是 tar 扩展名。
Your supposed to be able to configure vagrant file to recognize the provider which I have done as well. Mine is set to
你应该能够配置 vagrant 文件来识别我也做过的提供者。我的设置为
config.vm.provider "virtualbox" do |vb|
vb.gui = true
end
But no matter what I try I'm always getting the error above. One thing to note is I'm not sure how to go about providing the metadata.json file, or how I can find that to edit it. Perhaps that is my problem? I have the latest version of vagrant so that is not the issue.
但无论我尝试什么,我总是遇到上面的错误。需要注意的一件事是我不确定如何提供 metadata.json 文件,或者我如何找到它来编辑它。也许这是我的问题?我有最新版本的 vagrant,所以这不是问题。
Any assistance would be greatly appreciated.
任何帮助将不胜感激。
I have tried the vagrant package and below is my error I'm getting Please see if you may be able to provide further assistance.
我已经尝试过 vagrant 包,下面是我遇到的错误 请看看您是否可以提供进一步的帮助。
I tried what you have suggested and here is the error message that I'm getting. I greatly appreciate your help.
我尝试了您的建议,这是我收到的错误消息。我非常感谢你的帮助。
nokeys$ vagrant package --base Dev_Clonea --output /users/nokeys/desktop/Dev_Clone/Dev_Clone.vbox
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:306:in `id=': undefined method `children' for nil:NilClass (NoMethodError)
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:438:in `state'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/providers/virtualbox/action/created.rb:11:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builder.rb:116:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in `block in run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/busy.rb:19:in `busy'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in `run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/call.rb:43:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builder.rb:116:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in `block in run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/busy.rb:19:in `busy'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in `run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:196:in `action_raw'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:173:in `block in action'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/environment.rb:434:in `lock'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:161:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:161:in `action'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/commands/package/command.rb:83:in `package_vm'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/commands/package/command.rb:66:in `package_base'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/commands/package/command.rb:42:in `execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/cli.rb:42:in `execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/environment.rb:252:in `cli'
from /Applications/Vagrant/bin/../embedded/gems/gems/vagrant-1.6.3/bin/vagrant:166:in `<main>'
回答by Blackmore
vagrant package --base <name of vm> --output <path>.box
Lets say you virtual machine is named 'my_vm' and you want to drop it into the home directory
假设您的虚拟机名为“my_vm”,并且您想将其放入主目录
vagrant package --base my_vm --output ~/my_vm.box
Vagrant will package your virtual machine into a base box. Whatever you name the box with the output flag, will be the name you use in your vagrantfile.
Vagrant 会将你的虚拟机打包成一个基本框。无论您使用输出标志命名框,都将是您在 vagrantfile 中使用的名称。

