
VirtualBoxとlibvirt / kvm-qemuがインストールされたUbuntu 17.04システムがあります。
VirtualBox プロバイダを使用して Vagrant ボックスを起動しようとすると、次のエラーが発生します。
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/xenial64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/xenial64' is up to date...
==> default: A newer version of the box 'ubuntu/xenial64' is available! You currently
==> default: have version '20170626.0.0'. The latest is version '20170717.0.0'. Run
==> default: `vagrant box update` to update.
==> default: Setting the name of the VM: mainframe_default_1500383484218_22222
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["startvm", "ab19fdfd-349e-40d0-b540-aa130b9e1b72", "--type", "headless"]
Stderr: VBoxManage: error: VT-x is being used by another hypervisor (VERR_VMX_IN_VMX_ROOT_MODE).
VBoxManage: error: VirtualBox can't operate in VMX root mode. Please disable the KVM kernel extension, recompile your kernel and reboot (VERR_VMX_IN_VMX_ROOT_MODE)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole
kvm-qemuも存在するときにVirtualBoxとVagrantを使用する方法はありますか?
これは私のものですVagrantfile
:
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.network "private_network", ip: "192.168.66.10"
config.vm.provision "ansible" do |ansible|
ansible.playbook = 'playbook.yml'
end
end
libvirtプロバイダは、ボックス数が少なく、使用するすべてのVagrantfileを手動で編集する必要があるため、使用したくありません。
VirtualBoxとlibvirt / kvm-qemuの両方が存在するときにVirtualBoxでVagrantを使用する方法は?
答え1
私は偶然その答えを見つけました。両方を同時にインストールすることは可能ですが、同時に仮想マシンを実行することはできません。
libvirtのすべての仮想マシンをシャットダウンすると、VagrantとVirtualBoxを実行できます。マシンにlibvirtが必要な場合は、各VitrualBox VMをシャットダウンする必要があります。
答え2
VirtualBoxとLibvirt(KVM)の両方がCPU仮想化機能へのフルアクセスを必要とするため、同時に実行することはできません。