在没有内核模块错误的情况下无法在 VirtualBox 中启动 Windows 客户机

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/34778147/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 19:25:05  来源:igfitidea点击:

Cannot boot Windows guest in VirtualBox without kernel module error

windowsservicekernelvirtualbox

提问by Anthony Mastrean

I'm running Vagrant (1.8.1) + VirtualBox (5.0.12) on Windows 7 and trying to boot up a Windows 7 image (modernIE/w7-ie8). However, I get this error:

我在 Windows 7 上运行 Vagrant (1.8.1) + VirtualBox (5.0.12) 并尝试启动 Windows 7 映像(现代 IE/w7-ie8)。但是,我收到此错误:

---------------------------
VirtualBox - Error In supR3HardenedWinReSpawn
---------------------------
<html><b>NtCreateFile(\Device\VBoxDrvStub) failed: 0xc0000034 STATUS_OBJECT_NAME_NOT_FOUND (0 retries) (rc=-101)</b><br/><br/>Make sure the kernel module has been loaded successfully.<br><br><!--EOM-->where: supR3HardenedWinReSpawn
what:  3
VERR_OPEN_FAILED (-101) - File/Device open failed.

Driver is probably stuck stopping/starting. Try 'sc.exe query vboxdrv' to get more information about its state. Rebooting may actually help.</html>
---------------------------
OK
---------------------------

I ran the query command, but the service "is not found".

我运行了查询命令,但“未找到”服务。

> sc.exe query vboxdrv
[SC] EnumQueryServicesStatus:OpenService FAILED 1060:

The specified service does not exist as an installed service.

I tried rebooting, too. Nothing.

我也试过重启。没有。

采纳答案by Anthony Mastrean

There's something wrong with the installation of VirtualBox (I've been seeing reports of this problem as far back as 4.x). The installer registers an incorrect location for the driver SYS file (the ImagePathin this example).

VirtualBox 的安装有问题(我早在 4.x 就看到了这个问题的报告)。安装程序为驱动程序 SYS 文件(ImagePath在本例中为 )注册了错误的位置。

PS> Get-ItemProperty HKLM:\system\currentcontrolset\services\vboxdrv


Type         : 1
Start        : 3
ErrorControl : 1
ImagePath    : \??\C:\Program Files\Oracle\VirtualBox\VBoxDrv.sys
DisplayName  : VBox Support Driver
PSPath       : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\system\currentcontrolset\services\vboxdrv
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\system\currentcontrolset\services
PSChildName  : vboxdrv
PSDrive      : HKLM
PSProvider   : Microsoft.PowerShell.Core\Registry

The file doesn't exist.

该文件不存在。

PS> Test-Path (Get-ItemProperty HKLM:\system\currentcontrolset\services\vboxdrv).ImagePath
False

The actual location requires an extra drivers\vboxdrv.

实际位置需要额外的drivers\vboxdrv.

PS> Test-Path 'C:\Program Files\Oracle\VirtualBox\drivers\vboxdrv\VBoxDrv.sys'
True

You can update the registered location.

您可以更新注册的位置。

PS> Set-ItemProperty HKLM:\system\currentcontrolset\services\vboxdrv -Name ImagePath -Value '\??\C:\Program Files\Oracle\VirtualBox\drivers\vboxdrv\VBoxDrv.sys'

And now you can start the driver/service.

现在您可以启动驱动程序/服务。

> sc.exe start vboxdrv

回答by Ram Ch. Bachkheti

I am on windows 10 and following steps works for me:

我在 Windows 10 上,以下步骤对我有用:

Steps:

脚步:

  1. Navigate to "C:\Program Files\Oracle\VirtualBox\drivers\vboxdrv"
  2. Right click on "VBoxDrv.inf" file and select Install option
  3. Open the Console as a administrator and run the following command

    sc start vboxdrv
    
  1. 导航到“C:\Program Files\Oracle\VirtualBox\drivers\vboxdrv”
  2. 右键单击“VBoxDrv.inf”文件并选择安装选项
  3. 以管理员身份打开控制台并运行以下命令

    sc start vboxdrv
    

回答by Yousif Garabet

Try the following code (as administrator):

尝试以下代码(以管理员身份):

 sc.exe start vboxdrv

回答by estellezg

I did what Anthony Mastrean suggested but I was still getting some errors:

我按照 Anthony Mastrean 的建议做了,但我仍然遇到一些错误:

C:\Vagrant>sc query vboxdrv

SERVICE_NAME: vboxdrv
        TYPE               : 1  KERNEL_DRIVER
        STATE              : 1  STOPPED
        WIN32_EXIT_CODE    : 31  (0x1f)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0

C:\Vagrant>sc start vboxdrv
[SC] StartService FAILED 123:

The filename, directory name, or volume label syntax is incorrect.

This threadon superuser gave me the solution:

超级用户上的这个线程给了我解决方案:

find C:\Program Files\Oracle\VirtualBox\drivers\vboxdrv\ VBoxDrv.infright click and select Install

找到C:\Program Files\Oracle\VirtualBox\drivers\vboxdrv\ VBoxDrv.inf右键单击并选择安装