Skip to content

fail to install with error: "No working libvirt installation found" #1671

Closed
@iapicca

Description

@iapicca

I'm encountering the error below when running vagrant plugin install vagrant-libvirt

setup

  1. install homebrew

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. install in homebrew

    brew install --cask vagrant && \
    brew install make gcc qemu libiconv libvirt
  3. double check libvirt path

~ brew --prefix libvirt
/opt/homebrew/opt/libvirt

update path

HOMEBREW_HOME="/opt/homebrew/opt"
LIBICONV_HOME="$HOMEBREW_HOME/libiconv"

export PATH="$LIBICONV_HOME/bin:$PATH"
export PATH="$HOMEBREW_HOME/make/libexec/gnubin:$PATH"
export LDFLAGS="-L$LIBICONV_HOME/lib"
export CPPFLAGS="-I$LIBICONV_HOME/include"
export CONFIGURE_ARGS="with-libvirt-lib=$(brew --prefix libvirt)/lib with-libvirt-include=$(brew --prefix libvirt)/include"

error

~ vagrant plugin install vagrant-libvirt

Installing the 'vagrant-libvirt' plugin. This can take a few minutes...
Fetching formatador-1.1.0.gem
Fetching fog-core-2.3.0.gem
Fetching fog-json-1.2.0.gem
Fetching nokogiri-1.13.9-x86_64-darwin.gem
Fetching fog-xml-0.1.4.gem
Fetching ruby-libvirt-0.8.0.gem
Building native extensions. This could take a while...
Vagrant failed to properly resolve required dependencies. These
errors can commonly be caused by misconfigured plugin installations
or transient network issues. The reported error is:

ERROR: Failed to build gem native extension.

    current directory: /Users/yakforward/.vagrant.d/gems/2.7.6/gems/ruby-libvirt-0.8.0/ext/libvirt
/opt/vagrant/embedded/bin/ruby -I /opt/vagrant/embedded/lib/ruby/2.7.0 -r ./siteconf20221111-11883-1v7zec5.rb extconf.rb
Looking for libvirt in /opt/homebrew/opt/libvirt/include and /opt/homebrew/opt/libvirt/lib
checking for virConnectOpen() in -lvirt... no
*** 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
	--with-libvirt-lib
	--with-virt-dir
	--without-virt-dir
	--with-virt-include
	--without-virt-include=${virt-dir}/include
	--with-virt-lib
	--without-virt-lib=${virt-dir}/lib
	--with-virtlib
	--without-virtlib
extconf.rb:44:in `<main>': No working libvirt installation found (RuntimeError)

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

  /Users/yakforward/.vagrant.d/gems/2.7.6/extensions/x86_64-darwin-19/2.7.0/ruby-libvirt-0.8.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/yakforward/.vagrant.d/gems/2.7.6/gems/ruby-libvirt-0.8.0 for inspection.
Results logged to /Users/yakforward/.vagrant.d/gems/2.7.6/extensions/x86_64-darwin-19/2.7.0/ruby-libvirt-0.8.0/gem_make.out
info
~ neofetch
                    'c.          [email protected]
                 ,xNMM.          ---------------------------
               .OMMMMo           OS: macOS 13.0.1 22A400 arm64
               OMMM0,            Host: MacBookAir10,1
     .;loddo:' loolloddol;.      Kernel: 22.1.0
   cKMMMMMMMMMMNWMMMMMMMMMM0:    Uptime: 53 mins
 .KMMMMMMMMMMMMMMMMMMMMMMMWd.    Packages: 89 (brew)
 XMMMMMMMMMMMMMMMMMMMMMMMX.      Shell: zsh 5.8.1
;MMMMMMMMMMMMMMMMMMMMMMMM:       Resolution: 1440x900
:MMMMMMMMMMMMMMMMMMMMMMMM:       DE: Aqua
.MMMMMMMMMMMMMMMMMMMMMMMMX.      WM: Quartz Compositor
 kMMMMMMMMMMMMMMMMMMMMMMMMWd.    WM Theme: Blue (Dark)
 .XMMMMMMMMMMMMMMMMMMMMMMMMMMk   Terminal: iTerm2
  .XMMMMMMMMMMMMMMMMMMMMMMMMK.   Terminal Font: Monaco 12
    kMMMMMMMMMMMMMMMMMMMMMMd     CPU: Apple M1
     ;KMMMMMMMWXXWMMMMMMMk.      GPU: Apple M1
       .cooc,.    .,coo:.        Memory: 1129MiB / 8192MiB
~  vagrant --version
Vagrant 2.3.2

logs

mkmf.log
gem_make.out.zip

related issues:

#497
#818
#1017
#1461 (my own) cc @electrofelix

mirror:
stackoverflow

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions