Skip to content

Instantly share code, notes, and snippets.

@tatsuya6502
Last active August 29, 2015 13:59
Show Gist options
  • Save tatsuya6502/10513193 to your computer and use it in GitHub Desktop.
Save tatsuya6502/10513193 to your computer and use it in GitHub Desktop.
vagrant-kvm Vagrantfile just to run vagrant-mutate with Vagrant 1.4.3
Vagrant.configure('2') do |config|
config.vm.box = 'fedora20'
config.vm.box_url = 'https://vagrant-kvm-boxes-si.s3.amazonaws.com/fedora20-amd64-kvm-20140413.box'
config.vm.provider :kvm do |kvm, override|
kvm.memory_size = '1GB'
kvm.image_mode = 'clone'
end
# You can mount your box files folder on the guest.
# config.vm.synced_folder '/path/to/box-files', # '/home/vagrant/boxes', type: 'nfs'
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.auto_detect = true
end
# This shell provisioner will install Vagrant 1.4.3 and vagrant-mutate.
#
# If you want to install vagrant-kvm too, enable nested-kvm by adding
# /etc/modprobe.d/kvm.conf on host that contains:
#
# options kvm-intel nested=1
# options kvm-amd nested=1
#
config.vm.provision :shell, inline: <<-SH
set -x
# By some reason, vagrant-qemu can't find qemu-img command if it's installed by
# qemu-img package. To avoid this, install qemu package instead.
# sudo yum -y install qemu-img
sudo yum -y install qemu
# vim-common package contains xdd command used by qemu-img.vmdk3.hack.sh.
# Install/update vim-minimal too to avoid a dependency conflict.
sudo yum -y install vim-common vim-minimal
sudo rpm -ivh https://dl.bintray.com/mitchellh/vagrant/vagrant_1.4.3_x86_64.rpm
su -l vagrant -c 'vagrant plugin install vagrant-mutate'
wget https://raw.githubusercontent.com/erik-smit/one-liners/master/qemu-img.vmdk3.hack.sh
chmod +x qemu-img.vmdk3.hack.sh
chown vagrant:vagrant qemu-img.vmdk3.hack.sh
SH
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment