Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VirtualBox::Exceptions::InvalidArgException every time I destroy the VM #485

Closed
millisami opened this issue Aug 29, 2011 · 9 comments
Closed

Comments

@millisami
Copy link

$ vagrant destroy

Destroying vm ....
/Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/virtualbox-0.9.1/lib/virtualbox/com/implementer/ffi.rb:106:in `call_and_check': Error in API call to get_network_adapter: 2147942487 (VirtualBox::Exceptions::InvalidArgException)
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/virtualbox-0.9.1/lib/virtualbox/com/implementer/ffi.rb:80:in `call_vtbl_function'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/virtualbox-0.9.1/lib/virtualbox/com/implementer/ffi.rb:61:in `call_function'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/virtualbox-0.9.1/lib/virtualbox/com/abstract_interface.rb:145:in `call_function'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/virtualbox-0.9.1/lib/virtualbox/com/abstract_interface.rb:62:in `block in function'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/virtualbox-0.9.1/lib/virtualbox/network_adapter.rb:78:in `block in populate_relationship'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/virtualbox-0.9.1/lib/virtualbox/network_adapter.rb:77:in `times'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/virtualbox-0.9.1/lib/virtualbox/network_adapter.rb:77:in `populate_relationship'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/virtualbox-0.9.1/lib/virtualbox/abstract_model/relatable.rb:253:in `populate_relationship'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/virtualbox-0.9.1/lib/virtualbox/abstract_model.rb:214:in `block in populate_relationship'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/virtualbox-0.9.1/lib/virtualbox/abstract_model/dirty.rb:129:in `ignore_dirty'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/virtualbox-0.9.1/lib/virtualbox/abstract_model.rb:214:in `populate_relationship'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/virtualbox-0.9.1/lib/virtualbox/vm.rb:277:in `load_relationship'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/virtualbox-0.9.1/lib/virtualbox/abstract_model/relatable.rb:203:in `read_relationship'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/virtualbox-0.9.1/lib/virtualbox/abstract_model/relatable.rb:146:in `block in relationship'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/virtualbox-0.9.1/lib/virtualbox/host_network_interface.rb:93:in `block in attached_vms'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/virtualbox-0.9.1/lib/virtualbox/host_network_interface.rb:92:in `each'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/virtualbox-0.9.1/lib/virtualbox/host_network_interface.rb:92:in `find_all'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/virtualbox-0.9.1/lib/virtualbox/host_network_interface.rb:92:in `attached_vms'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/action/vm/destroy_unused_network_interfaces.rb:18:in `block in call'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/action/vm/destroy_unused_network_interfaces.rb:13:in `each'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/action/vm/destroy_unused_network_interfaces.rb:13:in `call'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/action/warden.rb:30:in `call'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/action/vm/clean_machine_folder.rb:17:in `call'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/action/warden.rb:30:in `call'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/action/vm/destroy.rb:14:in `call'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/action/warden.rb:30:in `call'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/action/vm/clear_nfs_exports.rb:15:in `call'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/action/warden.rb:30:in `call'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/action/vm/provisioner_cleanup.rb:15:in `call'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/action/warden.rb:30:in `call'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/action/vm/halt.rb:24:in `call'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/action/warden.rb:30:in `call'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/action/vm/discard_state.rb:17:in `call'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/action/warden.rb:30:in `call'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/action/env/set.rb:13:in `call'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/action/warden.rb:30:in `call'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/action/builder.rb:120:in `call'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/action.rb:134:in `block (2 levels) in run'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/util/busy.rb:19:in `busy'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/action.rb:134:in `block in run'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/environment.rb:364:in `block in lock'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/environment.rb:354:in `open'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/environment.rb:354:in `lock'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/action.rb:133:in `run'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/vm.rb:163:in `destroy'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/command/destroy.rb:9:in `block in execute'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/command/destroy.rb:7:in `each'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/command/destroy.rb:7:in `execute'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180@global/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180@global/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180@global/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `block in invoke_all'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180@global/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `each'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180@global/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `map'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180@global/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `invoke_all'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180@global/gems/thor-0.14.6/lib/thor/group.rb:226:in `dispatch'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180@global/gems/thor-0.14.6/lib/thor/invocation.rb:109:in `invoke'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/lib/vagrant/cli.rb:45:in `block in register'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180@global/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180@global/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180@global/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180@global/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/gems/vagrant-0.8.5/bin/vagrant:21:in `<top (required)>'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/bin/vagrant:19:in `load'
    from /Users/millisami/.rvm/gems/ruby-1.9.2-p180/bin/vagrant:19:in `<main>'

Gems using:
vagrant - 0.8.5
virtualbox - 0.9.1

and VirtualBox is of 4.1.0

@ThePixelDeveloper
Copy link

I can confirm this

Gems:

  • vagrant (0.8.6)
  • virtualbox (0.9.2)

Running with Virtualbox 4.1.2r73507

@mitchellh
Copy link
Contributor

Open your VirtualBox GUI, I bet you there is a VM which is "inaccessible." I will push a fix for this in the virtualbox rubygem soon but in the mean time you can get around this by making sure no inaccessible VMs are around. Closing this since it is a virtualbox gem issue.

@millisami
Copy link
Author

Yup, @mitchellh, you win. There were several orphan VMs lying around.

@mnohe
Copy link

mnohe commented Oct 30, 2011

Still happening on a Virtualbox 4.1.4 configuration with no inaccessible VMs (just one working virtual machine) while trying to package that working virtual machine.

  • ruby (1.8.7)
  • vagrant (0.8.7)
  • virtualbox (0.9.2)

@mitchellh
Copy link
Contributor

@noihe What operating system are you on?

@mnohe
Copy link

mnohe commented Oct 31, 2011

Mac OS X 10.6.8 and 10.7. Upgrading to Ruby 1.9.3 hasn't helped either.

@vStone
Copy link
Contributor

vStone commented Nov 3, 2011

I'm having the same issue when trying to package a box (which fails)

  • No inaccessible drives.
  • OS: Gentoo
  • ruby 1.8.7
  • vagrant-0.8.8.dev
  • virtualbox-0.9.3

@mnohe
Copy link

mnohe commented Nov 3, 2011

After several installs/reinstalls, it looks like my problems came from using sudo to install Vagrant and its related gems. It might be convenient to update the relevant Vagrant documentation, if that proves to be the case: http://vagrantup.com/docs/getting-started/setup/mac.html

@vStone
Copy link
Contributor

vStone commented Nov 4, 2011

Update: I removed the VM, kept the disk, recreated the VM and it is working like a breeze now.

Edit: After changing the chipset from PIIX3 to ICH9, packaging the box is broken once more. This seems to be the real issue in my case.

@ghost ghost locked and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants