Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vagrant " VM not created." when trying to create box from existing VM

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... 
like image 776
Kiksy Avatar asked Jul 25 '13 09:07

Kiksy


People also ask

What is the difference between VirtualBox and vagrant?

VirtualBox is basically inception for your computer. You can use VirtualBox to run entire sandboxed operating systems within your own computer. Vagrant is software that is used to manage a development environment.


2 Answers

When you package a box, the box name has to be the specific machine name that you can get from VirtualBox (e.g. lucid_1372711888). Just execute following command in cmd:

vboxmanage list vms 

Notice that "vboxmanage" should prior be added to PATH variable. See here how to do that.

Also notice that virtual maschine name must not contain spaces. Otherwise it won't be recognized by "vagrant package" command. For instance:

vagrant package --base win7_vbox_base --output win7_base.box #CORRECT ------------------------------------------------------------------------ vagrant package --base win7 vbox base --output win7_base.box #INCORRECT 
like image 113
bfitzpatrick Avatar answered Oct 08 '22 21:10

bfitzpatrick


If you are in the folder that contains your Vagrantfile, you can also simply run:

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

The following image shows the content of the .box file created with this command:

Unpacket .box

like image 40
Marco Altieri Avatar answered Oct 08 '22 20:10

Marco Altieri