vagrant配置多个虚拟机

Vagrant.configure("2") do |config|
	vms = Array(1..5)
    vms.each do |i|
        config.vm.define "node-#{i}" do |node|
            node.vm.box = "ubuntu16.04"
			node.vm.hostname = "ubuntu16-04-#{i}"
            node.vm.box_check_update = false 
			node.vm.network "private_network", ip: "192.168.56.20#{i}"
            node.vm.synced_folder "E:/data", "/data"
			node.vm.provider "virtualbox" do |v|
				v.name = "ubuntu16.04_#{i}"
				v.memory = 4096 
				v.cpus = 4
			end
		end
    end
end

Vagrant挂载目录失败mount: unknown filesystem type ‘vboxsf’

错误提示:
Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem “vboxsf” is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:
mount -t vboxsf -o uid=1000,gid=1000 vagrant /vagrant
The error output from the command was:
mount: unknown filesystem type ‘vboxsf’
1、打开
/Applications/VirtualBox.app/Contents/MacOS
2、找到
VBoxGuestAdditions.iso
加载到虚拟机
如果没有可以到这里下载
http://download.virtualbox.org/virtualbox/5.0.14/VBoxGuestAdditions_5.0.14.iso
3、在虚拟机当中执行
sudo mount /dev/sr0 /media/cdrom
4、cd /media/cdrom/ && sh ./VBoxLinuxAdditions.run
5、reboot下虚拟机即可

mac执行vagrant命令报错

执行:vagrant box add命令

错误提示:

An error occurred while downloading the remote file. The error

message, if any, is reproduced below. Please fix this error and try

again.

解决办法:sudo rm /opt/vagrant/embedded/bin/curl

执行:vagrant up报错

An error occurred while downloading the remote file. The error

message, if any, is reproduced below. Please fix this error and try

again.

解决办法:

vagrant plugin install vagrant-hostsupdater

然后检查

config.vm.box是否是新增的box名字