50

I imported the precise32 box, then installed some packages and other data on the VM. My plan is to then repackage it into a box, to save on complicated provisioning when sharing.

However.

vagrant package --base dev-vm --output /box/vm.box

Always returns

[dev-vm] VM not created . Moving on

My directory structure is:

-dev-vm
    --.vagrant
    --Logs
    --box.ovf
    --box-disk1.vmdk
    --dev-vm_13345342.vbpx
    --metadata.json
    --Vagrantfile

Ive

 set VAGRANT_LOG=debug

Which shows no extra info on whats going on.

Windows 7 using Cygwin

UPDATE:

 export VAGRANT_LOG=debug

for Cygwin to set debug log.

I then get

 DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
 DEBUG subprocess: Exit status: 0
 INFO warden: Calling action: #<Vagrant::Action::Builtin::Call:0x2abb800>
 INFO runner: Running action: #<Vagrant::Action::Builder:0x2695920>
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::Created:0x267c078>
 INFO runner: Running action: #<Vagrant::Action::Warden:0x2ac6c48>
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::MessageNotCreated:0x2ac6c00>
 INFO interface: info: VM not created. Moving on...
4

2 回答 2

83

当您打包一个盒子时,盒子名称必须是您可以从 VirtualBox 获得的特定机器名称(例如lucid_1372711888)。只需在 cmd 中执行以下命令:

vboxmanage list vms

请注意,应事先将“vboxmanage”添加到 PATH 变量中。看这里如何做到这一点。

另请注意,虚拟机名称不得包含空格。否则它不会被“vagrant package”命令识别。例如:

vagrant package --base win7_vbox_base --output win7_base.box #CORRECT
------------------------------------------------------------------------
vagrant package --base win7 vbox base --output win7_base.box #INCORRECT
于 2013-07-26T15:13:09.663 回答
13

如果你在包含 Vagrantfile 的文件夹中,你也可以简单地运行:

vagrant package --output your-box-name.box

下图显示了使用此命令创建的 .box 文件的内容:

解包.box

于 2016-03-30T08:26:17.007 回答