Skip to content

Instantly share code, notes, and snippets.

@lausdahl
Last active August 29, 2015 14:26
Show Gist options
  • Save lausdahl/72c58f12cfcb5896b96b to your computer and use it in GitHub Desktop.
Save lausdahl/72c58f12cfcb5896b96b to your computer and use it in GitHub Desktop.
Vagrant libvirt on Ubuntu LTE

Libvirt

sudo apt-get install qemu-kvm libvirt-bin bridge-utils

Vagrant

Install

wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.7.4_x86_64.deb
sudo dpkg -i vagrant_1.7.4_x86_64.deb 

Plugins

Libvirt

sudo apt-get install ruby libxslt-dev libxml2-dev libvirt-dev zlib1g-dev
vagrant plugin install vagrant-libvirt

Mutate

https://github.com/sciurus/vagrant-mutate

sudo apt-get install ruby build-essential ruby-dev

then yum

sudo gem install json -v '1.8.3'
vagrant plugin install vagrant-mutate

So we need to build a box to use. This can be done either from an existing box (remember to remove the url in the Vagrant file) or from an url:

Existing box

vagrant mutate ubuntu/trusty64 libvirt

Online box

vagrant mutate https://atlas.hashicorp.com/ubuntu/boxes/precise64/versions/20150730.1.0/providers/virtualbox.box libvirt

efter that we have $ vagrant box list

0-x86_64 (libvirt, 1.1.0)

then try to start a vm:

vagrant up

Mutate and export

vagrant mutate https://atlas.hashicorp.com/ubuntu/boxes/trusty32/versions/20150609.0.9/providers/virtualbox.box libvirt
vagrant box repackage precise32 libvirt
mv package.box trusty32-20150609.0.9-libvirt.box
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment