如何在`vagrant up`命令中指定提供程序?

问题描述 投票:1回答:1

我有两台机器(Linux,Mac),需要使用vagrant来管理vm。在Liux中使用VirtualBox,而在Mac中使用parallels。所以我在vagrant配置文件中配置了这两个提供程序,如下所示:

Vagrant.configure('2') do |config|
agrant.configure('2') do |config|
    config.ssh.forward_agent = true
    config.ssh.password = 'crunch'

    config.vm.box = 'ubuntu/xenial64'

    config.vm.provider 'virtualbox' do |vb|
        vb.gui = true
        vb.memory = '8192'
        vb.name = 'ubuntu'
    end

    config.vm.provider 'parallels' do |vb|
        vb.gui = true
        vb.memory = '8192'
        vb.name = 'ubuntu'
        config.vm.box = 'parallels/ubuntu-14.04'
    end

在我的mac系统上,当我在命令下运行时却收到错误:

$ vagrant up --provider parallels
An active machine was found with a different provider. Vagrant
currently allows each machine to be brought up with only a single
provider at a time. A future version will remove this limitation.
Until then, please destroy the existing machine to up with a new
provider.

Machine name: default
Active provider: virtualbox
Requested provider: parallels

我已经安装了所需的提供者:

$ vagrant plugin list
docker (0.4.0)
vagrant-parallels (1.7.8)
vagrant-share (1.1.9, system)
vagrant-vbguest (0.15.0)

那么为什么vagrant没有拿起--provider参数?

vagrant vagrantfile vagrant-plugin
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.