Vagrant-libvirt: vagrant plugin install vagrant-libvirt not working

Created on 6 Feb 2018  路  7Comments  路  Source: vagrant-libvirt/vagrant-libvirt

Steps to reproduce

  1. vagrant plugin install vagrant-libvirt

Expected behaviour

plugin installed successfully

Actual behaviour

vagrant plugin install vagrant-libvirt
Installing the 'vagrant-libvirt' plugin. This can take a few minutes...
Fetching: excon-0.60.0.gem (100%)
Fetching: formatador-0.2.5.gem (100%)
Fetching: fog-core-1.43.0.gem (100%)
Fetching: mini_portile2-2.3.0.gem (100%)
Fetching: nokogiri-1.8.2.gem (100%)
Building native extensions. This could take a while...
Fetching: fog-json-1.0.2.gem (100%)
Fetching: fog-xml-0.1.3.gem (100%)
Building native extensions. This could take a while...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:

ERROR: Failed to build gem native extension.

current directory: /root/.vagrant.d/gems/2.4.3/gems/ruby-libvirt-0.7.0/ext/libvirt

/opt/vagrant/embedded/bin/ruby -r ./siteconf20180206-18650-26t2fc.rb extconf.rb
/opt/vagrant/embedded/lib/ruby/2.4.0/mkmf.rb:1551: warning: Insecure world writable dir /root/bin in PATH, mode 040777
* extconf.rb failed *
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/opt/vagrant/embedded/bin/$(RUBY_BASE_NAME)
--with-libvirt-include
--without-libvirt-include
--with-libvirt-lib
--without-libvirt-lib
--with-libvirt-config
--without-libvirt-config
--with-pkg-config
--without-pkg-config
extconf.rb:73:in `

': libvirt library not found in default locations (RuntimeError)

To see why this extension failed to compile, please check the mkmf.log which can be found here:

/root/.vagrant.d/gems/2.4.3/extensions/x86_64-linux/2.4.0/ruby-libvirt-0.7.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /root/.vagrant.d/gems/2.4.3/gems/ruby-libvirt-0.7.0 for inspection.
Results logged to /root/.vagrant.d/gems/2.4.3/extensions/x86_64-linux/2.4.0/ruby-libvirt-0.7.0/gem_make.out

System configuration

OS/Distro version::
SUSE Linux Enterprise Server 12 SP1

Libvirt version:
libvirtd (libvirt) 1.2.18.1

Output of vagrant version; vagrant plugin list:
2.0.2, no plugins available

Output of VAGRANT_LOG=debug vagrant ... --provider=libvirt

Insert debug output inside quotes here (replace ... with whatever command you use to trigger the issue)

install vagrant-libvirt plugin to proceed

A Vagrantfile to reproduce the issue:

Insert Vagrantfile inside quotes here (remove sensitive data if needed)

no need,
vagrant init debian/jessie64
vagrant up --provider=libvirt --debug

Are you using upstream vagrant package or your distros package?
Upstream / Distro
upstream

Most helpful comment

Issue resolved after this package

yum install libvirt-devel

All 7 comments

probably you need to install ruby-devel

It is working fine. Thank you

Hi, I see a similar error trace in Ubuntu 18.10 when I try to install the vagrant-libvirt plugin. In my case, adding the ruby-dev package does not resolve this error.

I 've tried: sudo apt install libvirt-dev first, then: vagrant plugin install vagrant-libvirt
The plugin installed successfully. My vagrant version is 2.2.5.

@mcandre ruby-dev will only help if using the distros provided package of vagrant, as otherwise a downloaded version will use the ruby embedded within vagrant and ignore the distro provided ruby-dev package. The vagrant provided ruby should have all the header files required in any case.

Issue resolved after this package

yum install libvirt-devel

Issue resolved on deb machine with package libvirt-dev

apt install libvirt-dev

Was this page helpful?
0 / 5 - 0 ratings