Skip to content

Instantly share code, notes, and snippets.

@cp16net
Last active December 17, 2015 02:48
Converting a vagrant virtualbox image (precise64) to a kvm provider base
#!/bin/bash
# get-vagrant-box.sh
vagrant box add precise64 http://files.vagrantup.com/precise64.box
pushd ~/.vagrant.d/boxes/precise64/
cp -R virtualbox/ kvm
cd kvm
# copy the Vagrantfile and metadata.json file in this directory
pwd
popd
{"provider": "kvm"}
# Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.base_mac = "00163e779fe9"
config.vm.network :private_network, ip: "192.168.2.100"
end
# Load include vagrant file if it exists after the auto-generated
# so it can override any of the settings
include_vagrantfile = File.expand_path("../include/_Vagrantfile", __FILE__)
load include_vagrantfile if File.exist?(include_vagrantfile)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment