GithubHelp home page GithubHelp logo

mitchellh / virtualbox Goto Github PK

View Code? Open in Web Editor NEW
244.0 14.0 51.0 2.13 MB

[ABANDONED] Create and modify virtual machines in VirtualBox using pure ruby.

Home Page: http://mitchellh.github.com/virtualbox/

License: MIT License

Ruby 100.00%

virtualbox's Introduction

This gem is no longer under active development. Please do not use it.

I've decided to stop developing this library since the main user of the library and the purpose it was created (Vagrant) no longer makes use of it. The reasoning behind this is because the win32ole support on Windows is simply painful and doesn't support all the features necessary to fully support the VirtualBox API.

If you're interested in maintaining this gem, please contact me (mitchellh).

VirtualBox Ruby Gem

The VirtualBox ruby gem is a library which allows anyone to control VirtualBox from ruby code! Create, destroy, start, stop, suspend, and resume virtual machines. Also list virtual machines, list hard drives, network devices, etc.

Installation and Requirements

First you need to install VirtualBox which is available for Windows, Linux, and OS X. After installation, install the gem:

sudo gem install virtualbox

The gem uses the native COM interface with VirtualBox provides to communicate with VirtualBox. On Windows, this is globally available. On Linux-based machines, the gem uses Ruby-FFI to talk to a dynamic library. No configuration should be necessary.

Basic Usage

The virtualbox gem is modeled after ActiveRecord. If you've used ActiveRecord, you'll feel very comfortable using the virtualbox gem.

There is a quick getting started guide to get you acquainted with the conventions of the virtualbox gem.

Complete documentation can be found at http://mitchellh.github.com/virtualbox.

Below are some examples:

require 'virtualbox'

vm = VirtualBox::VM.find("my-vm")

# Let's first print out some basic info about the VM
puts "Memory: #{vm.memory_size}"

# Let's modify the memory and name...
vm.memory_size = 360
vm.name = "my-renamed-vm"

# Save it!
vm.save

Known Issues or Uncompleted Features

VirtualBox has a ton of features! As such, this gem is still not totally complete. You can see the features that are still left to do in the TODO file.

Reporting Bugs or Feature Requests

Please use the issue tracker.

Contributing

If you'd like to contribute to VirtualBox, the first step to developing is to clone this repo, get bundler if you don't have it already, and do the following:

bundle install --relock
rake

This will run the test suite, which should come back all green! Then you're good to go!

Special Thanks

These folks went above and beyond with contributions to the virtualbox gem, and for that, I have to say "thanks!"

virtualbox's People

Contributors

aleksi avatar carsomyr avatar geemus avatar johnbender avatar jondkinney avatar kmwhite avatar lastobelus avatar mitchellh avatar patricksrobertson avatar willglynn avatar zts avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

virtualbox's Issues

Normalize all size integers

Current, various size operations (like hd.size and hd.logical_size) return different units. Some are bytes, some kilobytes, and some megabytes.

Normalize all values to bytes by default, so the user of the gem can know they'll be getting a byte value.

Add CPU hotplug feature

config.vm.customize do |vm|
  vm.cpu_count = 6
  vm.cpu.hotplug = true
end

$ vagrant unplugcpu 2
$ vagrant unplugcpu 3
$ vagrant unplugcpu 4
$ vagrant unplugcpu 5
$ vagrant plugcpu 2
$ vagrant cpus
mximum: 6
active: 3

Note that this makes it less likely that VirtualBox OSE is fully supported, since hotplugging requires Guest Additions be installed, and of OSE it seems the only (Ubuntu) package has a X11 dependency....

null pointer dereference on Ubuntu

Hi,

This is probably a question better-suited to a mailing list, but I couldn't find a reference to one, so here I am. :)

$ cat /etc/issue
Ubuntu 9.10 \n \l

$ gem list | fgrep virtualbox
virtualbox (0.6.1)

$ VBoxManage --version
3.0.12r54655

$ ps -ef | fgrep VBox
mike     16097 16083  0 06:42 ?        00:00:00 /usr/lib/virtualbox/VBoxXPCOMIPCD
mike     16106     1  0 06:42 ?        00:00:01 /usr/lib/virtualbox/VBoxSVC --automate
mike     18670 18646  0 08:27 pts/2    00:00:00 fgrep VBox

$ irb -rubygems -rvirtualbox
irb(main):001:0> VirtualBox::VM.all
FFI::NullPointerError: invalid memory read at address=(nil)
    from /home/mike/.gem/ruby/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/ffi/interface.rb:136:in `[]'
    from /home/mike/.gem/ruby/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/ffi/interface.rb:136:in `initialize_vtbl'
    from /home/mike/.gem/ruby/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/ffi/interface.rb:130:in `initialize'
    from /home/mike/.gem/ruby/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/implementer/ffi.rb:18:in `new'
    from /home/mike/.gem/ruby/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/implementer/ffi.rb:18:in `initialize'
    from /home/mike/.gem/ruby/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/abstract_interface.rb:113:in `new'
    from /home/mike/.gem/ruby/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/abstract_interface.rb:113:in `initialize'
    from /home/mike/.gem/ruby/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/ffi_interface.rb:60:in `new'
    from /home/mike/.gem/ruby/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/ffi_interface.rb:60:in `initialize_com'
    from /home/mike/.gem/ruby/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/ffi_interface.rb:43:in `initialize'
    from /home/mike/.gem/ruby/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/ffi_interface.rb:24:in `new'
    from /home/mike/.gem/ruby/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/ffi_interface.rb:24:in `create'
    from /home/mike/.gem/ruby/1.8/gems/virtualbox-0.6.1/lib/virtualbox/lib.rb:75:in `initialize'
    from /home/mike/.gem/ruby/1.8/gems/virtualbox-0.6.1/lib/virtualbox/lib.rb:39:in `new'
    from /home/mike/.gem/ruby/1.8/gems/virtualbox-0.6.1/lib/virtualbox/lib.rb:39:in `lib'
    from /home/mike/.gem/ruby/1.8/gems/virtualbox-0.6.1/lib/virtualbox/global.rb:59:in `global'
    from /home/mike/.gem/ruby/1.8/gems/virtualbox-0.6.1/lib/virtualbox/vm.rb:138:in `all'

Dove in to the codes a bit and I can see that after the call to pfnComInitialize (in FFIInterface#initialize_com) the pointer value of virtualbox_ptr is NULL, which indicates to me that things aren't being initialized properly.

Any ideas?

Fedora 14 64bit support?

Is this library expected to work on 64-bit Linux? At least on Fedora 14 64-bit, it appears not to. For one, Fedora (well, RPM Fusion) puts the VirtualBox libs in /usr/lib64/virtualbox not /usr/lib/virtualbox. Merely symlinking this does not appear to work, e.g.

p VirtualBox::VM.all
NoMethodError: undefined method `info_vd_size' for #<VirtualBox::COM::Interface::Version_3_2_X::SystemProperties>

[aaron@msi-cr620 vagrant]$ uname -a
Linux msi-cr620 2.6.35.10-74.fc14.x86_64 #1 SMP Thu Dec 23 16:04:50 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux
[aaron@msi-cr620 vagrant]$ which ruby
~/.rvm/rubies/ruby-1.8.7-p302/bin/ruby
[aaron@msi-cr620 vagrant]$ gem list virtualbox

*** LOCAL GEMS ***

virtualbox (0.8.0)
[aaron@msi-cr620 vagrant]$ rpm -qi VirtualBox-OSE
Name        : VirtualBox-OSE               Relocations: (not relocatable)
Version     : 3.2.10                            Vendor: RPM Fusion
Release     : 1.fc14                        Build Date: Fri 12 Nov 2010 09:36:57 AM EST
Install Date: Mon 27 Dec 2010 06:23:50 PM EST      Build Host: hephaestus.wilsonet.com
Group       : Development/Tools             Source RPM: VirtualBox-OSE-3.2.10-1.fc14.src.rpm
Size        : 56305017                         License: GPLv2 or (GPLv2 and CDDL)
Signature   : RSA/SHA256, Wed 17 Nov 2010 09:10:28 AM EST, Key ID 10cc489a865cc9ea
Packager    : <http://nonfree.rpmfusion.org/>
URL         : http://www.virtualbox.org/wiki/VirtualBox
Summary     : A general-purpose full virtualizer for PC hardware
Description :
A general-purpose full virtualizer and emulator for 32-bit and 64-bit x86 based PC-compatible machines.

This problem manifests itself as a "Vagrant could not detect VirtualBox" error from Vagrant.

Am I doing something wrong?

Boot Order Relationship

Getter:

vm.boot_order.at(1)

Setter:

vm.boot_order.at(1) = :dvd

Ideally, you could return the easier setter methods of 0.5.x series.

vm.boot1 = :dvd
OR
vm.boot_order_1 = :dvd

VirtualBox GuestControl Support

Hello,

Once again, thanks for a great library. I was curious if the existing code base supports the VBoxManage 'guestcontrol' command that can be used for executing arbitrary commands inside a guest machine. I searched through the documentation, existing issues, and the lib directory, but nothing jumped out at me.

Thanks!
Bryan

VM.all is not cached, and VM.find makes additional commands

VM.all doesn't appear cached. So if I do a .all for the menu, and later a .find in the same request, the find make an additional command, rather than reusing the output from .all

This slows things a far bit, esp when making ~5-6 calls in a single request.

cpu relationship on vm

Current:

vm.interface.get_cpu_property(:pae)
vm.interface.get_cpu_property(:synthetic)

Desired:

vm.cpu.pae
vm.cpu.synthetic

VM audio controller not available

The —machinereadable parsing doesn't contain the audio controller, only the host driver.

The controller is available when showvminfo is run without —machinereadable

Perhaps reuse the same technique Nics do, in that they also parse the human readable version for more info.

FFI gem unavailable on Rubinius

On Rubinius in Mac OS X 10.6, the virtualbox gem fails with a massive stack trace (partially excerpted below) because Rubinius doesn't have the FFI gem, though it does have FFI functionality (reference: https://github.com/evanphx/rubinius/issues/issue/546).

An exception occurred running /Users/noah/.rvm/gems/rbx-head/bin/vagrant
Unable to load - /Users/noah/.rvm/gems/rbx-head/gems/ffi-0.6.3/lib/ffi_c.bundle (LoadError::InvalidExtensionError)

Backtrace:
Rubinius::NativeMethod.load_extension at kernel/common/native_method.rb:26
Rubinius::CodeLoader#load_library at kernel/delta/codeloader.rb:158
Rubinius::CodeLoader#require at kernel/common/codeloader.rb:41
Rubinius::CodeLoader.require at kernel/common/codeloader.rb:140
Kernel(Object)#gem_original_require (require) at kernel/common/kernel.rb:735
Kernel(Object)#require at .rvm/rubies/rbx-head/lib/rubygems
/custom_require.rb:31
main.script at .rvm/gems/rbx-head/gems/ffi-0.6.3/lib
/ffi.rb:8
Rubinius::CodeLoader.require at kernel/common/codeloader.rb:145
Kernel(Object)#gem_original_require (require) at kernel/common/kernel.rb:735
Kernel(Object)#require at .rvm/rubies/rbx-head/lib/rubygems
/custom_require.rb:31
main.script at .rvm/gems/rbx-head/gems
/virtualbox-0.7.9/lib/virtualbox/com
/ffi/interface.rb:1
Rubinius::CodeLoader.require at kernel/common/codeloader.rb:145
Kernel(Module)#gem_original_require (require) at kernel/common/kernel.rb:735
Kernel(Module)#require at .rvm/rubies/rbx-head/lib/rubygems
/custom_require.rb:31
{ } in VirtualBox::GlobLoader.glob_require at .rvm/gems/rbx-head/gems
/virtualbox-0.7.9/lib/virtualbox
/ext/glob_loader.rb:31
Array#each at kernel/bootstrap/array.rb:71
VirtualBox::GlobLoader.glob_require at .rvm/gems/rbx-head/gems
/virtualbox-0.7.9/lib/virtualbox/ext
/glob_loader.rb:29
main.script at .rvm/gems/rbx-head/gems
/virtualbox-0.7.9/lib/virtualbox
/com.rb:23

Additional Export Settings

As of 0.6.0, the ability to pass in additional settings like the product name, url, license etc, to an exported VM, is no longer possible. Would be good to bring this functionality back.

System properties model

There is data like min/max memory, video ram, and cpu counts allowed available, along with various other information, but not yet parsed.

vboxmanage list systemproperties

Sadly, doesn't look like this information is available in XML files, so another system call. But it'd really help the editing process if you hook it into VM.save

Project still active?

Hi all,

I was wondering if this gem is still under development? I'd like to use it to create new VM Machines and Harddisks on the fly. Creating a new image seems not to be possible however:

# Creates a new instance of a virtual machine.
#
# **Currently can NOT be used to create a NEW virtual machine**.
# Support for creating new virtual machines will be added shortly.
# For now, this is only used by {VM.find} and {VM.all} to
# initialize the VMs.
def initialize(imachine)
  super()

  write_attribute(:interface, imachine)
  initialize_attributes(imachine)
end

Is there any plan to still implement this or should I try to look for another solution?

BR,
Bart

VM.save updated the VM one changed attribute at a time, rather than in one command

As the title says, if you do this for example:

vm = VirtualBox::VM.find('Example VM')
vm.name = "Change me"
vm.ostype = "windowsxp"
vm.save

Expected:

vboxmanage managevm "Example VM" --name "Change Me" --ostype "windowsxp"

Actual:

vboxmanage managevm "Example VM" --name "Change Me"
vboxmanage managevm "Example VM" --ostype "windowsxp"

The problem of course becomes apparent when you start update 20+ attributes

AbstractEnums take a hash of keys and common names

It would be good if AbstractEnums took a hash, comprised of keys, and their command names. In vboxweb_rb, I have to make this mapping manually, which it very incomplete.

def boot_types
  [ ['None', 'null'],
    ['Floppy', 'floppy'],
    ['CD / DVD-ROM', 'dvd'],
    ['Hard Disk', 'hard_disk'],
    ['Network', 'network'] ]
end

def audio_drivers
  [ ['None', 'none'],
    ['Null Audio Driver', 'null'],
    ['CoreAudio', 'core_audio'] ]
end

etc....

The idea is to be able to pass this off to the virtualbox gem.

map {
  :none => 'None',
  :null => 'Null Audio Driver',
  :core_audio => 'Core Audio'
}

Then:

vm.audio_adapter.audio_driver => :core_audio
vm.audio_adapter.audio_driver_name => "Core Audio"

InvalidObjectStateException when trying to resume.

I keep hitting this when I try to resume Vagrant instance that was suspended for me by VirtualBox. This usually happens when my battery runs low and OS X auto hibernates.

I sometimes find that I have to kill the whole box and start over because even the VirtualBox interface is unable to resume or discard the saved state.

I'm running the latest gems of Vagrant (0.6.6) and VirtualBox (0.7.5).

/opt/local/lib/ruby/gems/1.8/gems/virtualbox-0.7.5/lib/virtualbox/com/implementer/ffi.rb:95:in `call_and_check': Error in API call to open_remote_session: 2159738887 (VirtualBox::Exceptions::InvalidObjectStateException)
    from /opt/local/lib/ruby/gems/1.8/gems/virtualbox-0.7.5/lib/virtualbox/com/implementer/ffi.rb:69:in `call_vtbl_function'
    from /opt/local/lib/ruby/gems/1.8/gems/virtualbox-0.7.5/lib/virtualbox/com/implementer/ffi.rb:50:in `call_function'
    from /opt/local/lib/ruby/gems/1.8/gems/virtualbox-0.7.5/lib/virtualbox/com/abstract_interface.rb:134:in `call_function'
    from /opt/local/lib/ruby/gems/1.8/gems/virtualbox-0.7.5/lib/virtualbox/com/abstract_interface.rb:51:in `open_remote_session'
    from /opt/local/lib/ruby/gems/1.8/gems/virtualbox-0.7.5/lib/virtualbox/vm.rb:476:in `start'
    from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.6.6/lib/vagrant/action/vm/boot.rb:21:in `boot'
    from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.6.6/lib/vagrant/action/vm/boot.rb:14:in `call'
    from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.6.6/lib/vagrant/action/warden.rb:27:in `call'
    from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.6.6/lib/vagrant/action/builder.rb:120:in `call'
    from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.6.6/lib/vagrant/action.rb:119:in `run'
    from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.6.6/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.6.6/lib/vagrant/action.rb:119:in `run'
    from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.6.6/lib/vagrant/action/vm/resume.rb:12:in `call'
    from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.6.6/lib/vagrant/action/warden.rb:27:in `call'
    from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.6.6/lib/vagrant/action/builder.rb:120:in `call'
    from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.6.6/lib/vagrant/action.rb:119:in `run'
    from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.6.6/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.6.6/lib/vagrant/action.rb:119:in `run'
    from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.6.6/lib/vagrant/vm.rb:146:in `resume'
    from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.6.6/lib/vagrant/vm.rb:120:in `start'
    from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.6.6/lib/vagrant/command/up.rb:11:in `execute'
    from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.6.6/lib/vagrant/command/up.rb:8:in `each'
    from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.6.6/lib/vagrant/command/up.rb:8:in `execute'
    from /opt/local/lib/ruby/gems/1.8/gems/thor-0.14.3/lib/thor/task.rb:22:in `send'
    from /opt/local/lib/ruby/gems/1.8/gems/thor-0.14.3/lib/thor/task.rb:22:in `run'
    from /opt/local/lib/ruby/gems/1.8/gems/thor-0.14.3/lib/thor/invocation.rb:118:in `invoke_task'
    from /opt/local/lib/ruby/gems/1.8/gems/thor-0.14.3/lib/thor/invocation.rb:124:in `invoke_all'
    from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.6.6/lib/vagrant/config.rb:95:in `map'
    from /opt/local/lib/ruby/gems/1.8/gems/thor-0.14.3/lib/thor/core_ext/ordered_hash.rb:73:in `each'
    from /opt/local/lib/ruby/gems/1.8/gems/thor-0.14.3/lib/thor/invocation.rb:124:in `map'
    from /opt/local/lib/ruby/gems/1.8/gems/thor-0.14.3/lib/thor/invocation.rb:124:in `invoke_all'
    from /opt/local/lib/ruby/gems/1.8/gems/thor-0.14.3/lib/thor/group.rb:226:in `dispatch'
    from /opt/local/lib/ruby/gems/1.8/gems/thor-0.14.3/lib/thor/invocation.rb:109:in `send'
    from /opt/local/lib/ruby/gems/1.8/gems/thor-0.14.3/lib/thor/invocation.rb:109:in `invoke'
    from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.6.6/lib/vagrant/cli.rb:45:in `up'
    from /opt/local/lib/ruby/gems/1.8/gems/thor-0.14.3/lib/thor/task.rb:22:in `send'
    from /opt/local/lib/ruby/gems/1.8/gems/thor-0.14.3/lib/thor/task.rb:22:in `run'
    from /opt/local/lib/ruby/gems/1.8/gems/thor-0.14.3/lib/thor/invocation.rb:118:in `invoke_task'
    from /opt/local/lib/ruby/gems/1.8/gems/thor-0.14.3/lib/thor.rb:246:in `dispatch'
    from /opt/local/lib/ruby/gems/1.8/gems/thor-0.14.3/lib/thor/base.rb:389:in `start'
    from /opt/local/lib/ruby/gems/1.8/gems/vagrant-0.6.6/bin/vagrant:15
    from /opt/local/bin/vagrant:19:in `load'
    from /opt/local/bin/vagrant:19

VirtualBox.version throws nil if VirtualBox is 3.2.X

The new version of VirtualBox doesn't seem to work as a call to VirtualBox.version returns nil.

This was on Mac OS 10.6.2.

I commented out the version check from vagrant and this is the stack trace that I get:

/usr/local/lib/ruby/gems/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/ffi/interface.rb:136:in []': invalid memory read at address=0x0 (FFI::NullPointerError) from /usr/local/lib/ruby/gems/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/ffi/interface.rb:136:ininitialize_vtbl'
from /usr/local/lib/ruby/gems/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/ffi/interface.rb:130:in initialize' from /usr/local/lib/ruby/gems/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/implementer/ffi.rb:18:innew'
from /usr/local/lib/ruby/gems/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/implementer/ffi.rb:18:in initialize' from /usr/local/lib/ruby/gems/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/abstract_interface.rb:113:innew'
from /usr/local/lib/ruby/gems/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/abstract_interface.rb:113:in initialize' from /usr/local/lib/ruby/gems/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/ffi_interface.rb:60:innew'
from /usr/local/lib/ruby/gems/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/ffi_interface.rb:60:in initialize_com' from /usr/local/lib/ruby/gems/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/ffi_interface.rb:43:ininitialize'
from /usr/local/lib/ruby/gems/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/ffi_interface.rb:24:in new' from /usr/local/lib/ruby/gems/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/ffi_interface.rb:24:increate'
from /usr/local/lib/ruby/gems/1.8/gems/virtualbox-0.6.1/lib/virtualbox/lib.rb:75:in initialize' from /usr/local/lib/ruby/gems/1.8/gems/virtualbox-0.6.1/lib/virtualbox/lib.rb:39:innew'
from /usr/local/lib/ruby/gems/1.8/gems/virtualbox-0.6.1/lib/virtualbox/lib.rb:39:in lib' from /usr/local/lib/ruby/gems/1.8/gems/virtualbox-0.6.1/lib/virtualbox/global.rb:59:inglobal'
from /usr/local/lib/ruby/gems/1.8/gems/virtualbox-0.6.1/lib/virtualbox/vm.rb:138:in all' from /usr/local/lib/ruby/gems/1.8/gems/vagrant-0.3.4/lib/vagrant/actions/vm/forward_ports.rb:6:inprepare'
from /usr/local/lib/ruby/gems/1.8/gems/vagrant-0.3.4/lib/vagrant/actions/runner.rb:86:in send' from /usr/local/lib/ruby/gems/1.8/gems/vagrant-0.3.4/lib/vagrant/actions/runner.rb:86:inexecute!'
from /usr/local/lib/ruby/gems/1.8/gems/vagrant-0.3.4/lib/vagrant/actions/runner.rb:85:in each' from /usr/local/lib/ruby/gems/1.8/gems/vagrant-0.3.4/lib/vagrant/actions/runner.rb:85:inexecute!'
from /usr/local/lib/ruby/gems/1.8/gems/vagrant-0.3.4/lib/vagrant/actions/runner.rb:84:in each' from /usr/local/lib/ruby/gems/1.8/gems/vagrant-0.3.4/lib/vagrant/actions/runner.rb:84:inexecute!'
from /usr/local/lib/ruby/gems/1.8/gems/vagrant-0.3.4/lib/vagrant/commands/up.rb:17:in execute' from /usr/local/lib/ruby/gems/1.8/gems/vagrant-0.3.4/lib/vagrant/commands/base.rb:41:indispatch'
from /usr/local/lib/ruby/gems/1.8/gems/vagrant-0.3.4/lib/vagrant/commands/base.rb:50:in dispatch' from /usr/local/lib/ruby/gems/1.8/gems/vagrant-0.3.4/lib/vagrant/command.rb:24:insubcommand'
from /usr/local/lib/ruby/gems/1.8/gems/vagrant-0.3.4/lib/vagrant/command.rb:13:in execute' from /usr/local/lib/ruby/gems/1.8/gems/vagrant-0.3.4/bin/vagrant:7 from /usr/local/bin/vagrant:19:inload'
from /usr/local/bin/vagrant:19

Doesn't work on Windows 7 with VirtualBox 3.1.6

Here is the error I'm getting trying to run sample from the README file:

require 'virtualbox'
vm = VirtualBox::VM.find("my-vm")


C:/ruby187/lib/ruby/gems/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/mscom_interface.rb:18:in `initialize': failed to create WIN32OLE object from `VirtualBox.Session' (WIN32OLERuntimeEr
ror)
    HRESULT error code:0x80040154
      Class not registered
        from C:/ruby187/lib/ruby/gems/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/mscom_interface.rb:18:in `new'
        from C:/ruby187/lib/ruby/gems/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/mscom_interface.rb:18:in `initialize_mscom'
        from C:/ruby187/lib/ruby/gems/1.8/gems/virtualbox-0.6.1/lib/virtualbox/com/mscom_interface.rb:12:in `initialize'
        from C:/ruby187/lib/ruby/gems/1.8/gems/virtualbox-0.6.1/lib/virtualbox/lib.rb:73:in `new'

Which in turn doesn't allow me to play with Vagrant, bummer :)

More intuative error messaging

In vboxweb_rb, there is a settings update form. If a wrong value is passed in, I get:

Expected an Integer parameter

However, it doesn't say which value is incorrect.

Ideally, you could make

accelerate_3d_enabled Expected an Integer parameter, but got a String "true"

If adding the params type and value is too much, simply catching the error from the com interface and prepending the field name would be helpful.

accelerate_3d_enabled Expected an Integer parameter

undefined method `max_vdi_size' for #<VirtualBox::SystemProperties:0x102d6af80>

Since the new version of Virtualbox, the function to create a harddisk with the virtualbox fails.

It complains about the max_vdi_size not available as a global variable. And therefore the validate function that uses this can not complete. I noticed that the interface for 4.x does not have the variable anymore. Adding didn't resolve the problem.

newdisk=VirtualBox::HardDrive.new
newdisk.format=@Definition[:disk_format]
newdisk.logical_size=@Definition[:disk_size].to_i
newdisk.location=location
newdisk.save

thanks for any clues

Every now and then I get the: "Error in API call to FFI..."

I get this error every now and then. When I rerun my command it mostly does not reoccur, so consider this a minor issue.

From what I remember I get this error with the Vagrant commands 'ssh, reload, destroy':

As you may remember, I'm running Mac osx 10.5.8

Here is the complete error trace:

      vagrant reload

[INFO 04-19-2010 09:35:46] Vagrant: Provisioning enabled with Vagrant::Provisioners::ChefSolo
[INFO 04-19-2010 09:35:46] Vagrant: Forcing shutdown of VM...
[INFO 04-19-2010 09:35:47] Vagrant: Running any VM customizations...
/Users/jvandijk/.rvm/gems/ruby-1.8.7-p174/gems/virtualbox-0.6.0/lib/virtualbox/com/implementer/ffi.rb:97:in call_and_check': Error in API call to #<FFI::Function:0x1c8fc84>: 2159738887 (VirtualBox::Exceptions::InvalidObjectStateException) from /Users/jvandijk/.rvm/gems/ruby-1.8.7-p174/gems/virtualbox-0.6.0/lib/virtualbox/com/implementer/ffi.rb:71:incall_vtbl_function'
from /Users/jvandijk/.rvm/gems/ruby-1.8.7-p174/gems/virtualbox-0.6.0/lib/virtualbox/com/implementer/ffi.rb:52:in call_function' from /Users/jvandijk/.rvm/gems/ruby-1.8.7-p174/gems/virtualbox-0.6.0/lib/virtualbox/com/abstract_interface.rb:132:incall_function'
from /Users/jvandijk/.rvm/gems/ruby-1.8.7-p174/gems/virtualbox-0.6.0/lib/virtualbox/com/abstract_interface.rb:50:in open_session' from /Users/jvandijk/.rvm/gems/ruby-1.8.7-p174/gems/virtualbox-0.6.0/lib/virtualbox/vm.rb:254:inwith_open_session'
from /Users/jvandijk/.rvm/gems/ruby-1.8.7-p174/gems/virtualbox-0.6.0/lib/virtualbox/vm.rb:228:in save' from /Users/jvandijk/.rvm/gems/ruby-1.8.7-p174/gems/vagrant-0.3.0/lib/vagrant/actions/vm/customize.rb:12:inexecute!'
from /Users/jvandijk/.rvm/gems/ruby-1.8.7-p174/gems/vagrant-0.3.0/lib/vagrant/actions/runner.rb:86:in send' from /Users/jvandijk/.rvm/gems/ruby-1.8.7-p174/gems/vagrant-0.3.0/lib/vagrant/actions/runner.rb:86:inexecute!'
from /Users/jvandijk/.rvm/gems/ruby-1.8.7-p174/gems/vagrant-0.3.0/lib/vagrant/actions/runner.rb:85:in each' from /Users/jvandijk/.rvm/gems/ruby-1.8.7-p174/gems/vagrant-0.3.0/lib/vagrant/actions/runner.rb:85:inexecute!'
from /Users/jvandijk/.rvm/gems/ruby-1.8.7-p174/gems/vagrant-0.3.0/lib/vagrant/actions/runner.rb:84:in each' from /Users/jvandijk/.rvm/gems/ruby-1.8.7-p174/gems/vagrant-0.3.0/lib/vagrant/actions/runner.rb:84:inexecute!'
from /Users/jvandijk/.rvm/gems/ruby-1.8.7-p174/gems/vagrant-0.3.0/lib/vagrant/commands/reload.rb:14:in execute' from /Users/jvandijk/.rvm/gems/ruby-1.8.7-p174/gems/vagrant-0.3.0/lib/vagrant/commands/base.rb:41:indispatch'
from /Users/jvandijk/.rvm/gems/ruby-1.8.7-p174/gems/vagrant-0.3.0/lib/vagrant/commands/base.rb:50:in dispatch' from /Users/jvandijk/.rvm/gems/ruby-1.8.7-p174/gems/vagrant-0.3.0/lib/vagrant/command.rb:24:insubcommand'
from /Users/jvandijk/.rvm/gems/ruby-1.8.7-p174/gems/vagrant-0.3.0/lib/vagrant/command.rb:13:in execute' from /Users/jvandijk/.rvm/gems/ruby-1.8.7-p174/gems/vagrant-0.3.0/bin/vagrant:7 from /Users/jvandijk/.rvm/gems/ruby-1.8.7-p174/bin/vagrant:19:inload'
from /Users/jvandijk/.rvm/gems/ruby-1.8.7-p174/bin/vagrant:19

Ability to create NetworkInterfaces

So as to be able to talk to VMs by IP (as built by Vagrant), it seems like the best approach would be to use a second NIC. The comments seem to say creating NetworkAdapter objects isn't supported yet. I'd be more than happy to contribute a patch to do so, but I'm not really sure where to start.

Politely exit with OSE versions

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>'

vm = VirtualBox::VM.find("abc") fails on OS X

When I try the example script it fails on the call to find a vm:

vm = VirtualBox::VM.find("abc")

/opt/local/lib/ruby/gems/1.8/gems/virtualbox-0.8.0/lib/virtualbox/abstract_model/interface_attributes.rb:93:in send': undefined methodvrde_auth_library' for #VirtualBox::COM::Interface::Version_3_2_X::SystemProperties (NoMethodError)

Virtual box is up and running and the machine exists.

I also tried

macihnes = VirtualBox::VM.all

and that fails with the same error

VM.all cache is not cleared when a VM is destroy

Goes something like this:

vms = VM.all
vm = VM.find(....)
vm.destroy
vms = VM.all
vms.each { |vm| puts vm.state }

Basically, VM.all is not reloaded/refreshed when a vm is destroyed, causing state calls to error out.

undefined method `memory=' for #<VirtualBox::VM:0x000000019b6058> (NoMethodError)

[default] VM 'default' already created. Booting if its not already running...
[default] Provisioning enabled with Vagrant::Provisioners::ChefSolo
[default] Running any VM customizations...
/home/mikesmullin/.rvm/gems/ruby-1.9.2-rc2/gems/virtualbox-0.7.5/lib/virtualbox/abstract_model/dirty.rb:172:in `method_missing': undefined method `memory=' for # (NoMethodError)
    from /home/mikesmullin/workspace/Smullin Design/Ian Hannaford/Compass180.com/vagrant/Vagrantfile:4:in `block (2 levels) in '
    from /home/mikesmullin/.rvm/gems/ruby-1.9.2-rc2/gems/vagrant-0.5.1/lib/vagrant/util/stacked_proc_runner.rb:30:in `call'
    from /home/mikesmullin/.rvm/gems/ruby-1.9.2-rc2/gems/vagrant-0.5.1/lib/vagrant/util/stacked_proc_runner.rb:30:in `block in run_procs!'
    from /home/mikesmullin/.rvm/gems/ruby-1.9.2-rc2/gems/vagrant-0.5.1/lib/vagrant/util/stacked_proc_runner.rb:29:in `each'
    from /home/mikesmullin/.rvm/gems/ruby-1.9.2-rc2/gems/vagrant-0.5.1/lib/vagrant/util/stacked_proc_runner.rb:29:in `run_procs!'
    from /home/mikesmullin/.rvm/gems/ruby-1.9.2-rc2/gems/vagrant-0.5.1/lib/vagrant/action/vm/customize.rb:12:in `call'
    from /home/mikesmullin/.rvm/gems/ruby-1.9.2-rc2/gems/vagrant-0.5.1/lib/vagrant/action/vm/clean_machine_folder.rb:17:in `call'
    from /home/mikesmullin/.rvm/gems/ruby-1.9.2-rc2/gems/vagrant-0.5.1/lib/vagrant/action/env/error_halt.rb:11:in `call'
    from /home/mikesmullin/.rvm/gems/ruby-1.9.2-rc2/gems/vagrant-0.5.1/lib/vagrant/action/builder.rb:147:in `call'
    from /home/mikesmullin/.rvm/gems/ruby-1.9.2-rc2/gems/vagrant-0.5.1/lib/vagrant/action.rb:66:in `block in run'
    from /home/mikesmullin/.rvm/gems/ruby-1.9.2-rc2/gems/vagrant-0.5.1/lib/vagrant/util/busy.rb:19:in `busy'
    from /home/mikesmullin/.rvm/gems/ruby-1.9.2-rc2/gems/vagrant-0.5.1/lib/vagrant/action.rb:66:in `run'
    from /home/mikesmullin/.rvm/gems/ruby-1.9.2-rc2/gems/vagrant-0.5.1/lib/vagrant/vm.rb:107:in `start'
    from /home/mikesmullin/.rvm/gems/ruby-1.9.2-rc2/gems/vagrant-0.5.1/lib/vagrant/commands/up.rb:25:in `up_single'
    from /home/mikesmullin/.rvm/gems/ruby-1.9.2-rc2/gems/vagrant-0.5.1/lib/vagrant/commands/base.rb:109:in `block in all_or_single'
    from /home/mikesmullin/.rvm/gems/ruby-1.9.2-rc2/gems/vagrant-0.5.1/lib/vagrant/commands/base.rb:108:in `each'
    from /home/mikesmullin/.rvm/gems/ruby-1.9.2-rc2/gems/vagrant-0.5.1/lib/vagrant/commands/base.rb:108:in `all_or_single'
    from /home/mikesmullin/.rvm/gems/ruby-1.9.2-rc2/gems/vagrant-0.5.1/lib/vagrant/commands/up.rb:13:in `execute'
    from /home/mikesmullin/.rvm/gems/ruby-1.9.2-rc2/gems/vagrant-0.5.1/lib/vagrant/commands/base.rb:41:in `dispatch'
    from /home/mikesmullin/.rvm/gems/ruby-1.9.2-rc2/gems/vagrant-0.5.1/lib/vagrant/commands/base.rb:50:in `dispatch'
    from /home/mikesmullin/.rvm/gems/ruby-1.9.2-rc2/gems/vagrant-0.5.1/lib/vagrant/command.rb:24:in `subcommand'
    from /home/mikesmullin/.rvm/gems/ruby-1.9.2-rc2/gems/vagrant-0.5.1/lib/vagrant/command.rb:13:in `execute'
    from /home/mikesmullin/.rvm/gems/ruby-1.9.2-rc2/gems/vagrant-0.5.1/bin/vagrant:7:in `'
    from /home/mikesmullin/.rvm/gems/ruby-1.9.2-rc2/bin/vagrant:19:in `load'
    from /home/mikesmullin/.rvm/gems/ruby-1.9.2-rc2/bin/vagrant:19:in `'

Integration tests

Currently virtualbox have only mocks. They are great: fast, decoupled. But I think real integration tests are needed to.

vm.destroy(:destroy_medium => :delete) fails for virtualbox 4.x

The destroy function of a vm seems to fail. I suspect it's because the new version create a .vbox file that is left behind.

In v3.x I used

vm.destroy(:destroy_medium => :delete)
vm.destroy

this would fail now. Is this an interface issue, or can I help by somehere in the virtualbox code?

Failed to create WIN32OLE object from `VirtualBox.Session'

Hello,

I get the titled error when I try to 'find' a VirtualBox VM. The error goes on to say:

HRESULT error code:0x80040154
Class not registered

Here's the stats of what I'm running:

Windows Vista Enterprise 64-Bit
ruby 1.8.7 (2010-01-10 patchlevel 249) [i386-mingw32] -- installed with rubyinstaller-1.8.7-p249-rc2.exe from rubyinstaller.org
VirtualBox-3.1.8-61349-Win

Any ideas?

Thanks!
Bryan

Support Remote Control

Hi,

First off, thanks for a great library! Just what I was looking for! This is simply a feature request.

I didn't see any mention of support for interacting with an installation of VirtualBox on a remote machine. Any plans to support something like that in the future? With this being a wrapper around the 'VBoxManage' command, maybe remote control could be implemented using a RESTful interface? This way, web applications and command-line interfaces could be created to support remote access. Anyway, just a thought. :)

Thanks Again!
Bryan

Access VM's on a Hard Drive

I have the following code:

@vms_on_this_hd = VirtualBox::VM.all.select do |vm|
    vm.storage_controllers.any? do |sc|
      sc.medium_attachments.any? { |ma| ma.type == :hard_disk && ma.medium.uuid == @hd.uuid }
    end
  end

Basically, it takes all vms, checks each storage containers medium attachments to see if the hard drive is related.

Ideally, something like this could be available:

@vms_on_this_hd = @hd.virtual_machines

hw_virt relationship on vm

Currently need to use the following:

vm.interface.get_hw_virt_ex_property(:nested_paging)
vm.interface.get_hw_virt_ex_property(:enabled)

Use relationships to shorten this to:

vm.hw_virt.nested_paging
vm.hw_virt.enabled

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.