Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top