gpt4 book ai didi

database - Vagrant Error,盒子未能正确解包

转载 作者:搜寻专家 更新时间:2023-10-30 23:07:10 26 4
gpt4 key购买 nike

我有一个问题需要帮助,但我在这些主题中找不到任何一个。

我正在尝试针对我预先存在的虚拟盒子实现 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."

据我所知,这是因为 Vagrant 希望添加一个 .tar 文件,而该文件不是 tar 扩展名。

您应该能够配置 vagrant 文件以识别我也做过的提供者。我的设置为

config.vm.provider "virtualbox" do |vb|
vb.gui = true
end

但无论我尝试什么,我总是会收到上述错误。需要注意的一件事是我不确定如何提供 metadata.json 文件,或者我如何找到它来编辑它。也许那是我的问题?我有最新版本的 vagrant,所以这不是问题。

如有任何帮助,我们将不胜感激。

我已经尝试了 vagrant 包,下面是我遇到的错误请查看您是否能够提供进一步的帮助。

我尝试了您的建议,这是我收到的错误消息。非常感谢你的帮助。

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>'

最佳答案

vagrant package --base <name of vm> --output <path>.box

假设您的虚拟机名为“my_vm”并且您想将其放入主目录

vagrant package --base my_vm --output ~/my_vm.box

Vagrant 会将您的虚拟机打包到一个基础盒子中。无论你用输出标志命名框,都将是你在 vagrantfile 中使用的名称。

关于database - Vagrant Error,盒子未能正确解包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25575898/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com