Here’s a list of things that currently fail when trying to run vagrant
under Arch. Hopefully I hit most of the keywords from errors and you’re
reading this because you ran into one of those.
Vagrant is not an official Arch package.
It’s in AUR though - https://aur.archlinux.org/packages/vagrant/ (vote
for it!) and `pacaur -S vagrant` will happily install it.
Wrong guest additions version
Arch will most likely install virtualbox with a different api than guest
additions in the box you downloaded from the internet. This is easily
fixable by either creating your own compatible box, or adding a plugin via:
vagrant plugin install vagrant-vbguest
This will make sure that after every new vm is started, the guest
additions version will be checked. If it doesn’t match or isn’t
installed, guest additions will be downloaded and forced to comply.
If you provide the iso, the addins will be installed from the CD. No,
the internet doesn’t know how to make sure the guest additions CD is
mounted automatically. No, you can’t access the “Install guest
additions” menu unless you use the gui for the vm. No, it doesn’t make sense.
Reading from shared folders hangs
If reading from shared folders causes freezes and stracing results in
just a looped call to `getdents()`, you have incompatible guest
additions. Problem described
here. Solution -
Rebooting the VM results in a freeze
If you don’t update guest additions, shared folders don’t work. If you
do, the host will freeze during the bootup after the first reset. Yes it
does. That’s all.
There’s a kvm module for vagrant!
Some sanity can be hopefully restored by using KVM/libvirt instead of
vbox. There are two modules -
vagrant-libvirt. Both will
fail to install.
How to install vagrant-kvm
Trying to simply run `vagrant plugin install vagrant-kvm` will result in:
Installing the 'vagrant-kvm' plugin. This can take a few minutes...
...in `run': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
The log in `mkmf.log` will tell you that:
/usr/..../libvirt.so: undefined reference to `curl_global_init@CURL_OPENSSL_4'
(and many other functions too). The problem is described
here and all you
need to do is move away the following files from
`/opt/vagrant/embedded/lib/`: `libcurl.so`, `libcurl.so.4`,
`libcurl.so.4….` (whichever version you have at the moment). Finally
move `/opt/vagrant/embedded/lib/pkgconfig/libcurl.pc`. Now
`vagrant-kvm` will install succesfully and you can move the files back
into the original place.
Vagrant-kvm doesn’t work because “authentication failed: polkit”
Of course it won’t. Arch simply installs libvirt and leaves you holding
the baby. Read the arch wiki and
setup the polkit rules. Also you have to create the libvirt group, even
though the wiki lists it as an alternative way.
Vagrant-kvm doesn’t work because “Failed to connect socket to …”
Restart your libvirt using:
sudo systemctl restart libvirtd
Vagrant-kvm doesn’t work becuase “Could not create file: Permission denied”
At some point when you weren’t looking something changed the owner of
`\~/.vagrant.d/tmp/storage-pool` to root. That means the process
spawning the vm is not running as you anymore and most likely you
removed the `rx’ rights from “others” on your home directory. For this
one I don’t have a good solution anymore. You’ll have to give ‘x’ rights
on your home either to all (`chmod o+x \~`), or just to `users` and
`libvirt` using the acls.
Vagrant-kvm doesn’t work because “VagrantPlugins::ProviderKvm::Action::NFS”
You’re right, it doesn’t. You have to repackage vagrant-kvm from master
branch, because the fix is not released yet (as of March 2014). Read the
upstream issue and
follow the gem repackaging instructions.