设置“半虚拟化接口"在 Vagrantfile 中 [英] Setting "Paravirtualization Interface" in Vagrantfile

查看:18
本文介绍了设置“半虚拟化接口"在 Vagrantfile 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

VirtualBox 5 公开了一个名为 "Paravirtualization Interface" 的设置,可以改进某些特定客户操作系统的性能.

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

有没有办法在 Vagrantfile 中设置这个选项?

Is there a way to set this option in a Vagrantfile?

一般来说:是否有关于如何通过 Vagrantfile 设置加速设置的文档?

And in general: Is there documentation on how to set the acceleration settings via the Vagrantfile?

推荐答案

找到了.VBoxManage(VirtualBox CLI 工具)有一个名为 --paravirtprovider 的可选参数.您可以将其添加到 vb.customize 调用中:

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

其他 CPU 设置也可用这种方式,vb.customize 接受与 VBoxManage 相同的参数.请参阅 VboxManage --help 以获取所有选项的列表.

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.

这篇关于设置“半虚拟化接口"在 Vagrantfile 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆