環境
PC: HP ProDesk 400 G3 SFF
windows10 Home
Vagrant 2.2.14
ORACLE VM VirtualBox 6.1
VagrantBox centOS-7.7
PowerShell
現象
Vangrant up を実行すると以下のようなエラーが発生する
> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'bento/centos-7.7' version '202005.12.0' is up to date...
==> default: Clearing any previously set forwarded ports...
==> 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: 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", "e866d576-5a9b-4e45-bf9c-65ade2149b42", "--type", "headless"]
Stderr: VBoxManage.exe: error: Not in a hypervisor partition (HVP=0) (VERR_NEM_NOT_AVAILABLE).
VBoxManage.exe: error: VT-x is disabled in the BIOS for all CPU modes (VERR_VMX_MSR_ALL_VMX_DISABLED)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole
原因
エラーメッセージある
VBoxManage.exe: error: VT-x is disabled in the BIOS for all CPU modes (VERR_VMX_MSR_ALL_VMX_DISABLED)
VT-xが無効になっているよ。全てのCPUモードに対するBIOSでね。(という感じの意味だと)
解決策
WindowsのBoot設定からVT-xというものを有効にする。
私のPCはWindowsの起動画面でESCを連打することで起動できます。
端末によって連打するファンクションキーは違うので調べましょう。
Bootの設定画面
BIOS SETUPを選択
Advancedを選択
System Options を選択
やっと見つけました
Virtualization Technology(VTx)
これにEnterでチェックを入れ、変更を保存して起動し直してからVagrant upを実行すると問題なく実行されました。