Convert vagrant boxes to work with different providers
Convert vagrant boxes to work with different providers
Vagrant-mutate is a vagrant plugin to convert vagrant boxes to work with different providers.
I am no longer actively maintaining vagrant-mutate. If you are interested in taking over, let me know.
Vagrant-mutate 0.3 and later requires Vagrant 1.5. If you are using an older vagrant, install vagrant-mutate version 0.2.6.
First, you must install qemu-img and the libvirt development libraries. Information on supported versions is listed at QEMU Version Compatibility.
apt-get install qemu-utils libvirt-dev ruby-devyum install qemu-img libvirt-devel rubygem-ruby-libvirt ruby-devel redhat-rpm-configQEMU and libvirt are available from homebrew
Download and install it from Stefan Weil or compile it yourself.
Now you're ready to install vagrant-mutate. To install the latest released version simply run
vagrant plugin install vagrant-mutateTo install from source, clone the repository and run rake build. That will produce a gem file in the pkg directory which you can then install with vagrant plugin install.
The basic usage is
vagrant mutate box-name-or-file-or-url output-providerFor example, if you wanted to download a box created for virtualbox and add it to vagrant for libvirt
vagrant mutate http://files.vagrantup.com/precise32.box libvirtOr if you had already downloaded it
vagrant mutate precise32.box libvirtOr if you had already added the box to vagrant and now want to use it with libvirt
vagrant mutate precise32 libvirtThe latter syntax works for boxes you added from Vagrant Cloud or Atlas too. If you have installed multiple versions of these boxes, vagrant-mutate will always use the latest one.
$ vagrant box list
hashicorp/precise64 (virtualbox, 1.1.0)
$ vagrant mutate hashicorp/precise32 libvirtIf you have a box for multiple providers, you must specify the provider to use for input using the --input-provider option, e.g.
$ vagrant box list
precise32 (kvm)
precise32 (virtualbox)
$ vagrant mutate --input-provider=virtualbox precise32 libvirtTo export a box you created with vagrant mutate, just repackage it, e.g.
vagrant box repackage precise32 libvirtIf you want to force the output box to use virtio for the disk interface, no matter what interface the input box used, use the --force-virtio option.
vagrant and vagrant-mutate will output lots of information as they run if you set the VAGRANT_LOG environment variable to INFO. See here for information on how to do that on your operating system.
If you experience any problems, please open an issue on github.
Contributions are welcome! I'd especially like to see support for converting between more providers added.
To contribute, follow the standard flow of
git checkout -b my-new-feature)git commit -am 'Add some feature')ruby test/test.rb)git push origin my-new-feature)Even if you can't contribute code, if you have an idea for an improvement please open an issue.
No open issues yet, or sync has not completed.