Write the Code. Change the World.

7月 06

现象

使用 vagrant 启动 VirtualBox 失败,提示:

Bringing machine 'homestead-7' up with 'virtualbox' provider...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["list", "hostonlyifs"]

Stderr: VBoxManage.exe: error: Failed to create the VirtualBox object!
VBoxManage.exe: error: Failed to instantiate CLSID_VirtualBox w/ IVirtualBox, CLSID_VirtualBox w/ IUnknown works.
VBoxManage.exe: error: PSDispatch looks broken by some installer featuring the broken oleaut32.msm module as a component.

VBoxManage.exe: error: See also https://support.microsoft.com/en-us/kb/316911
VBoxManage.exe: error: Details: code E_NOINTERFACE (0x80004002), component VirtualBoxClientWrap, interface IVirtualBoxClient

或手动启动 VirtualBox 提示:

引起的原因

使用 vagrant 启动 VirtualBox,没有使用 vagrant halt 关闭服务时,可能会引起上述的错误。

解决方法

修改注册表法:

  1. win + r 打开运行输入界面。输入 regedit 回车,弹出注册表面板。

  2. 找到下图这里,并进行修改。再启动就会好了。

修改注册表的如下两项:
HKEY_CLASSES_ROOT\CLSID{00020420-0000-0000-C000-000000000046}\InprocServer32
HKEY_CLASSES_ROOT\CLSID{00020424-0000-0000-C000-000000000046}\InprocServer32

将它们的默认值都改成:
C:\Windows\system32\oleaut32.dll