SELOG

SEが困ったときに見るメモ

vagrant upでエラーが発生する

本記事の環境

OS:Windows 11 Home (64 bit)
CPU:AMD Ryzen 5 3500U Radeon Vega Mobile Gfx 2.10 GHz
RAM:20 GB
Vagrant 2.3.4 VirtualBox 7.0

参考書籍

エラーの発生条件

Vagrantfileで以下をコメントアウトしてvagrant upを実行する

config.vm.network "private_network", ip: "192.168.33.10"

エラー内容

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'centos/7' version '2004.01' is up to date...
==> default: Clearing any previously set network interfaces...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["hostonlyif", "create"]

Stderr: 0%...E_FAIL
VBoxManage.exe: error: Failed to create the host-only adapter
VBoxManage.exe: error: Querying NetCfgInstanceId failed (ERROR_FILE_NOT_FOUND)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleCreate(struct HandlerArg *)" at line 105 of file VBoxManageHostonly.cpp

原因と対処方法

原因

Hyper-Vが有効がになっていたため、Hyper-VVirtualBoxVagrantと競合が発生していた

対処方法

管理者権限のコマンドプロンプトPowerShellで以下のコマンドを実行してパソコンを再起動

bcdedit /set hypervisorlaunchtype off