Open techtonik opened 8 years ago
Hi there! Thanks for filing this issue.
There are two main avenues to consider.
To do that, search for "VBOXMANAGE CUSTOMIZATIONS" at https://www.vagrantup.com/docs/virtualbox/configuration.html
That is the best answer to your question, in my opinion.
To do that, check out this README: https://github.com/sandstorm-io/vagrant-spk/blob/master/HOWTO-libvirt.md
This is an alternative that skips using VirtualBox entirely and uses kvm/qemu instead.
Hi @paulproteus. Thanks for the pointers. I will try them right away.
I started process about using LXC/LXD as a superior replacement for VirtualBox and friends (in terms of performance) on Linux systems, but I run out of funds to complete the implementation stage. So if you have spare resources, it would be nice to try this alternative.
1
. Setting --longmode off
didn't help, and I don't remember why it should,
2
. Switching to libvirt
also failed
$ vagrant plugin install mutate
Installing the 'mutate' plugin. This can take a few minutes...
/usr/lib/ruby/2.3.0/rubygems/specification.rb:946:in `all=': undefined method `group_by' for nil:NilClass (NoMethodError)
from /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb:275:in `with_isolated_gem'
from /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb:231:in `internal_install'
from /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb:102:in `install'
from /usr/lib/ruby/vendor_ruby/vagrant/plugin/manager.rb:62:in `block in install_plugin'
from /usr/lib/ruby/vendor_ruby/vagrant/plugin/manager.rb:72:in `install_plugin'
from /usr/share/vagrant/plugins/commands/plugin/action/install_gem.rb:37:in `call'
from /usr/lib/ruby/vendor_ruby/vagrant/action/warden.rb:34:in `call'
from /usr/lib/ruby/vendor_ruby/vagrant/action/builder.rb:116:in `call'
from /usr/lib/ruby/vendor_ruby/vagrant/action/runner.rb:66:in `block in run'
from /usr/lib/ruby/vendor_ruby/vagrant/util/busy.rb:19:in `busy'
from /usr/lib/ruby/vendor_ruby/vagrant/action/runner.rb:66:in `run'
from /usr/share/vagrant/plugins/commands/plugin/command/base.rb:14:in `action'
from /usr/share/vagrant/plugins/commands/plugin/command/install.rb:32:in `block in execute'
from /usr/share/vagrant/plugins/commands/plugin/command/install.rb:31:in `each'
from /usr/share/vagrant/plugins/commands/plugin/command/install.rb:31:in `execute'
from /usr/share/vagrant/plugins/commands/plugin/command/root.rb:56:in `execute'
from /usr/lib/ruby/vendor_ruby/vagrant/cli.rb:42:in `execute'
from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:268:in `cli'
from /usr/bin/vagrant:173:in `<main>'
This seems to be a bug in the Debian package for Vagrant: https://github.com/vagrant-libvirt/vagrant-libvirt/issues/575 and there seems to be a workaround listed there. Can you try that and let me know?
BTW I'll probably run into that shortly, so I'm glad you're trailblazing here.
Oh it looks like it's fixed in sid if you can update to version 1.8.1+dfsg-2.
I am on Ubuntu 16.04 LTS and I forgot how to use package from Debian sid, so I just applied patch from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=818237#28 manually. Installed mutate
plugin successfully, getting back to shaving yaks.
It looks like this step - https://github.com/sandstorm-io/vagrant-spk/blob/master/HOWTO-libvirt.md#produce-an-appropriate-box-for-usage-with-libvirt - is unnecessary.
$ vagrant-spk vm up
Calling 'vagrant' 'up' in /home/techtonik/p/roundup/.sandstorm
The provider 'libvirt' could not be found, but was requested to
back the machine 'default'. Please use a provider that exists.
So how to install libvirt
provider for Vagrant?
Okay. Managed to install vagrant-libvirt
(kind of). Now getting this:
Bringing machine 'default' up with 'libvirt' provider...
Error while connecting to libvirt: Error making a connection to libvirt URI qemu:///system?no_verify=1&keyfile=/home/techtonik/.ssh/id_rsa:
Call to virConnectOpen failed: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied
Check the permissions/groups on that socket file:
ls -l /var/run/libvirt/libvirt-sock
If it's restricted to a particular user/group (possibly libvirt
? I'm not sure how Ubuntu configures things), you might need to add yourself to the group:
sudo gpasswd -a $USER libvirt # where "libvirt" here is whichever group owns the socket
And then log out and log in again, so that your user session is marked as having that group's access. You can check by running:
groups
and you should see the group you added yourself to listed.
$ ls -l /var/run/libvirt/libvirt-sock
srwxrwx--- 1 root libvirtd 0 May 11 20:57 /var/run/libvirt/libvirt-sock
$ groups
techtonik adm cdrom sudo dip plugdev lpadmin sambashare lxd libvirtd
Restarted and now it fails with
Bringing machine 'default' up with 'libvirt' provider...
==> default: Uploading base box image as volume into libvirt storage...
==> default: Creating image (snapshot of base box volume).
==> default: Creating domain with the following settings...
...
Error while creating domain: Error saving the server: Call to virDomainDefineXML failed: invalid argument: could not find capabilities for domaintype=kvm
Looks like it also requires VT-x, which is absent here
$ sudo kvm-ok
INFO: Your CPU does not support KVM extensions
KVM acceleration can NOT be used
Per https://libvirt.org/drvqemu.html if you 'sudo dpkg -r kvm' but keep the /usr/bin/qemu binary around, it should fall back properly.
Why do I want to remove kvm
package?
"kvm" only works when VT-x is available, if I understand correctly, and libvirt's "qemu" driver attempts to use kvm if the kvm binary is available, so if you remove it, you'll allow libvirt's "qemu" driver to fall back to actual qemu.
I'd prefer a way to switch to "qemu" driver explicitly, so I used libvirt.driver = "qemu"
and done apt install qemu
to get a little further. It still fails with:
==> default: /opt/app/.sandstorm/global-setup.sh: line 14: /host-dot-sandstorm/caches/install.sh: Permission denied
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
Second run seems to go ok, but I don't see anything running at http://local.sandstorm.io:6080/
$ vagrant-spk vm up
Calling 'vagrant' 'up' in /home/techtonik/p/roundup/.sandstorm
Bringing machine 'default' up with 'libvirt' provider...
There is something running, but it says the The connection was reset
.
Looks like install.sh
script failed, but it started.
I tried to use
$ VBoxManage modifyvm roundup_sandstorm_1462898296 --longmode off
, but everyvm up
recreates machine, so each time the name is different. Is there a way to pass the flag there?