我有两台机器(linux、Mac),需要使用 vagrant 来管理 vm。在 Liux 中使用 VirtualBox,而在 Mac 中使用并行。所以我在 vagrant 配置文件中配置了这两个提供程序,如下所示:
Vagrant.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
参数呢?