mitchellh / virtualbox

[ABANDONED] Create and modify virtual machines in VirtualBox using pure ruby.
http://mitchellh.github.com/virtualbox/
MIT License
245 stars 45 forks source link

Politely exit with OSE versions #51

Open hedgehog opened 13 years ago

hedgehog commented 13 years ago

The following vagrant up works fine with non-OSE VirtualBox 4.0.4. Guest Additions were installed as described here Nonetheless, perhaps OSE versions should be no-op (unsupported) since it seems the only way to get (at least for Ubuntu Lucid) OSE guest additions is via an X11 package.:

$ vagrant up
[chefserver] Provisioning enabled with chef_solo...
[chefserver] Box bbb-chefserver was not found. Fetching box from specified URL...
[chefserver] Downloading with Vagrant::Downloaders::File...
[chefserver] Copying box to temporary location...
[chefserver] Extracting box...
[chefserver] Verifying box...
[chefserver] Cleaning up downloaded box...
[chefserver] Importing base box 'bbb-chefserver'...
[chefserver] Matching MAC address for NAT networking...
[chefserver] The guest additions on this VM do not match the install version of
VirtualBox! This may cause things such as forwarded ports, shared
folders, and more to not work properly. If any of those things fail on
this machine, please update the guest additions and repackage the
box.

Guest Additions Version: 4.0.4
VirtualBox Version: 4.0.4_OSE
[chefserver] Running any VM customizations...
[chefserver] Clearing any previously set forwarded ports...
[chefserver] Forwarding ports...
[chefserver] -- ssh: 22 => 2200 (adapter 1)
[chefserver] -- chefs: 4000 => 4000 (adapter 1)
[chefserver] -- chefs_web: 4040 => 4040 (adapter 1)
[chefserver] Creating shared folders metadata...
[chefserver] Preparing host only network...
[chefserver] Creating new host only network for environment...
/home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/virtualbox-0.8.3/lib/virtualbox/com/implementer/ffi.rb:95:in `call_and_check': Error in API call to get_state: 2147944126 (VirtualBox::Exceptions::FFIException)
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/virtualbox-0.8.3/lib/virtualbox/com/implementer/ffi.rb:69:in `call_vtbl_function'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/virtualbox-0.8.3/lib/virtualbox/com/implementer/ffi.rb:36:in `read_property'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/virtualbox-0.8.3/lib/virtualbox/com/abstract_interface.rb:122:in `read_property'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/virtualbox-0.8.3/lib/virtualbox/com/abstract_interface.rb:64:in `block in property'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/virtualbox-0.8.3/lib/virtualbox/abstract_model/interface_attributes.rb:93:in `block in spec_to_proc'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/virtualbox-0.8.3/lib/virtualbox/abstract_model/interface_attributes.rb:32:in `call'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/virtualbox-0.8.3/lib/virtualbox/abstract_model/interface_attributes.rb:32:in `load_interface_attribute'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/virtualbox-0.8.3/lib/virtualbox/vm.rb:281:in `state'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/virtualbox-0.8.3/lib/virtualbox/vm.rb:600:in `saved?'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/vagrant-0.7.2/lib/vagrant/action/vm/discard_state.rb:12:in `call'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/vagrant-0.7.2/lib/vagrant/action/warden.rb:28:in `call'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/vagrant-0.7.2/lib/vagrant/action/env/set.rb:13:in `call'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/vagrant-0.7.2/lib/vagrant/action/warden.rb:28:in `call'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/vagrant-0.7.2/lib/vagrant/action/builder.rb:120:in `call'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/vagrant-0.7.2/lib/vagrant/action.rb:131:in `block in run'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/vagrant-0.7.2/lib/vagrant/util/busy.rb:19:in `busy'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/vagrant-0.7.2/lib/vagrant/action.rb:131:in `run'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/vagrant-0.7.2/lib/vagrant/action/vm/import.rb:29:in `recover'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/vagrant-0.7.2/lib/vagrant/action/warden.rb:49:in `block in begin_rescue'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/vagrant-0.7.2/lib/vagrant/action/warden.rb:48:in `each'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/vagrant-0.7.2/lib/vagrant/action/warden.rb:48:in `begin_rescue'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/vagrant-0.7.2/lib/vagrant/action/warden.rb:39:in `rescue in call'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/vagrant-0.7.2/lib/vagrant/action/warden.rb:24:in `call'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/vagrant-0.7.2/lib/vagrant/action/builder.rb:120:in `call'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/vagrant-0.7.2/lib/vagrant/action.rb:131:in `block in run'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/vagrant-0.7.2/lib/vagrant/util/busy.rb:19:in `busy'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/vagrant-0.7.2/lib/vagrant/action.rb:131:in `run'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/vagrant-0.7.2/lib/vagrant/vm.rb:136:in `up'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/vagrant-0.7.2/lib/vagrant/command/up.rb:13:in `block in execute'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/vagrant-0.7.2/lib/vagrant/command/up.rb:8:in `each'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/vagrant-0.7.2/lib/vagrant/command/up.rb:8:in `execute'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `block in invoke_all'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `each'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `map'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `invoke_all'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/thor-0.14.6/lib/thor/group.rb:226:in `dispatch'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/thor-0.14.6/lib/thor/invocation.rb:109:in `invoke'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/vagrant-0.7.2/lib/vagrant/cli.rb:45:in `block in register'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/gems/vagrant-0.7.2/bin/vagrant:15:in `<top (required)>'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/bin/vagrant:19:in `load'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev-vm/bin/vagrant:19:in `<main>'
mitchellh commented 13 years ago

Interesting. Vagrant used to in fact check for OSE and give an error message and quit, but the OSE version is no longer available, according to Oracle. They replaced OSE with the "extension packs."

So instead of checking for OSE, I would need to check for the Oracle extention pack perhaps?

hedgehog commented 13 years ago

I think the distros may still provide them:

$ apt-cache search virtualbox-ose virtualbox-ose-guest-source - Transitional package for virtualbox-ose-guest-dkms virtualbox-ose-source - Transitional package for virtualbox-ose-dkms virtualbox-ose-dkms - x86 virtualization solution - kernel module sources for dkms virtualbox-ose-guest-dkms - x86 virtualization solution - guest addition module source for dkms virtualbox-ose - x86 virtualization solution - base binaries virtualbox-ose-dbg - x86 virtualization solution - debugging symbols virtualbox-ose-fuse - x86 virtualization solution - virtual filesystem virtualbox-ose-guest-utils - x86 virtualization solution - non-X11 guest utilities virtualbox-ose-guest-x11 - x86 virtualization solution - X11 guest utilities virtualbox-ose-qt - x86 virtualization solution - Qt based user interface

mitchellh commented 13 years ago

Interesting, and what is the VirtualBox version string associated with them?

hedgehog commented 13 years ago

This is lucid, maverick etc may have later versions?

$ apt-cache --full search virtualbox-ose|grep -i version Version: 3.1.6-dfsg-2ubuntu2 Version: 3.1.6-dfsg-2ubuntu2 Version: 4.0.4-dfsg-1ubuntu1~lucid1~ppa2 Version: 4.0.4-dfsg-1ubuntu1~lucid1~ppa2 Version: 4.0.4-dfsg-1ubuntu1~lucid1~ppa2 Python-Version: >= 2.4 Version: 4.0.4-dfsg-1ubuntu1~lucid1~ppa2 Version: 4.0.4-dfsg-1ubuntu1~lucid1~ppa2 Version: 4.0.4-dfsg-1ubuntu1~lucid1~ppa2 Version: 4.0.4-dfsg-1ubuntu1~lucid1~ppa2 Version: 4.0.4-dfsg-1ubuntu1~lucid1~ppa2

hedgehog commented 13 years ago

Seems they do:

http://packages.ubuntu.com/search?keywords=virtualbox-ose