Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to use new Vagrant install - Error while connecting to libvirt

Tags:

vagrant

ubuntu

Regardless if I have a Vagrant file or if one doesn't exist and I create my own with vagrant init (which works btw) I get an error when trying to do this:

vagrant up

The error is:

1: from /usr/share/rubygems-integration/all/gems/vagrant-libvirt-0.0.43/lib/vagrant-libvirt/driver.rb:40:in `connection'
/usr/share/rubygems-integration/all/gems/vagrant-libvirt-0.0.43/lib/vagrant-libvirt/driver.rb:43:in `rescue in connection': Error while connecting to libvirt: 
Error making a connection to libvirt URI qemu:///system?no_verify=1&keyfile=/home/michael/.ssh/id_rsa: (VagrantPlugins::ProviderLibvirt::Errors::FogLibvirtConnectionError)
Call to virConnectOpen failed: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory
Error while connecting to libvirt: Error making a connection to libvirt URI qemu:///system?no_verify=1&keyfile=/home/michael/.ssh/id_rsa:
Call to virConnectOpen failed: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory

This is on Ubuntu 18.04

like image 915
Michael Durrant Avatar asked May 02 '19 13:05

Michael Durrant


1 Answers

Two things are needed:

  1. You need to specifiy a provider
  2. That provider needs to be setup

For 2 (setting up the provider) you can do (for example)

sudo apt-get install virtualbox

Then, for 1 (setting up the box from them)

vagrant up --provider virtualbox
like image 122
Michael Durrant Avatar answered Oct 12 '22 19:10

Michael Durrant