38
38

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Vagrant で VirtualBox 5.0 の準仮想化を有効にする

Posted at

要旨

VirtualBox 5.0 で準仮想化が利用できるようになったので Vagrant で VM を作るときに有効にする設定の紹介。

前提

  • Vagrant 1.7.3+
  • VirtualBox 5.0+

Vagrant のバージョンが古いとそもそも VM が立ち上がらないので注意。

設定

VirtualBox provider の customize メソッドは VBoxManage コマンドのラッパーなので、modifyvm で新しく追加された準仮想化オプションを設定するように書けば良い:

Vagrantfile
Vagrant.configure(2) do |config|
  # とりあえず VagrantCloud にある CentOS 7.0 イメージを使う
  config.vm.box = "chef/centos-7.0"
  config.vm.provider "virtualbox" do |provider|
    provider.customize [ 'modifyvm', :id, '--paravirtprovider', 'kvm' ]
  end
end

既存の VM がある場合は config.vm.provider "virtualbox" ... だけ追記して vagrant reload すれば反映される。

参考

38
38
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
38
38

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?