Setting “Paravirtualization Interface” in Vagrantfile

前端 未结 2 453
傲寒
傲寒 2021-02-06 07:07

VirtualBox 5 exposes a setting called \"Paravirtualization Interface\" that can improve performance for some specific guest operating systems.

Is there a way to set this

2条回答
  •  不知归路
    2021-02-06 07:25

    Found it. VBoxManage (the VirtualBox CLI tool) has an optional argument called --paravirtprovider. You can add that to the vb.customize call:

    Vagrant.configure(2) do |config|
      config.vm.box = "ubuntu/trusty64"
      config.vm.provider "virtualbox" do |vb|
        vb.customize [
          "modifyvm", :id,
          "--memory", "1024",
          "--paravirtprovider", "kvm", # for linux guest
          "--cpus", "2"
        ]
      end
    end
    

    The other CPU settings are also available that way, vb.customize accepts the same argument as VBoxManage. Refer to VboxManage --help to get a list of all the options.

提交回复
热议问题