mitchellh/vagrant — Issue #561: "Vagrant could not detect VirtualBox!"  ubuntu 11.10
Author: aaa2000
Created: 2011-11-17 21:03:44+00:00
State: open

Hello,

after an upgrade of Ubuntu 11.04 to 11.10, I get the following message.

"Vagrant could not detect VirtualBox! Make sure VirtualBox is properly installed.

If VirtualBox is installed, it may be an incorrect version. Vagrant currently
requires VirtualBox 4.1.x. Please install the proper version to continue.

If you have an older or newer version of VirtualBox, please make sure you're
using the proper version of Vagrant. Ask the mailing list if you have questions."

I have Vagrant version 0.8.7 and Oracle VM VirtualBox Headless Interface 4.1.2_Ubuntu installed.

On searching on the net, I executed theses commands in irb and get the error.

irb(main):001:0> require 'rubygems'; require 'virtualbox'
=> true
irb(main):002:0> VirtualBox::Lib.lib
LoadError: libffi.so.5: cannot open shared object file: No such file or directory - /var/lib/gems/1.8/gems/ffi-1.0.9/lib/ffi_c.so
from /var/lib/gems/1.8/gems/ffi-1.0.9/lib/ffi_c.so
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /var/lib/gems/1.8/gems/ffi-1.0.9/lib/ffi.rb:8
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /var/lib/gems/1.8/gems/virtualbox-0.9.1/lib/virtualbox/com/ffi_interface.rb:1
from /var/lib/gems/1.8/gems/virtualbox-0.9.1/lib/virtualbox/lib.rb:80:in `initialize'
from /var/lib/gems/1.8/gems/virtualbox-0.9.1/lib/virtualbox/lib.rb:41:in `new'
from /var/lib/gems/1.8/gems/virtualbox-0.9.1/lib/virtualbox/lib.rb:41:in `lib'
from (irb):2
from /usr/lib/ruby/1.8/tsort.rb:283

So I resolved my probem by creating a symbolic link:
sudo ln -s /usr/lib/i386-linux-gnu/libffi.so.6 /usr/lib/i386-linux-gnu/libffi.so.5

Is there better way to resolve the problem?
Else I hope that could help someone and sorry for my english