vagrant 配置文件简析

#自定义box名字  

config.vm.box = "website"

#以ip192.168.33.10访问 

config.vm.network "private_network", ip: "192.168.33.10"

#将本地8080端口映射为虚拟机80端口 

config.vm.network "forwarded_port", guest: 80, host: 8080

#设置本地共享目录data为虚拟机中vagrant_data目录

config.vm.synced_folder "../data", "/vagrant_data"

内存修改:

config.vm.provider "virtualbox" do |vb|
    # Use VBoxManage to customize the VM. For example to change memory:

    vb.customize ["modifyvm", :id, "--memory", "1024"]

    end

 config.vm.provider "virtualbox" do |v|

    v.memory = 1024  

    v.cpus = 2

 end

 

posted @ 2016-03-10 14:20  Youn丶  阅读(448)  评论(0编辑  收藏  举报