Help us understand the problem. What is going on with this article?

VagrantfileでVirtualBoxのVMパフォーマンス向上設定

More than 3 years have passed since last update.

下に掲載したものをベースにいじると楽だと思います。
(box, memory, cpus あたりはお好みで)

肝要は vb.customize の中身です。

CUI 用

Ubuntu Server や CentOS のような CUI サーバー環境を作る場合。

仮想化支援系のオプションを有効にし、準仮想化インターフェースに KVM を指定しています。 vagrant init しただけの状態と比べると VM の起動が結構早くなります。

Vagrantfile
Vagrant.configure(2) do |config|
  config.vm.box = "ubuntu/trusty64"
  config.vm.box_check_update = false
  config.vm.provider "virtualbox" do |vb|
    vb.memory = 4096
    vb.cpus = 2
    vb.customize [
      "modifyvm", :id,
      "--hwvirtex", "on",
      "--nestedpaging", "on",
      "--largepages", "on",
      "--ioapic", "on",
      "--pae", "on",
      "--paravirtprovider", "kvm",
    ]
  end
end

GUI 用

MATE, Cinnamon, Xubuntu のようなデスクトップ環境を作る場合。
上と比べてグラフィック系やメモリ系オプションが増えてます。

Vagrantfile
Vagrant.configure(2) do |config|
  config.vm.box = "ubuntu/trusty64"
  config.vm.box_check_update = false
  config.vm.provider "virtualbox" do |vb|
    vb.memory = 4096
    vb.cpus = 2
    vb.gui = true
    vb.customize [
      "modifyvm", :id,
      "--vram", "256",
      "--accelerate3d", "on",
      "--hwvirtex", "on",
      "--nestedpaging", "on",
      "--largepages", "on",
      "--ioapic", "on",
      "--pae", "on",
      "--paravirtprovider", "kvm",
    ]
  end
end

参考リンク


以上です。

hidekuro
雑食。私がQiitaで公開する独自コードは、特に記載がない限り CC0 https://creativecommons.org/publicdomain/zero/1.0/deed.ja とします。
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした