Package: vboxn
vboxnautomates the creation of VirtualBox machines.Overiewvboxnis a Python/Bash library for creating new VirtualBox machine images
in a repeatable and unattended fashion. It is intended as a developer utility
similar in scope toveewee, (from which it borrows a few deploy templates).The package includes three user-facing scripts:vboxn-initfor creating and bootstrapping a new virtual machine (Bash).vboxn-postinstallfor further provisioning of the machine via default or
user-supplied scripts (Bash).vboxnfor manipulating existing machines (Python).VagrantThe default postinstall scripts are intended to configure the virtual machine
in a way that is compatible withVagrant. Once the postinstall step has
completed (and the machine has been shutdown), you ought to be able to
immediately package the vm as aVagrantbase box - for example, if the vm
you created is calledpangolin32vagrant package --base pangolin32 --output pangolin32.boxThe new box can then be further configured and added to an existingVagrantinstallation as follows:vagrant box add pangolin32.boxSee thedocs on Vagrant base boxesfor more info.However, note that vagrant will handle network configuration in its own way,
and this may clash with how the postinstall scripts have left things. In the
case of the default Ubuntu install, you need to ensure that/etc/network/interfacesis consistent.StatusThe Ubuntu 12.04 guest install works, the archlinux guest install is not
complete - the default postinstall script fails after a certain point.
Since Ubuntu is all I need at the moment, there are no immediate plans to
go beyond that.InstallationInstall frompypi:pip install vboxnDevelopmentEither:pip install -e git+https://github.com/devopsni/vboxn.git#egg=vboxnOr:python bootstrap.py && ./bin/buildoutRequirementsCliffQuickstartThe following will create and start a new VirtualBox machine in GUI mode,
and install Ubuntu 12.04 as the guest OS:vboxn-init pangolin32 ubuntu autoIf all went well and the OS was successfully installed, shutdown the virtual
machine (either from the GUI, or withsudo shutdown-hnow), and run the
postinstall script.:vboxn-postinstall pangolin32If that succeeded, shutdown the machine again and launch it in headless
(GUI-less) mode:vboxn headless pangolin32Now, wait enough time for the machine to boot and, assuming that you had a
public RSA key in the usual place (~/.ssh/id_rsa.pub) and it was copied to
the new machine successfully, you should be able tosshto the running
instance (by default on address 192.168.44.100 via the hostonly adapter with
address 192.168.44.1).The root password is set tovboxnand there is an admin user calledvboxnalso with this password.Both the init and postinstall phases will launch “one-shot” web servers on
the host using thenetcatutility, if the installation fails then these
may still be running and should be killed.vboxn-initvboxn-initis a Bash script which will be installed as part of the standard
Python package installation, but could also be used standalone without
requiring either Python orvboxnitself.Usagevboxn-init <vm_name> <os_type> <auto|auto64|iso_source_file> [properties_file] [vm_option=..., vm_option=...]

Description:

    Automate the creation of VirtualBox machine instances.

Examples:

    vboxn-init testbox0 ubuntu auto
    vboxn-init testbox0 ubuntu auto kickstart=no
    vboxn-init testbox0 ubuntu auto kickstart_file=bootstrap.sh
    vboxn-init testbox0 ubuntu auto postinstall=no
    vboxn-init testbox0 ubuntu auto vm_basefolder=/srv/vbox
    vboxn-init testbox0 archlinux archlinux-2011.08.19-core-i686.iso
    vboxn-init testbox0 archlinux iso/archlinux-2011.08.19-core-i686.iso conf/vm.properties

Notes:

  - Specifying 'auto' or 'auto64' for the iso source will download
    the latest generic 32/64-bit installation image for the OS

  - A properties file can optionally be used to supply overrides to the
    default VM config options, it is sourced by vboxn-init and should be a
    valid shell script.

  - Properties can additionally be defined as command line
    arguments. If both a properties file and command line properties
    are given, then those specified on the command line will take
    precedence.

  - If 'kickstart=yes' (the default) and 'kickstart_file' is
    unspecified, then a generic kickstart file will be downloaded
    from this project's github repository and run on the new guest
    machine. Similarly for 'postinstall=yes' and 'postinstall_configure_files'.

  - 'postinstall_configure_files' should be a space delimited list
    of files which will be concatenated in the order given and run
    on the guest after the OS is installed.  'postinstall_configure_root'
    can optionally be defined as a prefix for the postinstall files.

  - The kickstart and postinstall files are made available to the
    guest machine by running a "one shot" web server on the host.
    The default address for this web server to listen on is the inet
    IP address of the host, and the default port is 8585. This can be
    changed by specifying the 'kickstart_listen_on' parameter:

        vboxn-init testbox0 ubuntu auto kickstart_listen_on=192.168.1.101:8080