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
Comments
There is a workaround, but I would need to install my own version of ruby-libvirt for vagrant-libvirt? |
@kontrafiktion Could you please describe a workaround for this issue? |
the workaround is described in https://bugzilla.redhat.com/show_bug.cgi?id=1161338, ruby-libvirt must be patched:
|
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:
|
Sigh |
For those trying to install it on OS X without wanting to edit libvirt installation, the following commands install the fixed version of
For the more paranoid, clone edited: full path for rake and gem |
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... and a long list of ruby files. Has anyone successfully upped a vagrant with libvirt on Mac (El Capitan) with this recent libvirt stuff? -- 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-libvirtgit clone https://github.com/kontrafiktion/ruby-libvirt install patched version to vagrant gemsgem install -i ~/.vagrant.d/gems/ --local pkg/ruby-libvirt-0.6.0.gem install pluginvagrant plugin install vagrant-libvirt successFor 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). — |
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).
|
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
you should try:
(after you did I am running ruby-libvirt 0.6.0 on OS X El Capitan (10.11.3) without an issue. // Added missing patch. |
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 |
Log here:
|
@cao 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 ). |
@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:
|
Me too. http://pastebin.com/M9gta8AN |
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. |
I've hit this issue on Linux and have opened an upstream issue for it: hashicorp/vagrant#7330 |
As a easier workaround:
Howevr I didn't manage to start a VM on OSX anyway |
Has anyone been able to get |
I managed to work around this issue on my Linux by following this guide: https://wiki.archlinux.org/index.php/Vagrant#vagrant-libvirt |
Please retest this against current master which updates fog-libvirt and ruby-libvirt. You can |
Turns out there is a brew package available, for those who use homebrew. brew install libvirt |
Same issue with vagrant-libvirt on Mac OSX El Capitan 10.11.6 $ git branch
/opt/vagrant/embedded/include/ruby-2.2.0/ruby/backward/st.h:2:2: warning: use "ruby/st.h" instead of here is the full log --> http://pastebin.ca/3760772 |
Same issues here, can't get this plugin to install no matter what. ERROR: Failed to build gem native extension.
*** extconf.rb failed *** Provided configuration options: 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. |
I got it working with the following:
|
@DerekTBrown that worked! thanks. |
@ccosby That worked for me, thanks a lot! :) |
This actually works. vagrant on macOS, libvirt on Ubuntu 17.04 macOS Sierra 10.12.6
Remote Host: Ubuntu 17.04 (zesty) @ 192.168.15.127 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 |
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. |
ccosby's steps worked for me, i think i am past the ruby error however i get:
|
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. |
For those finding this thread.... the tail continues by installing Once that's done with Maybe troubleshoot: Good luck! |
On High Sierra - 10.13.6
Fails though:
Plugin was built like so:
|
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. |
@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 |
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.
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. |
@ssbarnea |
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. |
Few things said in this thread are a little confusing
However, key details that are more critical are these:
Here is what worked for me:
```
$ 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
|
@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:
Use:
|
I'm still stuck (
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.
It seems that was caused with libxml. see hashicorp/vagrant#9045 after reinstall vagrant, it works fine. |
@shuxiao9058 excellent, thanks for the tips! |
I have give up the libvirt since some other issues. |
Installing ruby-libvirt on OS X does not work because of
https://bugzilla.redhat.com/show_bug.cgi?id=1161338
The text was updated successfully, but these errors were encountered: