Cannot boot Windows guest in VirtualBox without kernel module error

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:

---------------------------
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.


Solution 1:

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

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
    

Solution 2:

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 ImagePath in this example).

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.

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

Solution 3:

Try the following code (as administrator):

 sc.exe start vboxdrv

Solution 4:

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

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 thread on superuser gave me the solution:

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