wilas / vbkick

Tool for building and maintaining VirtualBox VMs described as a code in a single definition file.
Other
8 stars 5 forks source link

Question: Is a Vagrantfile generated? Generated by export? #47

Closed gregelin closed 10 years ago

gregelin commented 10 years ago

vbkick export works, but the exported artifacts are not obvious and familiar. Vagrant users are familiar with having a Vagrantfile and .vagrant directory. Exporting a vbox into a new directory, maybe specified with a command line option, would provide a more familiar vagrant artifact. By creating a target directory with README.md file, the user could easily turn the exported vagrant into its own repo and share.

My results from running vbkick export myVM:

vbkick export centos-6.5-x86_64_noX-partitioned
[INFO] Loading "definition.cfg" definition...
[INFO] Shutting down 'centos-6.5-x86_64_noX-partitioned'.
[INFO] Exec: sudo /sbin/halt -h -p
...........
[INFO] 'centos-6.5-x86_64_noX-partitioned' was shutdown cleanly.
usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
       mktemp [-d] [-q] [-u] -t prefix
[INFO] Signal handler - cleanup before exiting...
[INFO] VBoxManage sharedfolder add  "centos-6.5-x86_64_noX-partitioned" --name "vbkick" --hostpath "/codedata/virtualmachines/vbkick/templates/CentOS6" --automount
gregelin commented 10 years ago

This maybe a fairly important feature. Vbkick can be used as a substitute to vagrant. However, producing a familiar directory with familiar vagrant artifacts will make vbkick compatible with a familiar workflow tens of thousands of developers have.

wilas commented 10 years ago

I think your export command didn't work (I've created a new issue to better process errors from the subshell - #51):

usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
       mktemp [-d] [-q] [-u] -t prefix
[INFO] Signal handler - cleanup before exiting...

Please feel free to test now.

vbkick export VM_NAME should creates VM_NAME.box. This file could be imported to the vagrant by: vagrant box add newVM VM_NAME.box.

All these steps are covered by the README.md in vbkick project.

NB.: vbkick was initially created to automatically builds vagrant boxes. This is a reason why I'm using vagrant user and vagrant ssh public keys in templates.

gregelin commented 10 years ago

@wilas giving it a try.

gregelin commented 10 years ago

Still receiving an error. And I can't find govreadyc6-4.box on file system.

mbair:vbkick greg$ vbkick export govreadyc6-4
[ERROR] Not existing or empty "definition.cfg" file in /codedata/virtualmachines/vbkick. Terminating...
[INFO] Signal handler - cleanup before exiting...
mbair:vbkick greg$ cd templates/CentOS6/
mbair:CentOS6 greg$ vbkick export govreadyc6-4
[INFO] Loading "definition.cfg" definition...
[INFO] 'govreadyc6-4' was shutdown cleanly.
usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
       mktemp [-d] [-q] [-u] -t prefix
[INFO] Signal handler - cleanup before exiting...
[INFO] VBoxManage sharedfolder add  "govreadyc6-4" --name "vbkick" --hostpath "/codedata/virtualmachines/vbkick/templates/CentOS6" --automount
wilas commented 10 years ago

I think you forgot install a fresh version: sudo make install

gregelin commented 10 years ago

I often forget that step.

gregelin commented 10 years ago

Worked fine.

wilas commented 10 years ago

Cool.