我将开始使用Vagrant,并希望与KVM/qemu (以及虚拟机管理器GUI)一起使用它,而不是安装VirtualBox。所以我第一次安装了Vagrant:
$ vagrant --version
Vagrant 1.9.1
$ vagrant box list
There are no installed boxes! Use `vagrant box add` to add some作为每 这些 帖子,我需要vagrant-libvirt才能使用KVM,所以接下来我安装了它:
$ vagrant plugin list
vagrant-libvirt (0.0.37)
vagrant-share (1.1.6, system)接下来,我将使用vagrant box add "centos/7"添加一个vagrant box add "centos/7"(7)框,并在出现提示时选择libvirt。之后,我运行了vagrant init,没有遇到任何错误:
$ vagrant init centos/7
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.但是,vagrant up似乎是错误的,如下所示:
$ vagrant up
No usable default provider could be found for your system.
Vagrant relies on interactions with 3rd party systems, known as
"providers", to provide Vagrant with resources to run development
environments. Examples are VirtualBox, VMware, Hyper-V.
The easiest solution to this message is to install VirtualBox, which
is available for free on all major platforms.
If you believe you already have a provider available, make sure it
is properly installed and configured. You can see more details about
why a particular provider isn't working by forcing usage with
`vagrant up --provider=PROVIDER`, which should give you a more specific
error message for that particular provider.Vagrantfile中的应用
config.vm.provider :libvirt连域domain.driver = "qemu“domain.memory = 512 domain.cpus =1 endvagrant up --provider=kvm、vagrant up --provider=qemu和vagrant up --provider=libvirt,但都没有结果。我错过了什么步骤吗?还是需要安装的另一个包/依赖项?
编辑:在使用迷航器添加centos/7之后,在运行vagrant box list时显示出来。
$ vagrant box list
centos/7 (libvirt, 1611.01)发布于 2017-09-04 12:32:35
用命令启动“流浪者”框
vagrant up --provider=kvm虽然在https://seven.centos.org/2017/08/updated-centos-vagrant-images-available-v1707-01/中有这样的说法
-libvirt插件只与Vagrane1.5到1.8兼容。
发布于 2019-03-30 12:57:13
您可以使用命令行选项--provider=kvm或设置VAGRANT_DEFAULT_PROVIDER环境变量:
export VAGRANT_DEFAULT_PROVIDER=kvm # <-- may be in ~/.profile, /etc/profile, or elsewhere
vagrant up发布于 2018-02-01 08:26:01
如果您正在运行Ruby2.3,则流浪者-libvirt(0.0.40)与Vagrane2.0.2兼容,至少在LinuxMint18.3(Ubuntu16.04)上是如此。我在vagrantUp网站上使用Debian下载的流浪者,并使用它安装插件,没有任何问题。
https://stackoverflow.com/questions/42155213
复制相似问题