adrahon / vagrant-kvm

This project is dead, please use vagrant-libvirt instead! A Vagrant 1.4+ plugin that adds a KVM provider to Vagrant, allowing Vagrant to control and provision KVM/QEMU VM.
MIT License
366 stars 60 forks source link

Can't start Vagrant KVM on Ubuntu 14.04 w/ Vagrant 1.6.5 #256

Closed mhamann closed 9 years ago

mhamann commented 9 years ago

Getting the following error when running vagrant up:

$ vagrant up
~/.vagrant.d/gems/gems/vagrant-kvm-0.1.8/lib/vagrant-kvm/driver/driver.rb:735:in `capabilities': Expected Connection object (ArgumentError)
    from ~/.vagrant.d/gems/gems/vagrant-kvm-0.1.8/lib/vagrant-kvm/driver/driver.rb:735:in `connect_libvirt_qemu!'
    from ~/.vagrant.d/gems/gems/vagrant-kvm-0.1.8/lib/vagrant-kvm/driver/driver.rb:44:in `initialize'
    from ~/.vagrant.d/gems/gems/vagrant-kvm-0.1.8/lib/vagrant-kvm/provider.rb:34:in `new'
    from ~/.vagrant.d/gems/gems/vagrant-kvm-0.1.8/lib/vagrant-kvm/provider.rb:34:in `machine_id_changed'
    from ~/.vagrant.d/gems/gems/vagrant-kvm-0.1.8/lib/vagrant-kvm/provider.rb:15:in `initialize'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/machine.rb:127:in `new'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/machine.rb:127:in `initialize'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/vagrantfile.rb:75:in `new'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/vagrantfile.rb:75:in `machine'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:537:in `machine'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/plugin/v2/command.rb:168:in `block in with_target_vms'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/plugin/v2/command.rb:192:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/plugin/v2/command.rb:192:in `block in with_target_vms'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/plugin/v2/command.rb:174:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/plugin/v2/command.rb:174:in `with_target_vms'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/up/command.rb:67:in `block in execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:268:in `block (2 levels) in batch'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:266:in `tap'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:266:in `block in batch'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:265:in `synchronize'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:265:in `batch'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/up/command.rb:58:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/cli.rb:42:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment.rb:292:in `cli'
    from /opt/vagrant/bin/../embedded/gems/gems/vagrant-1.6.5/bin/vagrant:174:in `<main>'
adrahon commented 9 years ago

I need to test the plugin with latest Vagrant.

miurahr commented 9 years ago

This error may happen from ruby-libvirt. Which version of ruby-libvirt you used?

adrahon commented 9 years ago

I'm going to close this issue if there's no confirmation, the plugin works from what I've tested.

mhamann commented 9 years ago

I switched to using the vagrant-libvirt driver instead, which seems to work well on my system. Not sure why, since KVM and libvirt are related, but I'm no expert on these technologies, so I couldn't say.

esanchezm commented 9 years ago

This also happened to me. Updated to Ubuntu 14.10, using vagrant 1.4.3, ruby-libvirt 0.5.1-3 and vagrant-kvm 0.1.9. This is the backtrace:

/home/esteban/.vagrant.d/gems/gems/vagrant-kvm-0.1.9/lib/vagrant-kvm/driver/driver.rb:735:in `capabilities': Expected Connection object (ArgumentError)
    from /home/esteban/.vagrant.d/gems/gems/vagrant-kvm-0.1.9/lib/vagrant-kvm/driver/driver.rb:735:in `connect_libvirt_qemu!'
    from /home/esteban/.vagrant.d/gems/gems/vagrant-kvm-0.1.9/lib/vagrant-kvm/driver/driver.rb:44:in `initialize'
    from /home/esteban/.vagrant.d/gems/gems/vagrant-kvm-0.1.9/lib/vagrant-kvm/provider.rb:34:in `new'
    from /home/esteban/.vagrant.d/gems/gems/vagrant-kvm-0.1.9/lib/vagrant-kvm/provider.rb:34:in `machine_id_changed'
    from /home/esteban/.vagrant.d/gems/gems/vagrant-kvm-0.1.9/lib/vagrant-kvm/provider.rb:15:in `initialize'
    from /usr/lib/ruby/vendor_ruby/vagrant/machine.rb:116:in `new'
    from /usr/lib/ruby/vendor_ruby/vagrant/machine.rb:116:in `initialize'
    from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:434:in `new'
    from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:434:in `machine'
    from /usr/lib/ruby/vendor_ruby/vagrant/plugin/v2/command.rb:142:in `block in with_target_vms'
    from /usr/lib/ruby/vendor_ruby/vagrant/plugin/v2/command.rb:175:in `call'
    from /usr/lib/ruby/vendor_ruby/vagrant/plugin/v2/command.rb:175:in `block in with_target_vms'
    from /usr/lib/ruby/vendor_ruby/vagrant/plugin/v2/command.rb:174:in `map'
    from /usr/lib/ruby/vendor_ruby/vagrant/plugin/v2/command.rb:174:in `with_target_vms'
    from /usr/share/vagrant/plugins/commands/up/command.rb:56:in `block in execute'
    from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:210:in `block (2 levels) in batch'
    from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:208:in `tap'
    from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:208:in `block in batch'
    from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:207:in `synchronize'
    from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:207:in `batch'
    from /usr/share/vagrant/plugins/commands/up/command.rb:55:in `execute'
    from /usr/lib/ruby/vendor_ruby/vagrant/cli.rb:38:in `execute'
    from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:484:in `cli'
    from /usr/bin/vagrant:127:in `<main>'

Tried a backport to trusty ruby-libvirt (0.5.1-1) but the problem continues.

esanchezm commented 9 years ago

I tried updating to vagrant 1.6.5 and couldn't make it work either

I tried destroying the old machine and building the machine again from scratch and the problem is gone now.

adrahon commented 9 years ago

By destroying and rebuilding the machine do you mean the Vagrant VM? Or the base box? In any case, it looks like bad error handling on our side.

esanchezm commented 9 years ago

I destroyed both because the migration to vagrant 1.6.5 moved the boxes to a subdirectory /0/ and messed everything.

adrahon commented 9 years ago

Is it working now? It would be great to be able to reproduce.

adrahon commented 9 years ago

@hmehra you meant to report this as a vagrant-libvirt issue, I think? https://github.com/pradels/vagrant-libvirt/