Skip to content

Instantly share code, notes, and snippets.

@j883376
Last active April 13, 2021 18:00
Show Gist options
  • Save j883376/d90933620c7ed14daa4e0963e005377f to your computer and use it in GitHub Desktop.
Save j883376/d90933620c7ed14daa4e0963e005377f to your computer and use it in GitHub Desktop.
#!/bin/sh
# in case it's already installled
vagrant plugin uninstall vagrant-libvirt
# vagrant's copy of curl prevents the proper installation of ruby-libvirt
sudo mv /opt/vagrant/embedded/lib/libcurl.so{,.backup}
sudo mv /opt/vagrant/embedded/lib/libcurl.so.4{,.backup}
sudo mv /opt/vagrant/embedded/lib/libcurl.so.4.4.0{,.backup}
sudo mv /opt/vagrant/embedded/lib/pkgconfig/libcurl.pc{,.backup}
CONFIGURE_ARGS="with-libvirt-include=/usr/include/libvirt with-libvirt-lib=/usr/lib" vagrant plugin install vagrant-libvirt
# https://github.com/pradels/vagrant-libvirt/issues/541
export PATH=/opt/vagrant/embedded/bin:$PATH
export GEM_HOME=~/.vagrant.d/gems/2.3.4
export GEM_PATH=$GEM_HOME:/opt/vagrant/embedded/gems
gem uninstall ruby-libvirt
gem install ruby-libvirt
# put vagrant's copy of curl back
sudo mv /opt/vagrant/embedded/lib/libcurl.so{.backup,}
sudo mv /opt/vagrant/embedded/lib/libcurl.so.4{.backup,}
sudo mv /opt/vagrant/embedded/lib/libcurl.so.4.4.0{.backup,}
sudo mv /opt/vagrant/embedded/lib/pkgconfig/libcurl.pc{.backup,}
@kshlm
Copy link

kshlm commented Nov 9, 2017

As of the vagrant-2.0.1-1, this is no longer needed. I was able to just to a vagrant plugin install vagrant-libvirt and have it just work. 😄

@stefancocora
Copy link

Can confirm what @kshlm is saying.
For vagrant >= 2.0.1-1 the vagrant package replaces the vagrant-substrate, so vagrant-substrate isn't used anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment