How to disable Hyper-V in Windows?

Genymotion Desktop does not work well alongside Hyper-V at this time. It makes VirtualBox fall back to software virtualization. This causes start up errors. It causes extremely long booting time. It causes major slowdown or stability issues.

Therefore, Genymotion recommends disabling Hyper-V when using Genymotion Desktop.

Method 1: Using our "home-made" batch script

Genymotion has coded a batch file to allow to easily disable Hyper-V and all Windows features related to it.

> Warning: This batch script has been created with AI assistance and used internally at Genymotion. Make sure to review before use. You are solely responsible for its execution in your environment. REQUIRES ADMINISTRATOR PRIVILEGES.

To use the batch script, copy the following code into the notepad (or any other text editor) and save it as "hyperv-tool.bat":

@echo off
setlocal enabledelayedexpansion

if " %1 " == " RELAUNCHED " goto: main
cmd /k " %~f0 " RELAUNCHED
exit

: main
title Hyper-V ^ & Virtualization Toggle

:: Check for Administrator privileges
net session > nul 2 >& 1
if %errorlevel% neq 0 ( 
    echo [!] This script must be run as Administrator.
    echo Right-click the file and select " Run as administrator ".
    exit /b 1
    goto: afterfunc
)

:: Helper: get Windows Optional Feature state
: GetFeatureState
set " TMPFILE = %TEMP% \feat_state.txt "
powershell -NoProfile -Command " (Get-WindowsOptionalFeature -Online -FeatureName ' %~1 ').State " > "!TMPFILE! " 2 > nul
set " %~2 = "
set /p %~2 = < "!TMPFILE! "
del "!TMPFILE! " > nul 2 >& 1
for /f " tokens=* delims= " %%a in ( "!%~2! " ) do set " %~2 = %%a "

:: Helper: get registry-based feature state
: GetRegState
set " TMPFILE = %TEMP% \reg_state.txt "
reg query " %~1 " /v " %~2 " > "!TMPFILE! " 2 > nul
set " _REGVAL = "
for /f " tokens=3 " %%a in ('type "!TMPFILE! " ^ | findstr /i " %~2 " ') do set " _REGVAL = %%a "
del "!TMPFILE! " > nul 2 >& 1
if "!_REGVAL! " == " 0x1 " ( set " %~3 = Enabled " ) else ( set " %~3 = Disabled " )

:: Print a table row with fixed column widths
: PrintRow
:: %~1 = index, %~2 = label (max 38 chars), %~3 = state
set " _IDX = %~1 "
set " _LBL = %~2 "
set " _LBL =!_LBL:~ 0, 38! "
set " _ST = %~3 "
if /i "!_ST! " == " Enabled " ( set " _ST = Enabled " )
if /i "!_ST! " == " Disabled " ( set " _ST = Disabled " )
if "!_ST! " == " " ( set " _ST = N/A " )
echo ^ | [!_IDX! ]!_LBL! ^ \|!_ST! ^ \| 

: afterfunc
:: Define all features
set " F1_LABEL = Hyper-V "
set " F1_TYPE = opt "
set " F1_NAME = Microsoft-Hyper-V-All "

set " F2_LABEL = WSL2 (Subsystem for Linux) "
set " F2_TYPE = opt "
set " F2_NAME = Microsoft-Windows-Subsystem-Linux "

set " F3_LABEL = Windows Sandbox "
set " F3_TYPE = opt "
set " F3_NAME = Containers-DisposableClientVM "

set " F4_LABEL = Virtual Machine Platform "
set " F4_TYPE = opt "
set " F4_NAME = VirtualMachinePlatform "

set " F5_LABEL = Windows Hypervisor Platform "
set " F5_TYPE = opt "
set " F5_NAME = HypervisorPlatform "

set " F6_LABEL = Memory Integrity (HVCI) "
set " F6_TYPE = reg "
set " F6_NAME = HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity "
set " F6_REGVAL = Enabled "

set " F7_LABEL = Virt. Based Security (VBS) "
set " F7_TYPE = reg "
set " F7_NAME = HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard "
set " F7_REGVAL = EnableVirtualizationBasedSecurity "

:: Check all feature states
echo Checking feature status, please wait...
for %%i in (1 2 3 4 5) do ( 
    call: GetFeatureState "!F %%i _NAME! " F %%i _STATE
)

call: GetRegState "!F6_NAME! " "!F6_REGVAL! " F6_STATE
call: GetRegState "!F7_NAME! " "!F7_REGVAL! " F7_STATE

:: Display status table
echo ^ | Feature ^ \| Status ^ \|
for %%i in (1 2 3 4 5 6 7) do ( 
    call: PrintRow " %%i " "!F %%i _LABEL! " "!F %%i _STATE! "
)

:: Build enabled / disabled lists
set " ENABLED_LIST = "
set " DISABLED_LIST = "
for %%i in (1 2 3 4 5 6 7) do ( 
    if /i "!F %%i _STATE! " == " Enabled " set " ENABLED_LIST =!ENABLED_LIST! %%i "
    if /i "!F %%i _STATE! " == " Disabled " set " DISABLED_LIST =!DISABLED_LIST! %%i "
)

:: Question 1: Which to ENABLE
set " TO_ENABLE = "
if "!DISABLED_LIST! " == " " ( 
    echo [*] All features are currently enabled. Nothing to enable.
    echo Which features do you want to ENABLE?
    echo (Enter numbers separated by spaces, or press Enter to skip ^ )
    for %%i in (!DISABLED_LIST! ) do ( 
        echo [ %%i ]!F %%i _LABEL!
        set /p " TO_ENABLE = Enable: "
    )
)

:: Question 2: Which to DISABLE
set " TO_DISABLE = "
if "!ENABLED_LIST! " == " " ( 
    echo [*] All features are currently disabled. Nothing to disable.
    echo Which features do you want to DISABLE?
    echo (Enter numbers separated by spaces, or press Enter to skip ^ )
    for %%i in (!ENABLED_LIST! ) do ( 
        echo [ %%i ]!F %%i _LABEL!
        set /p " TO_DISABLE = Disable: "
    )
)

:: Bail if nothing selected
if "!TO_ENABLE! " == " " if "!TO_DISABLE! " == " " ( 
    echo [*] No changes selected. Goodbye.
    pause
    exit /b 0
)

:: Confirm summary
echo Summary of changes:
if not "!TO_ENABLE! " == " " ( 
    for %%i in (!TO_ENABLE! ) do echo [+] ENABLE:!F %%i _LABEL!
)
if not "!TO_DISABLE! " == " " ( 
    for %%i in (!TO_DISABLE! ) do echo [-] DISABLE:!F %%i _LABEL!
)

set /p " CONFIRM = Proceed? (Y/N): "
if /i "!CONFIRM! " neq " Y " goto quit

:: Apply ENABLE changes
if not "!TO_ENABLE! " == " " ( 
    for %%i in (!TO_ENABLE! ) do ( 
        echo Enabling!F %%i _LABEL!...
        if /i "!F %%i _TYPE! " == " opt " ( 
            powershell -NoProfile -Command " Enable-WindowsOptionalFeature -Online -FeatureName '!F %%i _NAME! ' -NoRestart "
        )
        reg add "!F %%i _NAME! " /v "!F %%i _REGVAL! " /t REG_DWORD /d 1 /f > nul
        echo [+]!F %%i _LABEL! ENABLED.
    )
)

:: Apply DISABLE changes
if not "!TO_DISABLE! " == " " ( 
    for %%i in (!TO_DISABLE! ) do ( 
        echo Disabling!F %%i _LABEL!...
        if /i "!F %%i _TYPE! " == " opt " ( 
            powershell -NoProfile -Command " Disable-WindowsOptionalFeature -Online -FeatureName '!F %%i _NAME! ' -NoRestart "
        )
        reg add "!F %%i _NAME! " /v "!F %%i _REGVAL! " /t REG_DWORD /d 0 /f > nul
        echo [-]!F %%i _LABEL! DISABLED.
    )
)

:: Reboot prompt
echo A reboot is required for changes to take effect.
echo [1] Reboot now
echo [2] I will reboot later
set /p " REBOOT = Enter your choice (1 or 2): "
if "!REBOOT! " == " 1 " ( 
    echo Rebooting in 10 seconds... Close this window to cancel.
    timeout /t 10
    shutdown /r /t 0
    echo [*] Remember to reboot before the changes take effect.
    goto quit
) 

: quit
echo [*] No changes made. Goodbye.
pause
exit /b 0

The page also states the following about the script.

DISCLAIMER (inside the script)

DESCRIPTION (inside the script)

FEATURES MANAGED (inside the script)

NOTES (inside the script)

REQUIREMENTS (inside the script)

USAGE (inside the script)

After you create and run the batch file:

Links shown on the page:

Method 2: disable Hyper-V manually

If you do not wish to, or cannot, use a third party script, you can also disable Hyper-V manually.

Step 1: Disable Hyper-V features

1. Go to Control Panel Programs Turn Windows features on or off 2. Uncheck Hyper-V in Windows feature: 3. Click OK 4. Windows Feature will apply the changes and ask you to restart. 5. Click Restart Now to reboot the PC and apply the changes.

Also, make sure that the following features are disabled:

Step 2: Disable Memory Integrity

Even though you have explicitly disabled Hyper-V, Windows 11 has several features that silently use the Hyper-V hypervisor in the background, which can prevent VirtualBox from accessing the hardware virtualization capabilities.

One of those features is the Memory Integrity security feature from the Core Isolation security measures.

To disable Memory Integrity:

1. Open Windows Security 2. Go to Device Security > Core isolation details 3. Turn Memory Integrity off 4. Reboot your PC when prompted

Step 3: Verify that Hyper-V is properly disabled

Open a PowerShell terminal and run the following command:

systeminfo | findstr -i "hyper-v requirements"

If Hyper-V is disabled, you should get the following output:

Hyper-V Requirements: VM Monitor Mode Extensions: Yes
Virtualization Enabled In Firmware: Yes
Second Level Address Translation: Yes
Data Execution Prevention Available: Yes

Otherwise, Hyper-V is still enabled.

If Hyper-V is still active after following Step 1 and Step 2, try following to completely disable Hyper-V manually.

> Warning: Windows 11 24H2 > > There is a known bug with Windows 11 24H2 which makes it impossible to disable Hyper-V on some configurations. > Make sure to use Windows 11 25H2 or higher, or upgrade Windows 11 24H2 to 25H2 if possible.