-
-
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,} |
@stefancocora Thank you!
For those of you who don't have vagrant-substrate in pacman cache:
curl -o vagrant-substrate-599.d7cedfe-2-x86_64.pkg.tar.xz https://archive.archlinux.org/packages/v/vagrant-substrate/vagrant-substrate-599.d7cedfe-2-x86_64.pkg.tar.xz && sudo pacman -U vagrant-substrate-599.d7cedfe-2-x86_64.pkg.tar.xz
As of the package updates released a couple of days ago, the Ruby version has changed to 2.3.4
. I've updated the Gist to point to the new directory to install ruby-libvirt
to this directory. This fixes the following error after you've upgraded your packages.
/opt/vagrant/embedded/gems/gems/fog-libvirt-0.3.0/lib/fog/libvirt/requests/compute/list_domains.rb:76:in `domain_to_attributes': undefined method `active?' for #<Libvirt::Domain:0x00560c6c4108d8> (NoMethodError)
If you have added vagrant-substrate
to your IgnorePkg
list, remove it from the list and upgrade all Vagrant related packages, then rerun the latest version of this script.
Thanks! I had to run this two times since I didn't have ruby-libvirt gem installed, but it worked in the end.
Thanks ;)
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. 😄
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.
On the current Archlinux snapshot this guide fails with a marshalling error. [1]
The fix [2] is to downgrade the
vagrant-substrate
package before running the steps in this gist.Downgrading vagrant-substrate
[1]
Error encountered when installing the vagrant-libvirt plugin