关于 "customize"的 Vagrant 投诉

标签 vagrant

我对 Vagrant 有一个奇怪的问题。更改虚拟机的默认 RAM 必须很容易,但我不知道为什么我不能这样做。

我的代码很简单:

# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.define "mimeticStack" do |v|
    v.vm.box = "precise64"
    v.vm.box_url = "http://files.vagrantup.com/precise64.box"
    v.vm.network "private_network", ip: "192.168.33.10"
    v.vm.network "forwarded_port", guest: 80, host: 8080
    v.vm.hostname = "dev.mimetic.local"
    v.vm.customize ["modifyvm", :id, "--memory", "512"]
  end
end

然后,如果我运行“vagrant up”,Vagrant 返回:
vm:
* The following settings shouldn't exist: customize

最佳答案

问题已修复:

# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    config.vm.define "mimeticStack" do |v|
        v.vm.box = "precise64"
        v.vm.box_url = "http://files.vagrantup.com/precise64.box"
        v.vm.network "private_network", ip: "192.168.33.10"
        v.vm.network "forwarded_port", guest: 80, host: 8080
        v.vm.hostname = "dev.mimetic.local"
        v.vm.provider :virtualbox do |vb|
            vb.customize ['modifyvm', :id,'--memory', '512']
        end
    end 
end

我把代码留在这里给像我这样的 Vagrant 初学者。

关于关于 "customize"的 Vagrant 投诉,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23103903/

相关文章:

node.js - 竖框管理 : error: Details: code NS_ERROR_FAILURE (0x80004005) with meanjs and vagrant

vagrant - 在 Vagrant alone-provisioner 上使用 Chef.json 安装 apt 包

ruby - 如何更改 Vagrant (VDD) VM 的 php 和 xdebug 版本?

linux - 找不到盒子 '....'

chef-infra - Vagrant : how to get hostonly ip address from within chef recipe?

php - PDOException SQLSTATE [28000] [1045] 拒绝用户访问 'homestead' @'localhost'

mysql - 如何从vagrant box连接到远程数据库

PHP 内置服务器无法与主机中的 Vagrant 一起使用

vagrant - 无法在代理后面做 Vagrant

vagrant - vagrant up 后未知文件系统类型 'vboxsf'