0%

Vagrant常见问题

“rsync” could not be found on your PATH

有以下几种解决方案:

  • 下载cwRsync,解压后放到PATH中
  • 安装cygwin,在cygwin里运行vagrant up
  • 修改C:\Users{your_username}.vagrant.d\boxes\{your_os}}\{your_os_version}\virtualbox\Vagrantfile 文件,把rsync替换为virtualbox
    1
    config.vm.synced_folder ".", "/vagrant", type: "virtualbox"

Vagrant was unable to mount VirtualBox shared folders. This is usually because the filesystem “vboxsf” is not available.

1
vagrant plugin install vagrant-vbguest

修改虚拟机内存

修改Vagrantfile文件

1
2
3
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
end

一个项目多个虚拟机

修改Vagrantfile文件

1
2
3
4
5
6
7
8
9
Vagrant.configure("2") do |config|
config.vm.box = "centos/7"

config.vm.define "web01" do |web01|
end

config.vm.define "web02" do |web02|
end
end