Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install on OS X because of ruby-libvirt #497

Open
kontrafiktion opened this issue Oct 30, 2015 · 44 comments
Open

Cannot install on OS X because of ruby-libvirt #497

kontrafiktion opened this issue Oct 30, 2015 · 44 comments

Comments

@kontrafiktion
Copy link

Installing ruby-libvirt on OS X does not work because of

https://bugzilla.redhat.com/show_bug.cgi?id=1161338

domain.c:5439:29: error: use of undeclared identifier 'VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK'
                    INT2NUM(VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK));
                            ^
/opt/vagrant/embedded/include/ruby-2.0.0/ruby/ruby.h:1167:35: note: expanded from macro 'INT2NUM'
# define INT2NUM(v) INT2FIX((int)(v))
                                  ^
/opt/vagrant/embedded/include/ruby-2.0.0/ruby/ruby.h:241:45: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
                                            ^
domain.c:5443:29: error: use of undeclared identifier 'VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT'
                    INT2NUM(VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT));
                            ^
/opt/vagrant/embedded/include/ruby-2.0.0/ruby/ruby.h:1167:35: note: expanded from macro 'INT2NUM'
# define INT2NUM(v) INT2FIX((int)(v))
                                  ^
/opt/vagrant/embedded/include/ruby-2.0.0/ruby/ruby.h:241:45: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
                                            ^
domain.c:5447:29: error: use of undeclared identifier 'VIR_DOMAIN_QEMU_AGENT_COMMAND_NOWAIT'
                    INT2NUM(VIR_DOMAIN_QEMU_AGENT_COMMAND_NOWAIT));
                            ^
/opt/vagrant/embedded/include/ruby-2.0.0/ruby/ruby.h:1167:35: note: expanded from macro 'INT2NUM'
# define INT2NUM(v) INT2FIX((int)(v))
                                  ^
/opt/vagrant/embedded/include/ruby-2.0.0/ruby/ruby.h:241:45: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
                                            ^
domain.c:5451:29: error: use of undeclared identifier 'VIR_DOMAIN_QEMU_MONITOR_COMMAND_DEFAULT'
                    INT2NUM(VIR_DOMAIN_QEMU_MONITOR_COMMAND_DEFAULT));
                            ^
/opt/vagrant/embedded/include/ruby-2.0.0/ruby/ruby.h:1167:35: note: expanded from macro 'INT2NUM'
# define INT2NUM(v) INT2FIX((int)(v))
                                  ^
/opt/vagrant/embedded/include/ruby-2.0.0/ruby/ruby.h:241:45: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
                                            ^
domain.c:5455:29: error: use of undeclared identifier 'VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP'
                    INT2NUM(VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP));
                            ^
/opt/vagrant/embedded/include/ruby-2.0.0/ruby/ruby.h:1167:35: note: expanded from macro 'INT2NUM'
# define INT2NUM(v) INT2FIX((int)(v))
                                  ^
/opt/vagrant/embedded/include/ruby-2.0.0/ruby/ruby.h:241:45: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
@kontrafiktion
Copy link
Author

There is a workaround, but I would need to install my own version of ruby-libvirt for vagrant-libvirt?
I do not know enough about the plugin installation mechanism of vagrant. Any idea?

@aazon
Copy link

aazon commented Oct 30, 2015

@kontrafiktion Could you please describe a workaround for this issue?

@kontrafiktion
Copy link
Author

the workaround is described in https://bugzilla.redhat.com/show_bug.cgi?id=1161338, ruby-libvirt must be patched:

diff --git a/ext/libvirt/extconf.rb b/ext/libvirt/extconf.rb
index d5f4d74..72542fc 100644
--- a/ext/libvirt/extconf.rb
+++ b/ext/libvirt/extconf.rb
@@ -1,5 +1,7 @@
 require 'mkmf'

+$defs.push("-DHAVE_VIRDOMAINQEMUMONITORCOMMAND")
+
 RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
 RbConfig::MAKEFILE_CONFIG['CCDLFLAGS'] = ENV['CFLAGS'] if ENV['CFLAGS']
 RbConfig::MAKEFILE_CONFIG['EXTDLDFLAGS'] = ENV['CFLAGS'] if ENV['CFLAGS']

@Dennor
Copy link

Dennor commented Dec 15, 2015

Vagrant's embedded ruby's arch is i386 on OS X.

That's why, in my case, rather than patching ruby-libvirt it was enough to build libvirt with support for both, x86_64 and i386. Brew one won't work, as that one only has x86_64 symbols. After that necessery checks in ruby-libvirt suceeded.

EDIT: Install from brew after editing formula like so also works:

diff --git a/Library/Formula/libvirt.rb b/Library/Formula/libvirt.rb
index 20778ca..f7d7dcf 100644
--- a/Library/Formula/libvirt.rb
+++ b/Library/Formula/libvirt.rb
@@ -28,7 +28,10 @@ class Libvirt < Formula
     cause "Undefined symbols when linking"
   end

+  option :universal
+
   def install
+    ENV.universal_binary if build.universal?
     args = ["--prefix=#{prefix}",
             "--localstatedir=#{var}",
             "--mandir=#{man}",
@@ -36,11 +39,16 @@ class Libvirt < Formula
             "--with-esx",
             "--with-init-script=none",
             "--with-remote",
-            "--with-test",
-            "--with-vbox",
-            "--with-vmware",
-            "--with-yajl",
-            "--without-qemu"]
+            "--without-test",
+            "--without-vbox",
+            "--without-vmware",
+            "--without-yajl",
+            "--without-qemu",
+           "--without-tls",
+           "--without-ssh2",
+           "--without-dbus",
+           "--without-gnutls",
+       ]

     args << "--without-libvirtd" if build.without? "libvirtd"

@lonniev
Copy link

lonniev commented Dec 17, 2015

Sigh

@cao
Copy link

cao commented Jan 1, 2016

For those trying to install it on OS X without wanting to edit libvirt installation, the following commands install the fixed version of ruby-libvirt to Vagrant.

# build patched ruby-libvirt
git clone https://github.com/kontrafiktion/ruby-libvirt
cd ruby-libvirt
git checkout origin/bug-1161338
/opt/vagrant/embedded/bin/rake package

# install patched version to vagrant gems 
/opt/vagrant/embedded/bin/gem install -i ~/.vagrant.d/gems/ --local pkg/ruby-libvirt-0.6.0.gem

# install plugin
vagrant plugin install vagrant-libvirt

# success

For the more paranoid, clone git://libvirt.org/ruby-libvirt.git and port the changes that @kontrafiktion did to fix the bug (but which weren't merged upstream yet).

edited: full path for rake and gem

@lonniev
Copy link

lonniev commented Jan 2, 2016

I can get qemu, libvirt, ruby-libvirt, and vagrant-libvirt all to install now without patches. However, when I try to vagrant up —provider libvirt on the Mac OS host, I get:

with 'libvirt' provider...
/opt/vagrant/embedded/gems/gems/ruby-libvirt-0.6.0/lib/_libvirt.bundle: [BUG] Segmentation fault

and a long list of ruby files.

Has anyone successfully upped a vagrant with libvirt on Mac (El Capitan) with this recent libvirt stuff?

-- 
Lonnie VanZandt
303-900-3048

On 01 January 2016 at 12:42:00, Kevin Borgolte ([email protected]) wrote:

For those trying to install it on OS X without wanting to edit libvirt, the following commands install the fixed version ruby-libvirt to Vagrant.

build patched ruby-libvirt

git clone https://github.com/kontrafiktion/ruby-libvirt
cd ruby-libvirt
git checkout origin/bug-1161338
rake package

install patched version to vagrant gems

gem install -i ~/.vagrant.d/gems/ --local pkg/ruby-libvirt-0.6.0.gem

install plugin

vagrant plugin install vagrant-libvirt

success

For the more paranoid, clone git://libvirt.org/ruby-libvirt.git and port the changes that @kontrafiktion did to fix the bug (but which weren't merged upstream yet).


Reply to this email directly or view it on GitHub.

@JonnyBGod
Copy link

Tried all options with no luck. Still trying to find a way to work with vagrant-libvirt on OSX El Capitan.

Follows the log when trying to use @cao 's solution with latest ruby-libvirt (0.6.0).

Joaos-MacBook-Pro:ruby-libvirt joaoribeiro$ /opt/vagrant/embedded/bin/gem install -i ~/.vagrant.d/gems/ ruby-libvirt
Building native extensions.  This could take a while...
ERROR:  Error installing ruby-libvirt:
    ERROR: Failed to build gem native extension.

    /opt/vagrant/embedded/bin/ruby -r ./siteconf20160211-21965-5ainjq.rb extconf.rb
checking for virNetworkPtr in libvirt/libvirt.h... yes
checking for virStoragePoolPtr in libvirt/libvirt.h... yes
checking for virStorageVolPtr in libvirt/libvirt.h... yes
checking for virSecretPtr in libvirt/libvirt.h... yes
checking for virNWFilterPtr in libvirt/libvirt.h... yes
checking for virInterfacePtr in libvirt/libvirt.h... yes
checking for virDomainBlockInfoPtr in libvirt/libvirt.h... yes
checking for virDomainMemoryStatPtr in libvirt/libvirt.h... yes
checking for virDomainSnapshotPtr in libvirt/libvirt.h... yes
checking for virDomainJobInfoPtr in libvirt/libvirt.h... yes
checking for virNodeDevicePtr in libvirt/libvirt.h... yes
checking for virStreamPtr in libvirt/libvirt.h... yes
checking for virTypedParameterPtr in libvirt/libvirt.h... yes
checking for virDomainBlockJobInfoPtr in libvirt/libvirt.h... yes
checking for virStorageVolWipe() in libvirt/libvirt.h... no
checking for virStoragePoolIsActive() in libvirt/libvirt.h... no
checking for virStoragePoolIsPersistent() in libvirt/libvirt.h... no
checking for virStorageVolCreateXMLFrom() in libvirt/libvirt.h... no
checking for virConnectGetLibVersion() in libvirt/libvirt.h... no
checking for virConnectIsEncrypted() in libvirt/libvirt.h... no
checking for virConnectIsSecure() in libvirt/libvirt.h... no
checking for virNetworkIsActive() in libvirt/libvirt.h... no
checking for virNetworkIsPersistent() in libvirt/libvirt.h... no
checking for virNodeDeviceCreateXML() in libvirt/libvirt.h... no
checking for virNodeDeviceDestroy() in libvirt/libvirt.h... no
checking for virInterfaceIsActive() in libvirt/libvirt.h... no
checking for virDomainMigrateToURI() in libvirt/libvirt.h... no
checking for virDomainMigrateSetMaxDowntime() in libvirt/libvirt.h... no
checking for virDomainManagedSave() in libvirt/libvirt.h... no
checking for virDomainIsActive() in libvirt/libvirt.h... no
checking for virDomainIsPersistent() in libvirt/libvirt.h... no
checking for virConnectDomainXMLFromNative() in libvirt/libvirt.h... no
checking for virConnectDomainXMLToNative() in libvirt/libvirt.h... no
checking for virDomainCreateWithFlags() in libvirt/libvirt.h... no
checking for virDomainAttachDeviceFlags() in libvirt/libvirt.h... no
checking for virDomainDetachDeviceFlags() in libvirt/libvirt.h... no
checking for virDomainUpdateDeviceFlags() in libvirt/libvirt.h... no
checking for virNodeGetSecurityModel() in libvirt/libvirt.h... no
checking for virDomainCreateXML() in libvirt/libvirt.h... no
checking for virDomainGetSecurityLabel() in libvirt/libvirt.h... no
checking for virConnectCompareCPU() in libvirt/libvirt.h... no
checking for virConnectBaselineCPU() in libvirt/libvirt.h... no
checking for virDomainSetVcpusFlags() in libvirt/libvirt.h... no
checking for virDomainGetVcpusFlags() in libvirt/libvirt.h... no
checking for virConnectDomainEventRegisterAny() in libvirt/libvirt.h... no
checking for virConnectDomainEventRegister() in libvirt/libvirt.h... no
checking for virDomainBlockPeek() in libvirt/libvirt.h... no
checking for virDomainMemoryPeek() in libvirt/libvirt.h... no
checking for virConnectOpenAuth() in libvirt/libvirt.h... no
checking for virEventRegisterImpl() in libvirt/libvirt.h... no
checking for virDomainIsUpdated() in libvirt/libvirt.h... no
checking for virDomainSetMemoryParameters() in libvirt/libvirt.h... no
checking for virConnectGetSysinfo() in libvirt/libvirt.h... no
checking for virDomainSetBlkioParameters() in libvirt/libvirt.h... no
checking for virDomainSetMemoryFlags() in libvirt/libvirt.h... no
checking for virDomainGetState() in libvirt/libvirt.h... no
checking for virDomainOpenConsole() in libvirt/libvirt.h... no
checking for virDomainMigrate2() in libvirt/libvirt.h... no
checking for virDomainScreenshot() in libvirt/libvirt.h... no
checking for virInterfaceChangeBegin() in libvirt/libvirt.h... no
checking for virStorageVolDownload() in libvirt/libvirt.h... no
checking for virDomainInjectNMI() in libvirt/libvirt.h... no
checking for virDomainGetControlInfo() in libvirt/libvirt.h... no
checking for virDomainMigrateGetMaxSpeed() in libvirt/libvirt.h... no
checking for virNodeGetCPUStats() in libvirt/libvirt.h... no
checking for virNodeGetMemoryStats() in libvirt/libvirt.h... no
checking for virDomainDestroyFlags() in libvirt/libvirt.h... no
checking for virDomainSaveFlags() in libvirt/libvirt.h... no
checking for virDomainSaveImageGetXMLDesc() in libvirt/libvirt.h... no
checking for virDomainSendKey() in libvirt/libvirt.h... no
checking for virNetworkUpdate() in libvirt/libvirt.h... no
checking for virNodeSuspendForDuration() in libvirt/libvirt.h... no
checking for virNodeGetMemoryParameters() in libvirt/libvirt.h... no
checking for virNodeGetCPUMap() in libvirt/libvirt.h... no
checking for virDomainUndefineFlags() in libvirt/libvirt.h... no
checking for virDomainPinVcpuFlags() in libvirt/libvirt.h... no
checking for virDomainGetVcpuPinInfo() in libvirt/libvirt.h... no
checking for virDomainSnapshotGetName() in libvirt/libvirt.h... no
checking for virConnectSetKeepAlive() in libvirt/libvirt.h... no
checking for virDomainReset() in libvirt/libvirt.h... no
checking for virDomainShutdownFlags() in libvirt/libvirt.h... no
checking for virDomainGetHostname() in libvirt/libvirt.h... no
checking for virDomainGetMetadata() in libvirt/libvirt.h... no
checking for virDomainSetMetadata() in libvirt/libvirt.h... no
checking for virConnectListAllDomains() in libvirt/libvirt.h... no
checking for virConnectListAllNetworks() in libvirt/libvirt.h... no
checking for virConnectListAllInterfaces() in libvirt/libvirt.h... no
checking for virConnectListAllSecrets() in libvirt/libvirt.h... no
checking for virConnectListAllNodeDevices() in libvirt/libvirt.h... no
checking for virConnectListAllStoragePools() in libvirt/libvirt.h... no
checking for virConnectListAllNWFilters() in libvirt/libvirt.h... no
checking for virConnectIsAlive() in libvirt/libvirt.h... no
checking for virNodeDeviceDetachFlags() in libvirt/libvirt.h... no
checking for virDomainSendProcessSignal() in libvirt/libvirt.h... no
checking for virDomainListAllSnapshots() in libvirt/libvirt.h... no
checking for virDomainSnapshotNumChildren() in libvirt/libvirt.h... no
checking for virDomainSnapshotListChildrenNames() in libvirt/libvirt.h... no
checking for virDomainSnapshotListAllChildren() in libvirt/libvirt.h... no
checking for virDomainSnapshotGetParent() in libvirt/libvirt.h... no
checking for virDomainSnapshotIsCurrent() in libvirt/libvirt.h... no
checking for virDomainSnapshotHasMetadata() in libvirt/libvirt.h... no
checking for virDomainSetMemoryStatsPeriod() in libvirt/libvirt.h... no
checking for virDomainFSTrim() in libvirt/libvirt.h... no
checking for virDomainBlockRebase() in libvirt/libvirt.h... no
checking for virDomainOpenChannel() in libvirt/libvirt.h... no
checking for virNodeDeviceLookupSCSIHostByWWN() in libvirt/libvirt.h... no
checking for virStorageVolWipePattern() in libvirt/libvirt.h... no
checking for virStoragePoolListAllVolumes() in libvirt/libvirt.h... no
checking for virDomainCreateWithFiles() in libvirt/libvirt.h... no
checking for virDomainCreateXMLWithFiles() in libvirt/libvirt.h... no
checking for virDomainOpenGraphics() in libvirt/libvirt.h... no
checking for virStorageVolResize() in libvirt/libvirt.h... no
checking for virDomainPMWakeup() in libvirt/libvirt.h... no
checking for virDomainBlockResize() in libvirt/libvirt.h... no
checking for virDomainPMSuspendForDuration() in libvirt/libvirt.h... no
checking for virDomainMigrateGetCompressionCache() in libvirt/libvirt.h... no
checking for virDomainMigrateSetCompressionCache() in libvirt/libvirt.h... no
checking for virDomainGetDiskErrors() in libvirt/libvirt.h... no
checking for virDomainGetEmulatorPinInfo() in libvirt/libvirt.h... no
checking for virDomainPinEmulator() in libvirt/libvirt.h... no
checking for virDomainGetSecurityLabelList() in libvirt/libvirt.h... no
checking for virDomainGetJobStats() in libvirt/libvirt.h... no
checking for virDomainGetBlockIoTune() in libvirt/libvirt.h... no
checking for virDomainSetBlockIoTune() in libvirt/libvirt.h... no
checking for virDomainBlockCommit() in libvirt/libvirt.h... no
checking for virDomainBlockPull() in libvirt/libvirt.h... no
checking for virDomainBlockJobSetSpeed() in libvirt/libvirt.h... no
checking for virDomainGetBlockJobInfo() in libvirt/libvirt.h... no
checking for virDomainBlockJobAbort() in libvirt/libvirt.h... no
checking for virDomainGetInterfaceParameters() in libvirt/libvirt.h... no
checking for virDomainBlockStatsFlags() in libvirt/libvirt.h... no
checking for virDomainGetNumaParameters() in libvirt/libvirt.h... no
checking for virConnectGetCPUModelNames() in libvirt/libvirt.h... no
checking for virDomainMigrate3() in libvirt/libvirt.h... no
checking for virDomainGetCPUStats() in libvirt/libvirt.h... no
checking for virNetworkGetDHCPLeases() in libvirt/libvirt.h... no
checking for virNodeAllocPages() in libvirt/libvirt.h... no
checking for virDomainGetTime() in libvirt/libvirt.h... no
checking for virDomainSetTime() in libvirt/libvirt.h... no
checking for virConnectGetDomainCapabilities() in libvirt/libvirt.h... no
checking for virDomainCoreDumpWithFormat() in libvirt/libvirt.h... no
checking for virDomainFSFreeze() in libvirt/libvirt.h... no
checking for virDomainFSThaw() in libvirt/libvirt.h... no
checking for virDomainGetFSInfo() in libvirt/libvirt.h... no
checking for virNodeGetFreePages() in libvirt/libvirt.h... no
checking for VIR_MIGRATE_LIVE in libvirt/libvirt.h... yes
checking for VIR_MIGRATE_PEER2PEER in libvirt/libvirt.h... yes
checking for VIR_MIGRATE_TUNNELLED in libvirt/libvirt.h... yes
checking for VIR_MIGRATE_PERSIST_DEST in libvirt/libvirt.h... yes
checking for VIR_MIGRATE_UNDEFINE_SOURCE in libvirt/libvirt.h... yes
checking for VIR_MIGRATE_PAUSED in libvirt/libvirt.h... yes
checking for VIR_MIGRATE_NON_SHARED_DISK in libvirt/libvirt.h... yes
checking for VIR_MIGRATE_NON_SHARED_INC in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_XML_UPDATE_CPU in libvirt/libvirt.h... yes
checking for VIR_MEMORY_PHYSICAL in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_START_PAUSED in libvirt/libvirt.h... yes
checking for VIR_DUMP_CRASH in libvirt/libvirt.h... yes
checking for VIR_DUMP_LIVE in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_DEVICE_MODIFY_CURRENT in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_DEVICE_MODIFY_LIVE in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_DEVICE_MODIFY_CONFIG in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_DEVICE_MODIFY_FORCE in libvirt/libvirt.h... yes
checking for VIR_INTERFACE_XML_INACTIVE in libvirt/libvirt.h... yes
checking for VIR_STORAGE_POOL_INACCESSIBLE in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_EVENT_DEFINED in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_EVENT_STARTED in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_EVENT_SUSPENDED_IOERROR in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_EVENT_ID_WATCHDOG in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_EVENT_ID_IO_ERROR in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_EVENT_ID_GRAPHICS in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_EVENT_ID_REBOOT in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_EVENT_ID_RTC_CHANGE in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_AFFECT_CURRENT in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_MEM_CURRENT in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_EVENT_ID_CONTROL_ERROR in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_PAUSED_SHUTTING_DOWN in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_START_AUTODESTROY in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_START_BYPASS_CACHE in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_START_FORCE_BOOT in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON in libvirt/libvirt.h... yes
checking for VIR_DUMP_BYPASS_CACHE in libvirt/libvirt.h... yes
checking for VIR_MIGRATE_CHANGE_PROTECTION in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_SAVE_BYPASS_CACHE in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_SAVE_RUNNING in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_SAVE_PAUSED in libvirt/libvirt.h... yes
checking for VIR_NETWORK_UPDATE_COMMAND_NONE in libvirt/libvirt.h... yes
checking for VIR_NETWORK_UPDATE_COMMAND_MODIFY in libvirt/libvirt.h... yes
checking for VIR_NETWORK_UPDATE_COMMAND_DELETE in libvirt/libvirt.h... yes
checking for VIR_NETWORK_UPDATE_COMMAND_ADD_LAST in libvirt/libvirt.h... yes
checking for VIR_NETWORK_UPDATE_COMMAND_ADD_FIRST in libvirt/libvirt.h... yes
checking for VIR_NETWORK_SECTION_NONE in libvirt/libvirt.h... yes
checking for VIR_NETWORK_SECTION_BRIDGE in libvirt/libvirt.h... yes
checking for VIR_NETWORK_SECTION_DOMAIN in libvirt/libvirt.h... yes
checking for VIR_NETWORK_SECTION_IP in libvirt/libvirt.h... yes
checking for VIR_NETWORK_SECTION_IP_DHCP_HOST in libvirt/libvirt.h... yes
checking for VIR_NETWORK_SECTION_IP_DHCP_RANGE in libvirt/libvirt.h... yes
checking for VIR_NETWORK_SECTION_FORWARD in libvirt/libvirt.h... yes
checking for VIR_NETWORK_SECTION_FORWARD_INTERFACE in libvirt/libvirt.h... yes
checking for VIR_NETWORK_SECTION_FORWARD_PF in libvirt/libvirt.h... yes
checking for VIR_NETWORK_SECTION_PORTGROUP in libvirt/libvirt.h... yes
checking for VIR_NETWORK_SECTION_DNS_HOST in libvirt/libvirt.h... yes
checking for VIR_NETWORK_SECTION_DNS_TXT in libvirt/libvirt.h... yes
checking for VIR_NETWORK_SECTION_DNS_SRV in libvirt/libvirt.h... yes
checking for VIR_NETWORK_UPDATE_AFFECT_CURRENT in libvirt/libvirt.h... yes
checking for VIR_NETWORK_UPDATE_AFFECT_LIVE in libvirt/libvirt.h... yes
checking for VIR_NETWORK_UPDATE_AFFECT_CONFIG in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_PMSUSPENDED in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_RUNNING_WAKEUP in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_PMSUSPENDED_UNKNOWN in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_UNDEFINE_MANAGED_SAVE in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_PAUSED_SNAPSHOT in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_PMSUSPENDED_DISK_UNKNOWN in libvirt/libvirt.h... yes
checking for VIR_DUMP_RESET in libvirt/libvirt.h... yes
checking for VIR_DUMP_MEMORY_ONLY in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_SHUTDOWN_DEFAULT in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_SHUTDOWN_GUEST_AGENT in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_SHUTDOWN_INITCTL in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_SHUTDOWN_SIGNAL in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_REBOOT_DEFAULT in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_REBOOT_ACPI_POWER_BTN in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_REBOOT_GUEST_AGENT in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_REBOOT_INITCTL in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_REBOOT_SIGNAL in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_DESTROY_DEFAULT in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_DESTROY_GRACEFUL in libvirt/libvirt.h... yes
checking for VIR_CONNECT_LIST_NODE_DEVICES_CAP_FC_HOST in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_SNAPSHOT_LIST_INACTIVE in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_SNAPSHOT_CREATE_LIVE in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_BLOCK_REBASE_SHALLOW in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_BLOCK_REBASE_COPY_RAW in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_BLOCK_REBASE_COPY in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_CHANNEL_FORCE in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_CONSOLE_FORCE in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_CONSOLE_SAFE in libvirt/libvirt.h... yes
checking for VIR_STORAGE_VOL_WIPE_ALG_ZERO in libvirt/libvirt.h... yes
checking for VIR_STORAGE_VOL_WIPE_ALG_NNSA in libvirt/libvirt.h... yes
checking for VIR_STORAGE_VOL_WIPE_ALG_DOD in libvirt/libvirt.h... yes
checking for VIR_STORAGE_VOL_WIPE_ALG_BSI in libvirt/libvirt.h... yes
checking for VIR_STORAGE_VOL_WIPE_ALG_GUTMANN in libvirt/libvirt.h... yes
checking for VIR_STORAGE_VOL_WIPE_ALG_SCHNEIER in libvirt/libvirt.h... yes
checking for VIR_STORAGE_VOL_WIPE_ALG_PFITZNER7 in libvirt/libvirt.h... yes
checking for VIR_STORAGE_VOL_WIPE_ALG_PFITZNER33 in libvirt/libvirt.h... yes
checking for VIR_STORAGE_VOL_WIPE_ALG_RANDOM in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_BLOCK_RESIZE_BYTES in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_MEMORY_STAT_RSS in libvirt/libvirt.h... yes
checking for VIR_MIGRATE_UNSAFE in libvirt/libvirt.h... yes
checking for VIR_MIGRATE_OFFLINE in libvirt/libvirt.h... yes
checking for VIR_MIGRATE_COMPRESSED in libvirt/libvirt.h... yes
checking for VIR_MIGRATE_ABORT_ON_ERROR in libvirt/libvirt.h... yes
checking for VIR_CONNECT_NO_ALIASES in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_XML_MIGRATABLE in libvirt/libvirt.h... yes
checking for VIR_NETWORK_XML_INACTIVE in libvirt/libvirt.h... yes
checking for VIR_STORAGE_VOL_DIR in libvirt/libvirt.h... yes
checking for VIR_STORAGE_VOL_NETWORK in libvirt/libvirt.h... yes
checking for VIR_STORAGE_XML_INACTIVE in libvirt/libvirt.h... yes
checking for VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA in libvirt/libvirt.h... yes
checking for VIR_SECRET_USAGE_TYPE_CEPH in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_SNAPSHOT_REVERT_FORCE in libvirt/libvirt.h... yes
checking for VIR_SECRET_USAGE_TYPE_ISCSI in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_NOSTATE_UNKNOWN in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_RUNNING_CRASHED in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_PAUSED_CRASHED in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_CRASHED_PANICKED in libvirt/libvirt.h... yes
checking for VIR_NODE_CPU_STATS_ALL_CPUS in libvirt/libvirt.h... yes
checking for VIR_NODE_MEMORY_STATS_ALL_CELLS in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_VCPU_CURRENT in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_VCPU_GUEST in libvirt/libvirt.h... yes
checking for VIR_NETWORK_UPDATE_COMMAND_DELETE in libvirt/libvirt.h... yes
checking for VIR_STORAGE_POOL_BUILD_NO_OVERWRITE in libvirt/libvirt.h... yes
checking for VIR_STORAGE_POOL_BUILD_OVERWRITE in libvirt/libvirt.h... yes
checking for VIR_KEYCODE_SET_LINUX in libvirt/libvirt.h... yes
checking for VIR_KEYCODE_SET_XT in libvirt/libvirt.h... yes
checking for VIR_KEYCODE_SET_ATSET1 in libvirt/libvirt.h... yes
checking for VIR_KEYCODE_SET_ATSET2 in libvirt/libvirt.h... yes
checking for VIR_KEYCODE_SET_ATSET3 in libvirt/libvirt.h... yes
checking for VIR_KEYCODE_SET_OSX in libvirt/libvirt.h... yes
checking for VIR_KEYCODE_SET_XT_KBD in libvirt/libvirt.h... yes
checking for VIR_KEYCODE_SET_USB in libvirt/libvirt.h... yes
checking for VIR_KEYCODE_SET_WIN32 in libvirt/libvirt.h... yes
checking for VIR_KEYCODE_SET_RFB in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_EVENT_SHUTDOWN in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_EVENT_PMSUSPENDED in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_EVENT_CRASHED in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_EVENT_STARTED_WAKEUP in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_EVENT_SUSPENDED_RESTORED in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_EVENT_SHUTDOWN_FINISHED in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_EVENT_PMSUSPENDED_MEMORY in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_EVENT_PMSUSPENDED_DISK in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_EVENT_CRASHED_PANICKED in libvirt/libvirt.h... yes
checking for VIR_SECRET_USAGE_TYPE_NONE in libvirt/libvirt.h... yes
checking for VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_UNIX in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_BLOCK_COMMIT_SHALLOW in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_BLOCK_COMMIT_DELETE in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_BLOCK_JOB_TYPE_PULL in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_BLOCK_JOB_TYPE_COPY in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_BLOCK_JOB_COMPLETED in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_BLOCK_JOB_FAILED in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_BLOCK_JOB_CANCELED in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_BLOCK_JOB_READY in libvirt/libvirt.h... yes
checking for VIR_NODE_MEMORY_SHARED_MERGE_ACROSS_NODES in libvirt/libvirt.h... no
checking for VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC in libvirt/libvirt.h... yes
checking for VIR_MIGRATE_PARAM_LISTEN_ADDRESS in libvirt/libvirt.h... no
checking for VIR_DOMAIN_SCHEDULER_EMULATOR_PERIOD in libvirt/libvirt.h... no
checking for VIR_DOMAIN_SCHEDULER_EMULATOR_QUOTA in libvirt/libvirt.h... no
checking for VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC in libvirt/libvirt.h... yes
checking for VIR_CONNECT_LIST_STORAGE_POOLS_GLUSTER in libvirt/libvirt.h... yes
checking for VIR_CONNECT_LIST_STORAGE_POOLS_ZFS in libvirt/libvirt.h... yes
checking for VIR_STORAGE_VOL_NETDIR in libvirt/libvirt.h... yes
checking for VIR_IP_ADDR_TYPE_IPV4 in libvirt/libvirt.h... yes
checking for VIR_IP_ADDR_TYPE_IPV6 in libvirt/libvirt.h... yes
checking for VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_UNDEFINE_NVRAM in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_BLOCK_JOB_INFO_BANDWIDTH_BYTES in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_BLOCK_JOB_SPEED_BANDWIDTH_BYTES in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_BLOCK_COMMIT_ACTIVE in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_BLOCK_COMMIT_RELATIVE in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES in libvirt/libvirt.h... yes
checking for VIR_DOMAIN_BLOCK_IOTUNE_SIZE_IOPS_SEC in libvirt/libvirt.h... no
checking for VIR_FROM_VMWARE in libvirt/virterror.h... yes
checking for VIR_FROM_AUDIT in libvirt/virterror.h... yes
checking for VIR_FROM_SYSINFO in libvirt/virterror.h... yes
checking for VIR_FROM_STREAMS in libvirt/virterror.h... yes
checking for VIR_FROM_XENAPI in libvirt/virterror.h... yes
checking for VIR_FROM_HOOK in libvirt/virterror.h... yes
checking for VIR_ERR_HOOK_SCRIPT_FAILED in libvirt/virterror.h... yes
checking for VIR_ERR_MIGRATE_PERSIST_FAILED in libvirt/virterror.h... yes
checking for VIR_ERR_OPERATION_TIMEOUT in libvirt/virterror.h... yes
checking for VIR_ERR_CONFIG_UNSUPPORTED in libvirt/virterror.h... yes
checking for VIR_FROM_XENXM in libvirt/virterror.h... yes
checking for VIR_ERR_OPERATION_INVALID in libvirt/virterror.h... yes
checking for VIR_ERR_NO_SECURITY_MODEL in libvirt/virterror.h... yes
checking for VIR_ERR_AUTH_FAILED in libvirt/virterror.h... yes
checking for VIR_FROM_PHYP in libvirt/virterror.h... yes
checking for VIR_FROM_ESX in libvirt/virterror.h... yes
checking for VIR_FROM_ONE in libvirt/virterror.h... yes
checking for VIR_FROM_VBOX in libvirt/virterror.h... yes
checking for VIR_FROM_LXC in libvirt/virterror.h... yes
checking for VIR_FROM_UML in libvirt/virterror.h... yes
checking for VIR_FROM_NETWORK in libvirt/virterror.h... yes
checking for VIR_FROM_DOMAIN in libvirt/virterror.h... yes
checking for VIR_FROM_STATS_LINUX in libvirt/virterror.h... yes
checking for VIR_FROM_XEN_INOTIFY in libvirt/virterror.h... yes
checking for VIR_FROM_SECURITY in libvirt/virterror.h... yes
checking for VIR_DOMAIN_CORE_DUMP_FORMAT_RAW in libvirt/virterror.h... yes
checking for VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB in libvirt/virterror.h... yes
checking for VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_LZO in libvirt/virterror.h... yes
checking for VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_SNAPPY in libvirt/virterror.h... yes
checking for VIR_MIGRATE_AUTO_CONVERGE in libvirt/virterror.h... yes
checking for VIR_MIGRATE_RDMA_PIN_ALL in libvirt/virterror.h... yes
checking for VIR_DOMAIN_SHUTDOWN_PARAVIRT in libvirt/virterror.h... yes
checking for VIR_DOMAIN_REBOOT_PARAVIRT in libvirt/virterror.h... yes
checking for libvirt/libvirt-qemu.h... yes
checking for virDomainQemuMonitorCommand() in -lvirt-qemu... no
checking for virDomainQemuMonitorCommand() in libvirt/libvirt-qemu.h... no
checking for virDomainQemuAttach() in libvirt/libvirt-qemu.h... no
checking for virDomainQemuAgentCommand() in libvirt/libvirt-qemu.h... no
checking for VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK in libvirt/libvirt-qemu.h... yes
checking for VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT in libvirt/libvirt-qemu.h... yes
checking for VIR_DOMAIN_QEMU_AGENT_COMMAND_NOWAIT in libvirt/libvirt-qemu.h... yes
checking for VIR_DOMAIN_QEMU_MONITOR_COMMAND_DEFAULT in libvirt/libvirt-qemu.h... yes
checking for VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP in libvirt/libvirt-qemu.h... yes
checking for libvirt/libvirt-lxc.h... yes
checking for virDomainLxcOpenNamespace() in -lvirt-lxc... no
checking for virDomainLxcOpenNamespace() in libvirt/libvirt-lxc.h... no
checking for virDomainLxcEnterNamespace() in libvirt/libvirt-lxc.h... no
checking for virDomainLxcEnterSecurityLabel() in libvirt/libvirt-lxc.h... no
creating extconf.h
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling _libvirt.c
compiling common.c
In file included from common.c:27:
/opt/vagrant/embedded/include/ruby-2.2.0/ruby/backward/st.h:2:2: warning: use "ruby/st.h" instead of bare "st.h" [-W#warnings]
#warning use "ruby/st.h" instead of bare "st.h"
 ^
1 warning generated.
In file included from common.c:27:
/opt/vagrant/embedded/include/ruby-2.2.0/ruby/backward/st.h:2:2: warning: use "ruby/st.h" instead of bare "st.h" [-W#warnings]
#warning use "ruby/st.h" instead of bare "st.h"
 ^
1 warning generated.
compiling connect.c
compiling domain.c
In file included from domain.c:26:
/opt/vagrant/embedded/include/ruby-2.2.0/ruby/backward/st.h:2:2: warning: use "ruby/st.h" instead of bare "st.h" [-W#warnings]
#warning use "ruby/st.h" instead of bare "st.h"
 ^
domain.c:5696:29: error: use of undeclared identifier 'VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK'
                    INT2NUM(VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK));
                            ^
/opt/vagrant/embedded/include/ruby-2.2.0/ruby/ruby.h:1297:35: note: expanded from macro 'INT2NUM'
# define INT2NUM(v) INT2FIX((int)(v))
                                  ^
/opt/vagrant/embedded/include/ruby-2.2.0/ruby/ruby.h:234:30: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) (((VALUE)(i))<<1 | FIXNUM_FLAG)
                             ^
domain.c:5700:29: error: use of undeclared identifier 'VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT'
                    INT2NUM(VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT));
                            ^
/opt/vagrant/embedded/include/ruby-2.2.0/ruby/ruby.h:1297:35: note: expanded from macro 'INT2NUM'
# define INT2NUM(v) INT2FIX((int)(v))
                                  ^
/opt/vagrant/embedded/include/ruby-2.2.0/ruby/ruby.h:234:30: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) (((VALUE)(i))<<1 | FIXNUM_FLAG)
                             ^
domain.c:5704:29: error: use of undeclared identifier 'VIR_DOMAIN_QEMU_AGENT_COMMAND_NOWAIT'
                    INT2NUM(VIR_DOMAIN_QEMU_AGENT_COMMAND_NOWAIT));
                            ^
/opt/vagrant/embedded/include/ruby-2.2.0/ruby/ruby.h:1297:35: note: expanded from macro 'INT2NUM'
# define INT2NUM(v) INT2FIX((int)(v))
                                  ^
/opt/vagrant/embedded/include/ruby-2.2.0/ruby/ruby.h:234:30: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) (((VALUE)(i))<<1 | FIXNUM_FLAG)
                             ^
domain.c:5708:29: error: use of undeclared identifier 'VIR_DOMAIN_QEMU_MONITOR_COMMAND_DEFAULT'
                    INT2NUM(VIR_DOMAIN_QEMU_MONITOR_COMMAND_DEFAULT));
                            ^
/opt/vagrant/embedded/include/ruby-2.2.0/ruby/ruby.h:1297:35: note: expanded from macro 'INT2NUM'
# define INT2NUM(v) INT2FIX((int)(v))
                                  ^
/opt/vagrant/embedded/include/ruby-2.2.0/ruby/ruby.h:234:30: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) (((VALUE)(i))<<1 | FIXNUM_FLAG)
                             ^
domain.c:5712:29: error: use of undeclared identifier 'VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP'
                    INT2NUM(VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP));
                            ^
/opt/vagrant/embedded/include/ruby-2.2.0/ruby/ruby.h:1297:35: note: expanded from macro 'INT2NUM'
# define INT2NUM(v) INT2FIX((int)(v))
                                  ^
/opt/vagrant/embedded/include/ruby-2.2.0/ruby/ruby.h:234:30: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) (((VALUE)(i))<<1 | FIXNUM_FLAG)
                             ^
1 warning and 5 errors generated.
make: *** [domain.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/joaoribeiro/.vagrant.d/gems/gems/ruby-libvirt-0.6.0 for inspection.
Results logged to /Users/joaoribeiro/.vagrant.d/gems/extensions/universal-darwin-12/2.2.0/ruby-libvirt-0.6.0/gem_make.out

@cao
Copy link

cao commented Feb 11, 2016

Did you port the patches manually to your ruby-libvirt 0.6.0 source tree? The repository from @kontrafiktion is ruby-libvirt 0.5.2, so to install 0.6.0 you need to port the following changes manually: https://github.com/kontrafiktion/ruby-libvirt/compare/bug-1161338 and https://github.com/kontrafiktion/ruby-libvirt/commit/3f768dc492353a143b45c08180fcd690885c2b09 (OSX specific).

You should also make sure that you are installing the local gem and not installing from source the remote one. Instead of

/opt/vagrant/embedded/bin/gem install -i ~/.vagrant.d/gems/ ruby-libvirt

you should try:

/opt/vagrant/embedded/bin/gem install -i ~/.vagrant.d/gems/ --local pkg/ruby-libvirt-0.6.0.gem

(after you did /opt/vagrant/embedded/bin/rake package of course).

I am running ruby-libvirt 0.6.0 on OS X El Capitan (10.11.3) without an issue.

// Added missing patch.

@JonnyBGod
Copy link

Yes I ported the changes manually and did exactly as you describe.

I managed do install it by using the gem 2.4.8 instead of the vagrant embedded one but got a different problem. When vagrant up --provider=libvirt pxeclient I got an "libvirt-soc: Does not exist." similar error.

@JonnyBGod
Copy link

Log here:

Joaos-MacBook-Pro:metal-controller joaoribeiro$ vagrant plugin install vagrant-libvirt
Installing the 'vagrant-libvirt' plugin. This can take a few minutes...
Installed the plugin 'vagrant-libvirt (0.0.32)'!
Joaos-MacBook-Pro:metal-controller joaoribeiro$ vagrant up --provider=libvirt pxeclientBringing machine 'pxeclient' up with 'libvirt' provider...
Error while connecting to libvirt: Error making a connection to libvirt URI qemu:///system?no_verify=1&keyfile=/Users/joaoribeiro/.ssh/id_rsa&socket=/var/run/libvirt/libvirt-sock:
Call to virConnectOpen failed: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory

@Grejeru
Copy link

Grejeru commented Feb 11, 2016

@cao
There is one more change which is not in the compare and is required:

https://github.com/kontrafiktion/ruby-libvirt/commit/3f768dc492353a143b45c08180fcd690885c2b09

After adding this one I've managed to compile it without errors (I've had same as @JonnyBGod ).

All changes I've added at mine clone to ensure it's working ( Grejeru/ruby-libvirt@7f9e41d ).

@mastermindg
Copy link

@Grejeru I cloned your repo and installed the libvirt gem. The patched version installed ok but I'm still unable to install the vagrant-libvirt on 10.11.3.

I'm getting the following error:

/opt/vagrant/embedded/include/ruby-2.0.0/ruby/backward/st.h:2:2: warning: use "ruby/st.h" instead of bare "st.h" [-W#warnings]
#warning use "ruby/st.h" instead of bare "st.h"
 ^
1 warning generated.
In file included from common.c:27:
/opt/vagrant/embedded/include/ruby-2.0.0/ruby/backward/st.h:2:2: warning: use "ruby/st.h" instead of bare "st.h" [-W#warnings]
#warning use "ruby/st.h" instead of bare "st.h"
 ^
1 warning generated.
compiling connect.c
compiling domain.c
In file included from domain.c:26:
/opt/vagrant/embedded/include/ruby-2.0.0/ruby/backward/st.h:2:2: warning: use "ruby/st.h" instead of bare "st.h" [-W#warnings]
#warning use "ruby/st.h" instead of bare "st.h"
 ^
domain.c:5696:29: error: use of undeclared identifier 'VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK'
                    INT2NUM(VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK));
                            ^
/opt/vagrant/embedded/include/ruby-2.0.0/ruby/ruby.h:1167:35: note: expanded from macro 'INT2NUM'
# define INT2NUM(v) INT2FIX((int)(v))
                                  ^
/opt/vagrant/embedded/include/ruby-2.0.0/ruby/ruby.h:241:45: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
                                            ^
domain.c:5700:29: error: use of undeclared identifier 'VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT'
                    INT2NUM(VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT));
                            ^
/opt/vagrant/embedded/include/ruby-2.0.0/ruby/ruby.h:1167:35: note: expanded from macro 'INT2NUM'
# define INT2NUM(v) INT2FIX((int)(v))
                                  ^
/opt/vagrant/embedded/include/ruby-2.0.0/ruby/ruby.h:241:45: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
                                            ^
domain.c:5704:29: error: use of undeclared identifier 'VIR_DOMAIN_QEMU_AGENT_COMMAND_NOWAIT'
                    INT2NUM(VIR_DOMAIN_QEMU_AGENT_COMMAND_NOWAIT));
                            ^
/opt/vagrant/embedded/include/ruby-2.0.0/ruby/ruby.h:1167:35: note: expanded from macro 'INT2NUM'
# define INT2NUM(v) INT2FIX((int)(v))
                                  ^
/opt/vagrant/embedded/include/ruby-2.0.0/ruby/ruby.h:241:45: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
                                            ^
domain.c:5708:29: error: use of undeclared identifier 'VIR_DOMAIN_QEMU_MONITOR_COMMAND_DEFAULT'
                    INT2NUM(VIR_DOMAIN_QEMU_MONITOR_COMMAND_DEFAULT));
                            ^
/opt/vagrant/embedded/include/ruby-2.0.0/ruby/ruby.h:1167:35: note: expanded from macro 'INT2NUM'
# define INT2NUM(v) INT2FIX((int)(v))
                                  ^
/opt/vagrant/embedded/include/ruby-2.0.0/ruby/ruby.h:241:45: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
                                            ^
domain.c:5712:29: error: use of undeclared identifier 'VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP'
                    INT2NUM(VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP));
                            ^
/opt/vagrant/embedded/include/ruby-2.0.0/ruby/ruby.h:1167:35: note: expanded from macro 'INT2NUM'
# define INT2NUM(v) INT2FIX((int)(v))
                                  ^
/opt/vagrant/embedded/include/ruby-2.0.0/ruby/ruby.h:241:45: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
                                            ^
1 warning and 5 errors generated.
make: *** [domain.o] Error 1


Gem files will remain installed in /Users/ken/.vagrant.d/gems/gems/ruby-libvirt-0.6.0 for inspection.
Results logged to /Users/ken/.vagrant.d/gems/gems/ruby-libvirt-0.6.0/ext/libvirt/gem_make.out

@yangm97
Copy link

yangm97 commented Apr 2, 2016

Me too. http://pastebin.com/M9gta8AN

@infernix
Copy link
Member

infernix commented Apr 2, 2016

Just for the record, if this isn't reported as a bug against either vagrant or ruby-libvirt, this isn't going to get resolved; there isn't anything to be done for vagrant-libvirt for what I can tell.

@ignisf
Copy link

ignisf commented May 20, 2016

I've hit this issue on Linux and have opened an upstream issue for it: hashicorp/vagrant#7330

@mnencia
Copy link

mnencia commented Jun 24, 2016

As a easier workaround:

CFLAGS="-DHAVE_VIRDOMAINQEMUMONITORCOMMAND" vagrant plugin install vagrant-libvirt

Howevr I didn't manage to start a VM on OSX anyway

@RaeesBhatti
Copy link

Has anyone been able to get vagrant-libvirt to work on OSX yet?

@ignisf
Copy link

ignisf commented Jun 25, 2016

I managed to work around this issue on my Linux by following this guide: https://wiki.archlinux.org/index.php/Vagrant#vagrant-libvirt

@infernix
Copy link
Member

infernix commented Oct 4, 2016

Please retest this against current master which updates fog-libvirt and ruby-libvirt.

You can git clone the repo and do a gem build vagrant-libvirt.gemspec which generates a .gem that can be installed with vagrant plugin install /path/to/gem

@jason-riddle
Copy link

jason-riddle commented Jan 11, 2017

Turns out there is a brew package available, for those who use homebrew.

brew install libvirt

@mrbrandao
Copy link

Same issue with vagrant-libvirt on Mac OSX El Capitan 10.11.6

$ git branch

  • (HEAD detached at origin/bug-1161338)

/opt/vagrant/embedded/include/ruby-2.2.0/ruby/backward/st.h:2:2: warning: use "ruby/st.h" instead of
bare "st.h" [-W#warnings]
#warning use "ruby/st.h" instead of bare "st.h"

here is the full log --> http://pastebin.ca/3760772

@motilevy
Copy link

motilevy commented Mar 31, 2017

Same issues here, can't get this plugin to install no matter what.
#> CFLAGS="-DHAVE_VIRDOMAINQEMUMONITORCOMMAND" vagrant plugin install vagrant-libvirt
Installing the 'vagrant-libvirt' plugin. This can take a few minutes...
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.

/opt/vagrant/embedded/bin/ruby -r ./siteconf20170331-44092-f4zr09.rb extconf.rb

*** 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)

extconf failed, exit code 1

Gem files will remain installed in /Users/moti/.vagrant.d/gems/2.2.5/gems/ruby-libvirt-0.7.0 for inspection.
Results logged to /Users/moti/.vagrant.d/gems/2.2.5/extensions/x86_64-darwin-13/2.2.0/ruby-libvirt-0.7.0/gem_make.out

@DerekTBrown
Copy link

DerekTBrown commented Jun 23, 2017

I got it working with the following:

brew install ruby ruby-build rbenv libiconv gcc
export NOKOGIRI_USE_SYSTEM_LIBRARIES=true
vagrant plugin install vagrant-libvirt

@motilevy
Copy link

@DerekTBrown that worked! thanks.

@roeste
Copy link

roeste commented Jul 29, 2017

@ccosby That worked for me, thanks a lot! :)

@ccosby
Copy link

ccosby commented Sep 21, 2017

This actually works. vagrant on macOS, libvirt on Ubuntu 17.04

macOS Sierra 10.12.6
Vagrant 2.0.0

  1. Install Homebrew

  2. Install necessary Homebrew recipes.

    brew install libiconv gcc libvirt
    
  3. Find the version of ruby used by your version of vagrant. Mine was 2.3.4

    /opt/vagrant/embedded/bin/ruby --version
    
  4. Install the vagrant plugin.

    CONFIGURE_ARGS='with-ldflags=-L/opt/vagrant/embedded/lib with-libvirt-include=/usr/local/include/libvirt with-libvirt-lib=/usr/local/lib' \
    GEM_HOME=~/.vagrant.d/gems/2.3.4 \
    GEM_PATH=$GEM_HOME:/opt/vagrant/embedded/gems \
    PATH=/opt/vagrant/embedded/bin:$PATH \
    vagrant plugin install vagrant-libvirt
    

Remote Host: Ubuntu 17.04 (zesty) @ 192.168.15.127
libvirt-daemon 2.5.0-3ubuntu5.5

This Vagrantfile will start a debian/jessie64 box on the host at 192.168.15.127. TCP:4242 on your local machine will be forwarded to the box.

Example Vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.box = "debian/jessie64"
  config.vm.provider :libvirt do |libvirt|
    libvirt.host = "192.168.15.127"
    libvirt.connect_via_ssh = true
  end
  config.vm.network "forwarded_port", guest: 4242, host: 4242, host_ip: "127.0.0.1"
  config.vm.synced_folder ".", "/vagrant", disabled: true
end

@mcandre
Copy link

mcandre commented Nov 14, 2017

ccosby's steps are helpful, but even with the ruby-libvirt gem and its native extensions carefully installed into the vagrant RubyGems, somehow an incompatibility error is still presented:

$ vagrant up --provider libvirt
==> default: VM not created. Moving on...
Bringing machine 'default' up with 'libvirt' provider...
/opt/vagrant/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require': incompatible library version - /Users/andrew/.vagrant.d/gems/2.4.2/gems/ruby-libvirt-0.7.0/lib/_libvirt.bundle (LoadError)
	from /opt/vagrant/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Users/andrew/.vagrant.d/gems/2.4.2/gems/ruby-libvirt-0.7.0/lib/libvirt.rb:11:in `<top (required)>'
	from /opt/vagrant/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /opt/vagrant/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Users/andrew/.vagrant.d/gems/2.4.2/gems/fog-libvirt-0.4.2/lib/fog/libvirt.rb:4:in `<top (required)>'
	from /opt/vagrant/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /opt/vagrant/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Users/andrew/.vagrant.d/gems/2.4.2/gems/vagrant-libvirt-0.0.40/lib/vagrant-libvirt/driver.rb:1:in `<top (required)>'
	from /opt/vagrant/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /opt/vagrant/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Users/andrew/.vagrant.d/gems/2.4.2/gems/vagrant-libvirt-0.0.40/lib/vagrant-libvirt/provider.rb:29:in `driver'
	from /Users/andrew/.vagrant.d/gems/2.4.2/gems/vagrant-libvirt-0.0.40/lib/vagrant-libvirt/action/create_networks.rb:26:in `initialize'
	from /opt/vagrant/embedded/gems/gems/vagrant-2.0.1/lib/vagrant/action/warden.rb:90:in `new'
	from /opt/vagrant/embedded/gems/gems/vagrant-2.0.1/lib/vagrant/action/warden.rb:90:in `finalize_action'
	from /opt/vagrant/embedded/gems/gems/vagrant-2.0.1/lib/vagrant/action/warden.rb:20:in `block in initialize'
	from /opt/vagrant/embedded/gems/gems/vagrant-2.0.1/lib/vagrant/action/warden.rb:20:in `map'
	from /opt/vagrant/embedded/gems/gems/vagrant-2.0.1/lib/vagrant/action/warden.rb:20:in `initialize'
	from /opt/vagrant/embedded/gems/gems/vagrant-2.0.1/lib/vagrant/action/builder.rb:170:in `new'
	from /opt/vagrant/embedded/gems/gems/vagrant-2.0.1/lib/vagrant/action/builder.rb:170:in `to_app'
	from /opt/vagrant/embedded/gems/gems/vagrant-2.0.1/lib/vagrant/action/builtin/call.rb:52:in `call'
	from /opt/vagrant/embedded/gems/gems/vagrant-2.0.1/lib/vagrant/action/warden.rb:34:in `call'
	from /opt/vagrant/embedded/gems/gems/vagrant-2.0.1/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
	from /opt/vagrant/embedded/gems/gems/vagrant-2.0.1/lib/vagrant/action/warden.rb:34:in `call'
	from /opt/vagrant/embedded/gems/gems/vagrant-2.0.1/lib/vagrant/action/builder.rb:116:in `call'
	from /opt/vagrant/embedded/gems/gems/vagrant-2.0.1/lib/vagrant/action/runner.rb:66:in `block in run'
	from /opt/vagrant/embedded/gems/gems/vagrant-2.0.1/lib/vagrant/util/busy.rb:19:in `busy'
	from /opt/vagrant/embedded/gems/gems/vagrant-2.0.1/lib/vagrant/action/runner.rb:66:in `run'
	from /opt/vagrant/embedded/gems/gems/vagrant-2.0.1/lib/vagrant/machine.rb:227:in `action_raw'
	from /opt/vagrant/embedded/gems/gems/vagrant-2.0.1/lib/vagrant/machine.rb:202:in `block in action'
	from /opt/vagrant/embedded/gems/gems/vagrant-2.0.1/lib/vagrant/environment.rb:631:in `lock'
	from /opt/vagrant/embedded/gems/gems/vagrant-2.0.1/lib/vagrant/machine.rb:188:in `call'
	from /opt/vagrant/embedded/gems/gems/vagrant-2.0.1/lib/vagrant/machine.rb:188:in `action'
	from /opt/vagrant/embedded/gems/gems/vagrant-2.0.1/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'

I'm using Vagrant 2.0.1 with libvirt 3.9.0 from Homebrew 1.3.7 on macOS High Sierra.

@ivo5307
Copy link

ivo5307 commented Nov 28, 2017

ccosby's steps worked for me, i think i am past the ruby error however i get:

Error while connecting to libvirt: Error making a connection to libvirt URI qemu+ssh://192.168.15.127/system?no_verify=1&keyfile=/Users/myuser/.ssh/id_rsa&socket=/var/run/libvirt/libvirt-sock: Call to virConnectOpen failed: internal error: received hangup event on socket

@ccosby
Copy link

ccosby commented Nov 28, 2017

@mcandre

I can confirm that it doesn't work on High Sierra + Vagrant 2.0.1 with the same error that you posted. Still works on High Sierra 10.13.1 + Vagrant 2.0.0. I'll investigate more and see what I find.

Look through https://github.com/hashicorp/vagrant/blob/master/CHANGELOG.md and see if there's anything you absolutely need from there. If not, 2.0.0 is still available for download.

@rall
Copy link

rall commented Dec 13, 2017

I also get the Call to virConnectOpen failed: internal error: received hangup event on socket error, with Sierra 10.12.6 and High Sierra 10.13.1, both using Vagrant 2.0.0
@mcandre @ccosby

@Skarlso
Copy link

Skarlso commented Jun 12, 2018

For those finding this thread.... the tail continues by installing virt-manager using this repo:
https://github.com/jeffreywildman/homebrew-virt-manager/

Once that's done with brew you should start the daemon with virt-manager -c qemu+ssh://@/system?socket=/var/run/libvirt/libvirt-sock.

Maybe troubleshoot: brew install py2cairo.

Good luck!

@slmingol
Copy link

slmingol commented Oct 12, 2018

On High Sierra - 10.13.6

$ vagrant version
Installed Version: 2.1.5
Latest Version: 2.1.5

You're running an up-to-date version of Vagrant!

Fails though:

$ vagrant up
Bringing machine 'default' up with 'libvirt' provider...
Error while connecting to libvirt: Error making a connection to libvirt URI qemu+ssh://192.168.15.127/system?no_verify=1&keyfile=/Users/smingolelli/.ssh/id_rsa&socket=/var/run/libvirt/libvirt-sock:
Call to virConnectOpen failed: internal error: received hangup event on socket

Plugin was built like so:

$ CONFIGURE_ARGS='with-ldflags=-L/opt/vagrant/embedded/lib with-libvirt-include=/usr/local/include/libvirt with-libvirt-lib=/usr/local/lib' GEM_HOME=~/.vagrant.d/gems/2.4.4 GEM_PATH=$GEM_HOME:/opt/vagrant/embedded/gems PATH=/opt/vagrant/embedded/bin:$PATH vagrant plugin install vagrant-libvirt

@ssbarnea
Copy link

What is the current blocker for getting this sorted? I woud really like to be able to use libvirt provider under macos and have it to point to a remote VIRTHOST machine.

@electrofelix
Copy link
Contributor

@ssbarnea I think someone with a Mac to test and verify the exact steps required, I don't use Mac's myself, not sure if any of the other maintainers have access to one

@ssbarnea
Copy link

ssbarnea commented Jun 5, 2019

Travis and Azure DevOps both provide free builders for MacOS, quite useful for testing and assuring that the plugin is at least builable and instalable.

I can confirm that adding the mentioned environment variables allows me to install the plugin, which means that the build code needs to be updated to avoid the need for them.

vagrant version                                                                                                                                                                                                               Installed Version: 2.2.4
Latest Version: 2.2.4

CONFIGURE_ARGS='with-ldflags=-L/opt/vagrant/embedded/lib with-libvirt-include=/usr/local/include/libvirt with-libvirt-lib=/usr/local/lib' GEM_HOME=~/.vagrant.d/gems/2.4.4 GEM_PATH=$GEM_HOME:/opt/vagrant/embedded/gems PATH=/opt/vagrant/embedded/bin:$PATH vagrant plugin install vagrant-libvirt
Installing the 'vagrant-libvirt' plugin. This can take a few minutes...
Building native extensions.  This could take a while...
Fetching: fog-libvirt-0.6.0.gem (100%)
Fetching: vagrant-libvirt-0.0.45.gem (100%)
Installed the plugin 'vagrant-libvirt (0.0.45)'!

PS. If any maintainer needs access to a macos shell, please ping me on private and I will create an account for you on my box.

@network-shark
Copy link

@ssbarnea
Your ENV works fine !
Installed the plugin 'vagrant-libvirt (0.0.45)'!
Thank You !

@ssbarnea
Copy link

I hope someone with knowledge of how plugins installation works could patch the code to enable these parameters for MacOS by default. We had at least 3 people confirming the fix and none saying that it would not work.

@errordeveloper
Copy link

errordeveloper commented Mar 11, 2020

Few things said in this thread are a little confusing

  • should CONFIGURE_ARGS have flags with double-dash or without?
    • turns out both styles work (with-libvirt-lib= is same as --with-libvirt-lib=)
  • is with-ldflags=-L/opt/vagrant/embedded/lib actually needed?
    • turns out it is not needed (at least with vagrant 2.2.7 and ruby-libvirt 0.7.1)
  • some folks mentioned NOKOGIRI_USE_SYSTEM_LIBRARIES=true
    • this didn't make any difference (at least with vagrant 2.2.7 and nokogiri 1.10.9)
  • it's not clear if libiconv is actually needed or not

However, key details that are more critical are these:

  • above everyone seem so use with-libvirt-include=${prefix}/include/libvirt
    • that doesn't work because the C code has #include <libvirt/libvirt.h>, so this will have to be with-libvirt-include=${prefix}/include (note: it's not the subdirectory)

Here is what worked for me:

brew cask install vagrant && brew install libvirt
env CONFIGURE_ARGS="with-libvirt-lib=$(brew --prefix libvirt)/lib with-libvirt-include=$(brew --prefix libvirt)/include" vagrant plugin install vagrant-libvirt
``` $ brew cask install vagrant && brew install libvirt Updating Homebrew... ==> Auto-updated Homebrew! Updated 2 taps (homebrew/core and homebrew/cask). ==> Updated Formulae curl-openssl ==> Updated Casks microsoft-office

==> Downloading https://releases.hashicorp.com/vagrant/2.2.7/vagrant_2.2.7_x86_64.dmg
Already downloaded: /Users/ilya/Library/Caches/Homebrew/downloads/accec21e850b3dbacc4d406adebaecc0265de9b285c3e8431fcb7443f311d4d2--vagrant_2.2.7_x86_64.dmg
==> Verifying SHA-256 checksum for Cask 'vagrant'.
==> Installing Cask vagrant
==> Running installer for vagrant; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
installer: Package name is Vagrant
installer: Installing at base path /
installer: The install was successful.
🍺 vagrant was successfully installed!
==> Downloading https://libvirt.org/sources/libvirt-6.1.0.tar.xz
Already downloaded: /Users/ilya/Library/Caches/Homebrew/downloads/42ed86b94110afc9b83a2cea9a114b765a8428faddac809ba6a1d260d8a09e1c--libvirt-6.1.0.tar.xz
==> ../configure --prefix=/Users/ilya/Library/Local/Homebrew/Cellar/libvirt/6.1.0 --localstatedir=/Users/ilya/Library/Local/Homebrew/var --mandir=/Users/ilya/Library/Local/Homebrew/Cel
==> make
==> make install
==> Caveats
To have launchd start libvirt now and restart at login:
brew services start libvirt
Or, if you don't want/need a background service you can just run:
libvirtd
==> Summary
🍺 /Users/ilya/Library/Local/Homebrew/Cellar/libvirt/6.1.0: 532 files, 36.5MB, built in 2 minutes 7 seconds
$ libvirt_prefix="$(brew --prefix libvirt)"
$ env CONFIGURE_ARGS="with-libvirt-lib=${libvirt_prefix}/lib with-libvirt-include=${libvirt_prefix}/include" vagrant plugin install vagrant-libvirt
Installing the 'vagrant-libvirt' plugin. This can take a few minutes...
Fetching: formatador-0.2.5.gem (100%)
Fetching: excon-0.72.0.gem (100%)
Fetching: fog-core-1.43.0.gem (100%)
Fetching: mini_portile2-2.4.0.gem (100%)
Fetching: nokogiri-1.10.9.gem (100%)
Building native extensions. This could take a while...
Fetching: fog-json-1.2.0.gem (100%)
Fetching: fog-xml-0.1.3.gem (100%)
Fetching: ruby-libvirt-0.7.1.gem (100%)
Building native extensions. This could take a while...
Fetching: fog-libvirt-0.7.0.gem (100%)
Fetching: vagrant-libvirt-0.0.45.gem (100%)
Installed the plugin 'vagrant-libvirt (0.0.45)'!
$

</details>

@dragon788
Copy link

@ccosby @ssbarnea it appears that the command works more consistently across versions if you skip supplying a specific version under the gems folder.

Instead of:

CONFIGURE_ARGS='with-ldflags=-L/opt/vagrant/embedded/lib with-libvirt-include=/usr/local/include/libvirt with-libvirt-lib=/usr/local/lib' GEM_HOME=~/.vagrant.d/gems/2.4.4 GEM_PATH=$GEM_HOME:/opt/vagrant/embedded/gems PATH=/opt/vagrant/embedded/bin:$PATH vagrant plugin install vagrant-libvirt

Use:

CONFIGURE_ARGS='with-ldflags=-L/opt/vagrant/embedded/lib with-libvirt-include=/usr/local/include/libvirt with-libvirt-lib=/usr/local/lib' GEM_HOME=~/.vagrant.d/gems GEM_PATH=$GEM_HOME:/opt/vagrant/embedded/gems PATH=/opt/vagrant/embedded/bin:$PATH vagrant plugin install vagrant-libvirt

@Falkor
Copy link

Falkor commented Apr 17, 2020

I'm still stuck (dyld: Symbol not found: _iconv) and all the above did not work

Any help would be highly appreciated... May be vagrant should ship with nokogiri embedded ?

@shuxiao9058
Copy link

shuxiao9058 commented Apr 18, 2020

I'm still stuck (dyld: Symbol not found: _iconv) and all the above did not work

Any help would be highly appreciated... May be vagrant should ship with nokogiri embedded ?

try

sudo mv /opt/vagrant/embedded/lib/libiconv.2.dylib /opt/vagrant/embedded/lib/libiconv.2.dylib.bak
sudo ln -s /usr/local/opt/libiconv/lib/libiconv.a /opt/vagrant/embedded/lib/libiconv.a
CONFIGURE_ARGS='with-ldflags=-L/opt/vagrant/embedded/lib' GEM_HOME=~/.vagrant.d/gems/2.4.9 GEM_PATH=$GEM_HOME:/opt/vagrant/embedded/gems PATH=/opt/vagrant/embedded/bin:$PATH gem install nokogiri

build success, but run failed.

➜  workspace vagrant up dev1
Bringing machine 'dev1' up with 'libvirt' provider...
==> dev1: Checking if box 'centos/7' version '1905.1' is up to date...
WARNING: Nokogiri was built against LibXML version 2.9.4, but has dynamically loaded 2.9.7
dyld: lazy symbol binding failed: Symbol not found: _libiconv_open
  Referenced from: /opt/vagrant/embedded/lib/libxml2.2.dylib
  Expected in: /usr/lib/libiconv.2.dylib

dyld: Symbol not found: _libiconv_open
  Referenced from: /opt/vagrant/embedded/lib/libxml2.2.dylib
  Expected in: /usr/lib/libiconv.2.dylib

It seems that was caused with libxml. see hashicorp/vagrant#9045

after reinstall vagrant, it works fine.

@Falkor
Copy link

Falkor commented Apr 20, 2020

@shuxiao9058 excellent, thanks for the tips!

@shuxiao9058
Copy link

@shuxiao9058 excellent, thanks for the tips!

I have give up the libvirt since some other issues.

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

No branches or pull requests