Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

libvirt and VirtualBox on OS X

I'm trying to access VirtualBox through libvirt on OS X (Lion). I installed libvirt 0.9.4 using Homebrew. However, libvirt fails to connect to VirtualBox:

# virsh -c vbox:///session
error: internal error unable to initialize VirtualBox driver API
error: failed to connect to the hypervisor

In a similar SO question about Ubuntu, the answer was that the Ubuntu libvirt package doesn't build support for VirtualBox. How can I check if this is the problem in the case of the Homebrew package, or if it's a different issue? If it's the same problem, how do I rebuild the Homebrew package with VirtualBox support?


Edit: libvirt 0.9.7 has been released, and I no longer get this error.

like image 893
Lorin Hochstein Avatar asked Nov 26 '25 13:11

Lorin Hochstein


1 Answers

Your libvirt is build with VirtualBox support. I can tell because the error message you see comes from the VirtualBox driver in libvirt.

There was a similar problem reported on the libvirt users maling list today. The problem there was that support for VirtualBox 4.1 was added quite recently to libvirt. It's not in a released version yet and will be part of the next libvirt release 0.9.7.

To get some more useful information try running this:

LIBVIRT_LOG_FILTERS=1:vbox virsh -c vbox:///session

I suspect that you have VirtualBox 4.1 installed, but libvirt 0.9.4 supports only up to VirtualBox 4.0.

You can either a) upgrade your libvirt to current git version (that supports VirtualBox 4.1), or b) wait for the next libvirt release (it's expected in this week) or c) downgrade your VirtualBox version to 4.0 to fix this, assuming your problem is really as I suspect.

like image 165
Matthias Bolte Avatar answered Nov 29 '25 08:11

Matthias Bolte



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!