Vagrant complains about libvirt missing when I explicity ask it to use Virtualbox

36 views
Skip to first unread message

Sleipnir

unread,
Jun 21, 2020, 4:46:26 AM6/21/20
to Vagrant
Hello,

I am trying to run my first VM with vagrant on Debian 10 but I get this message:

Error while connecting to libvirt: Error making a connection to libvirt URI qemu:///system?no_verify=1&keyfile=/root/.ssh/id_rsa:
Call to virConnectOpen failed: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory

I don't understand this message since my Vagrantfile does not refer to libvirt but to virtualbox, since I'm using it and no longer libvirt.

Vagrant.configure("2") do |config|
  # master server
  config.vm.define "kmaster" do |kmaster|
    kmaster.vm.box = "debian/stretch64"
    kmaster.vm.hostname = "kmaster"
    kmaster.vm.box_url = "debian/stretch64"
    kmaster.vm.network :private_network, ip: "192.168.1.10"
    kmaster.vm.provider :virtualbox do |v|
      v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
      v.customize ["modifyvm", :id, "--memory", 2048]
      v.customize ["modifyvm", :id, "--name", "kmaster"]
      v.customize ["modifyvm", :id, "--cpus", "2"]
    end
  end
end

Virtualbox without vagrant works fine on my system.

Jeff Bonhag

unread,
Jun 22, 2020, 10:08:34 AM6/22/20
to vagra...@googlegroups.com
Hi there,

You can run `vagrant up --provider virtualbox` to tell Vagrant to use VirtualBox for the current environment. You can also set the environment variable `VAGRANT_DEFAULT_PROVIDER=virtualbox` if you want Vagrabt to use VirtualBox for all your VMs.

Hope this helps!

Cheers,
Jeff

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/vagrant/issues
Discuss: https://discuss.hashicorp.com/c/vagrant/24
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/67740b7d-d8ed-41e8-a341-23d348831f7eo%40googlegroups.com.

Sleipnir

unread,
Jun 25, 2020, 1:02:29 PM6/25/20
to vagra...@googlegroups.com
Thank you, it works perfectly !

Reply all
Reply to author
Forward
0 new messages