> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/backup-and-storage/images-snapshots/public-images/deactivate-vbs-hvci-microsoft-windows-server-2025.md).

# Deactivate Virtualization-Based Security and Hypervisor-Enforced Code Integrity

Deactivate Virtualization-Based Security (VBS) and HVCI on Windows Server 2025 to remove the nested virtualization slowdown in IONOS CLOUD VMs.

In some environments, Windows Server 2025 virtual machines run noticeably slower. The Windows features Virtualization-Based Security (VBS) and Hypervisor-Enforced Code Integrity (HVCI) cause this when Windows Server itself runs as a virtual machine. The impact is strongest for CPU-intensive workloads.

VBS and HVCI extend the Windows security model. VBS isolates sensitive data, such as credentials, from the rest of the operating system, and HVCI allows only trusted code to run in the kernel. Both use hardware virtualization and the Windows hypervisor. These components are part of the base operating system and work without the Hyper-V role.

On a physical server, the processor supports virtualization natively in silicon. In a virtual machine, such as an <code class="expression">space.vars.ionos\_cloud</code> VM, Windows requests this virtualization support from the hypervisor underneath. This is called nested virtualization. The hypervisor then must emulate in software some functions that the processor provides natively on physical hardware. This emulation is slower and causes the performance degradation.

With the workaround, these features are inactive, as in Windows Server 2022. You trade the additional protection for better performance in virtual environments.

## Key behavior

* VBS and HVCI capability is activated automatically, depending on domain membership, installed roles, installed features, or applications that request them.
* Activation may occur silently after role installation or configuration changes.

## Known triggers

The following triggers are known to activate VBS or HVCI:

* **Domain membership:** Windows Server 2025 enables Credential Guard by default on domain-joined servers that are not domain controllers. Credential Guard depends on VBS to isolate authentication credentials in a hardware-protected enclave.
* **Remote Desktop Session Host (Terminal Server):** Installing this role automatically enables Credential Guard, which depends on VBS to isolate authentication credentials in a hardware-protected enclave.
* **Microsoft SQL Server 2025:** SQL Server 2025 activates HVCI as part of its hardened execution environment to protect against code injection and memory tampering at the kernel level.
* **Windows Subsystem for Linux 2 (WSL 2):** WSL 2 runs a lightweight Hyper-V VM under the hood. It activates the Virtual Machine Platform feature, which brings up the Windows hypervisor stack and triggers VBS.

{% hint style="info" %}
**Note:** For domain membership, Remote Desktop Session Host, and SQL Server 2025, the workaround in [Deactivate VBS and HVCI](#deactivate-vbs-and-hvci) removes the performance impact.
{% endhint %}

{% hint style="warning" %}
**Important:** WSL 2 and the complete workaround exclude each other. WSL 2 requires the Windows hypervisor, which Step 2 turns off. If you need WSL 2, skip Step 2. The performance impact then remains, because WSL 2 uses nested virtualization.
{% endhint %}

## Deactivate VBS and HVCI

To deactivate VBS and HVCI on Windows Server 2025, follow these steps:

{% hint style="info" %}
**Prerequisites:**

* Administrator access to the Windows Server 2025 instance.
* Access to the DCD or the Cloud API with permission to stop and start the VM.
  {% endhint %}

{% stepper %}
{% step %}

### Deactivate Credential Guard, VBS, and HVCI

Use one of the following methods:

{% tabs %}
{% tab title="Using registry" %}
These commands deactivate Credential Guard (credential isolation) and HVCI (kernel code integrity enforcement). Both rely on VBS and contribute to nested virtualization overhead.

```cmd
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v LsaCfgFlags /t REG_DWORD /d 0 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity" /v Enabled /t REG_DWORD /d 0 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\CredentialGuard" /v Enabled /t REG_DWORD /d 0 /f
```

{% hint style="info" %}
**Note:** Additional scenarios may exist depending on which roles are running on the server. Usually, you can leave `KeyGuard` unchanged. The preceding commands cover Terminal Server scenarios.
{% endhint %}
{% endtab %}

{% tab title="Using Group Policy (alternative)" %}
Navigate to **Computer Configuration** > **Administrative Templates** > **System** > **Device Guard**, and set the policy **Turn On Virtualization Based Security** to **Disabled**. This turns off the VBS features globally.

{% hint style="info" %}
**Note:** Configure the policy in a domain Group Policy Object (GPO) and link the GPO to the organizational unit (OU) that contains your Windows Server 2025 servers. Pre-stage the computer account of a new server in this OU before the server joins the domain. The server then receives the policy together with the domain join, instead of activating VBS first and needing a later fix.
{% endhint %}
{% endtab %}
{% endtabs %}

To revert, set the `Enabled` values back to `1` and remove the `LsaCfgFlags` value, or set the **Group Policy** to **Not Configured**.
{% endstep %}

{% step %}

### Prevent the hypervisor from launching at start

```cmd
bcdedit /set hypervisorlaunchtype off
bcdedit /set vsmlaunchtype off
```

These commands prevent the Windows hypervisor and Virtual Secure Mode from starting during system start. This turns off the Windows hypervisor entirely.

To revert, set both values back to `auto`.

{% hint style="info" %}
**Note:** If you need WSL 2, skip this step. WSL 2 keeps working, but it starts the Windows hypervisor again. This brings back nested virtualization and its performance impact.
{% endhint %}
{% endstep %}

{% step %}

### Full VM restart using IONOS CLOUD

{% hint style="warning" %}
**Important:** When you stop a VM in the DCD, the DCD deallocates its resources and releases its dynamically assigned public IP address. After the start, the VM can receive a new public IP address, depending on its configuration. Use a reserved IPv4 address if the VM must keep its address.
{% endhint %}

To apply the changes, perform a full power cycle of the VM on the infrastructure level:

1. Shut down the Windows operating system.
2. In the DCD, in the Inspector pane, select **Power** > **Stop**, and then select **PROVISION CHANGES**.

   When provisioning is complete, the VM status shows **Shut off** in the Inspector pane, and the VM icon shows a red cross. After the operating system shutdown in step 1, the status also shows **Shut off**, but the VM stays allocated.

   ![The VM shows the status Shut off in the Inspector pane and a red cross in the Workspace](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-cbdb6df1fc5f1c0b2a1e70db0533334fe3460305%2Fshut-off-vm-example.webp?alt=media)
3. Select **Power** > **Start**, select **PROVISION CHANGES**, and wait until provisioning is complete.

After the start, check the result as described in [<mark style="color:blue;">Verification</mark>](#verification).

{% hint style="info" %}
**Note:** You can also perform these steps through the Cloud API ([<mark style="color:blue;">Stop an Enterprise Server by ID</mark>](https://docs.ionos.com/cloud/api-reference/cloud-api-v6/servers/stop-an-enterprise-server-by-id), [<mark style="color:blue;">Start an Enterprise Server by ID</mark>](https://docs.ionos.com/cloud/api-reference/cloud-api-v6/servers/start-an-enterprise-server-by-id)) or with ionosctl ([<mark style="color:blue;">server stop</mark>](https://docs.ionos.com/cli-ionosctl/subcommands/compute-engine/server/stop), [<mark style="color:blue;">server start</mark>](https://docs.ionos.com/cli-ionosctl/subcommands/compute-engine/server/start)).

If you have access only to the operating system and not to the DCD or the API, restarting the operating system already removes the performance penalty of active VBS and HVCI. A stop and start of the VM also clears the nested virtualization state on the hypervisor that an operating system restart leaves behind.
{% endhint %}
{% endstep %}
{% endstepper %}

{% hint style="success" %}
**Result:** VBS and HVCI are deactivated.
{% endhint %}

## Verification

Use one of the following methods to check whether VBS is deactivated.

{% tabs %}
{% tab title="Using System Information" %}
Run `msinfo32.exe` and check the **Virtualization-based security** row in the system summary.

Before the workaround, the row shows **Running**:

![The msinfo32 system summary shows VBS as Running](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-a7e98e628ff5f7c1c833ebc8fa6fb744be31e087%2Fvbs-hvci-msinfo32-before.png?alt=media)

After the workaround, the row shows **Not enabled**:

![The msinfo32 system summary shows VBS as Not enabled](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-500a1cd890c74059e01a0a4cc80dafdc68db431e%2Fvbs-hvci-msinfo32-after.png?alt=media)
{% endtab %}

{% tab title="Using PowerShell" %}

```powershell
(Get-CimInstance -ClassName Win32_DeviceGuard -Namespace root\Microsoft\Windows\DeviceGuard).VirtualizationBasedSecurityStatus
```

The command returns `0` if VBS is not enabled, `1` if VBS is enabled but not running, and `2` if VBS is running. If VBS and HVCI are deactivated, the command returns `0`.
{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Note:** The workaround does not affect other security features such as firmware startup protection or TPM 2.0. All steps are fully reversible.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ionos.com/cloud/backup-and-storage/images-snapshots/public-images/deactivate-vbs-hvci-microsoft-windows-server-2025.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
