Level 9 · Chapter 3
VBS vs HVCI (Memory Integrity) Explained
VBS is the hypervisor-isolated secure world; HVCI (Memory integrity) runs inside it to vet kernel code. How they differ, how to check them, and what they cost.
VBS (Virtualization-Based Security) is the platform: Windows uses the Hyper-V hypervisor to create an isolated environment, a higher Virtual Trust Level, that even a fully compromised Windows kernel cannot read or modify. HVCI (Hypervisor-protected Code Integrity), which Windows Security calls Memory integrity, is one feature built on that platform: it moves kernel-mode code-integrity decisions into the isolated environment so that only validated code can ever execute in kernel mode.
So "VBS vs HVCI" isn't a choice between two alternatives. VBS can run without HVCI, but HVCI cannot run without VBS.
Hyper-V & partitions described virtualization's original purpose: running separate guest operating systems. This chapter covers a very different use of the same hypervisor, where the thing being isolated is not a guest OS but a hardened slice of the machine you're already using.
VBS vs HVCI: what each one is
The common thread: in both cases the policy is enforced from underneath the kernel. Malware that gets kernel-mode code execution can patch any kernel data structure it likes, but it cannot change what the hypervisor enforces on its behalf.
VTL0 and VTL1: the secure kernel split
When VBS is on, the hypervisor boots first and divides the machine into two Virtual Trust Levels:
VTL0 (normal world) VTL1 (secure world)
user ┌──────────────────────────┐ ┌──────────────────────────────┐
mode │ apps, services, lsass.exe│ │ trustlets (Isolated User │
│ │ │ Mode), e.g. LsaIso.exe │
├──────────────────────────┤ ├──────────────────────────────┤
kernel │ ntoskrnl.exe + drivers │ │ securekernel.exe + kernel- │
mode │ (all kernel code runs │ │ mode code-integrity checks │
│ here) │ │ (HVCI's decisions) │
└────────────┬─────────────┘ └──────────────┬───────────────┘
└──────────── Windows hypervisor ─┘
enforces second-level page tables: VTL0 cannot
map VTL1 memory or change its own page permissions
- VTL0 is ordinary Windows:
ntoskrnl.exe, every driver, every process. All kernel code, including drivers, still executes here. - VTL1 runs a small separate kernel,
securekernel.exe, and a handful of trustlets in Isolated User Mode. VTL0, even at kernel privilege, cannot read VTL1 memory. - The hypervisor is what makes that true. It controls the second-level address translation (SLAT) tables that sit underneath VTL0's own page tables, so a page VTL0 "owns" in its page tables can still be non-readable, non-writable or non-executable at the hypervisor level.
That last point is the whole trick. The kernel's own page tables are no longer the final word on memory permissions.
Memory integrity in Windows Security is HVCI
Memory integrity, HVCI, hypervisor-enforced code integrity and the old Device Guard name all describe the same feature. Device Guard survives only as the name of the Group Policy folder and registry key where the settings live.
What it does, concretely:
- Kernel-mode code integrity (the check that a driver image is signed and unmodified) runs in VTL1 instead of in the VTL0 kernel it is protecting.
- Only after VTL1 validates a code page does the hypervisor mark it executable in the SLAT tables. Validated code pages are not writable, and writable kernel memory is not executable.
- A kernel exploit that writes shellcode into pool memory, or patches an existing driver's code, finds the result is non-executable no matter what it does to the VTL0 page tables.
Microsoft's documentation also notes that memory integrity protects the kernel-mode Control Flow Guard bitmap from modification and, on supported versions, enforces the Microsoft vulnerable driver blocklist. Memory integrity is enabled by default on many new Windows 11 devices that meet the hardware and driver requirements; on upgraded or older machines, check rather than assume.
Credential Guard: the other headline VBS feature
Credential Guard is the feature most people meet VBS through. It moves the secrets LSASS would otherwise hold (NTLM hashes, Kerberos ticket-granting tickets) into a VTL1 trustlet, LsaIso.exe. The normal lsass.exe in VTL0 still handles authentication, but it asks the isolated process to perform operations on the secrets instead of holding them itself.
The practical consequence: malware with SYSTEM and kernel-mode code execution in VTL0, traditionally enough to dump credentials from LSASS memory, can no longer read them, because the boundary is enforced by the hypervisor, not by anything the compromised kernel controls. HVCI and Credential Guard are independent: either can run without the other, both need VBS.
How to check if VBS and HVCI are running
System Information. Run msinfo32 and look at the bottom of System Summary:
- Virtualization-based security: Running, Enabled but not running, or Not enabled.
- Virtualization-based security Services Running: lists Hypervisor enforced Code Integrity when HVCI is active, and Credential Guard when that is.
- Virtualization-based security Required / Available Security Properties: what the configuration demands and what the hardware offers.
PowerShell (elevated). The Win32_DeviceGuard class gives the same answer in a scriptable form:
Get-CimInstance -ClassName Win32_DeviceGuard -Namespace root\Microsoft\Windows\DeviceGuard |
Select-Object VirtualizationBasedSecurityStatus, SecurityServicesConfigured,
SecurityServicesRunning, AvailableSecurityProperties, RequiredSecurityProperties
A machine where SecurityServicesConfigured contains 2 but SecurityServicesRunning doesn't has memory integrity configured but not active, usually waiting for a reboot or blocked by a driver.
Registry. The configuration (not the live state) lives under HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard:
Every change takes effect only after a restart, because the hypervisor and secure kernel are set up at boot. Choosing RequirePlatformSecurityFeatures = 3 on hardware without an IOMMU is a classic reason for "enabled but not running": VBS then refuses to start at all.
Driver compatibility and performance impact
Drivers. HVCI's rule that kernel memory is never both writable and executable breaks drivers that rely on doing exactly that: allocating executable pool, shipping image sections marked both writable and executable, or patching their own code at runtime. When such a driver is installed, Windows Security refuses to turn memory integrity on and lists it under Review incompatible drivers; the fix is an updated driver from the vendor, or removing the hardware and software that installed it. Low-level utilities that install their own kernel driver (hardware monitoring, overclocking, older anti-cheat) are the usual suspects. If enabling HVCI leaves a machine unable to boot, Microsoft's documented recovery is to boot into Windows RE and set HypervisorEnforcedCodeIntegrity\Enabled to 0. With a UEFI lock, that also requires disabling Secure Boot first.
Performance. The cost depends on the CPU. Intel processors from Kaby Lake onward have Mode-Based Execution Control (MBEC) and AMD processors from Zen 2 onward have Guest Mode Execute Trap (GMET), which let the hypervisor enforce separate execute permissions for kernel and user mode in hardware. Older processors fall back to an emulation called Restricted User Mode, which costs noticeably more. AvailableSecurityProperties containing 7 tells you the hardware feature is present, so check that before blaming HVCI for a slowdown.
A common mistake
The name "Virtualization-Based Security" leads a lot of people to assume it means "your desktop is running inside a VM", the same misreading Virtualization already flagged for Hyper-V generally. With VBS on, your everyday Windows session does run above the hypervisor, but it is not a guest OS in any useful sense: it still owns the hardware, its drivers still talk to real devices, and there is no second copy of Windows. What the hypervisor adds is a small, separate, isolated environment alongside that session, holding secrets and enforcing policy that even a fully compromised normal-world kernel can't touch.
The second mistake is treating "turn off VBS" and "turn off memory integrity" as the same switch. Disabling memory integrity leaves VBS (and Credential Guard, if configured) running; msinfo32 will still say Virtualization-based security: Running.
Where this connects
- Hyper-V & partitions explains the partition isolation and nested page tables VBS reuses.
- LSASS, SAM, and local security policy is exactly what Credential Guard protects when VBS is enabled.
- Kernel Patch Protection (PatchGuard) & HyperGuard covers HyperGuard, which uses the same VTL1 vantage point to watch critical kernel state.
- Secure Boot & measured boot is the boot-time chain of trust VBS can require before it will start.
- Kernel mechanisms covers the IRQL and execution-context rules that still govern all kernel code running in VTL0.
Mental model
The hypervisor enforces extra boundaries: isolated VTLs, secure kernels, and code integrity policies.
Key terms
- VBS
- Virtualization-Based Security; hypervisor-enforced security features.
- HVCI
- Hypervisor-protected Code Integrity; restricts executable kernel pages.