Skip to content

Commit 3a0c93d

Browse files
author
Simonx Xu
authored
Merge pull request #9650 from v-lianna/CI_6890
AB#6890 Create hyper-v-nested-virtualization.md
2 parents 7be3aac + 7684ee7 commit 3a0c93d

File tree

2 files changed

+288
-0
lines changed

2 files changed

+288
-0
lines changed
Lines changed: 284 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,284 @@
1+
---
2+
title: Hyper-V Nested Virtualization Troubleshooting Guide
3+
description: Provides a structured approach for troubleshooting nested virtualization issues in physical and cloud-based environments.
4+
ms.date: 09/10/2025
5+
manager: dcscontentpm
6+
audience: itpro
7+
ms.topic: troubleshooting
8+
ms.reviewer: kaushika, warrenw, v-lianna
9+
ms.custom:
10+
- sap:clustering and high availability\nested virtualization
11+
- pcy:WinComm Storage High Avail
12+
---
13+
# Troubleshooting guide: Hyper-V nested virtualization
14+
15+
Nested virtualization allows you to run Hyper-V (or other hypervisors) within a virtual machine, enabling powerful development, testing, and learning scenarios where you need virtual machines inside other VMs. This is typically available in Windows Server 2016 or later versions, Windows 10 or Windows 11 Pro and Enterprise (with Hyper-V), and supported Azure virtual machine series. Nested virtualization introduces complexity—networking, memory, CPU compatibility, host/guest configuration, and performance often require careful consideration. This guide provides a structured approach for troubleshooting nested virtualization issues in physical and cloud-based environments.
16+
17+
## Troubleshooting checklist
18+
19+
Before diving into specific issues, follow this checklist to ensure the environment is correctly set up for nested virtualization:
20+
21+
1. Verify host compatibility:
22+
23+
- Host is Windows Server 2016 or later version, Windows 10 or Windows 11 Pro or Enterprise.
24+
- Host CPU supports VT-x (Intel) or AMD-V (AMD); hardware virtualization enabled in BIOS/UEFI.
25+
26+
1. Confirm guest VM settings:
27+
28+
- Guest VM is Generation 2.
29+
- Guest VM running compatible OS (Windows Server 2016, or later version, Windows 10, Windows 11, or later version, select Linux with Hyper-V support).
30+
31+
1. Enable nested virtualization:
32+
33+
- For Hyper-V, set via PowerShell:
34+
35+
```powershell
36+
Set-VMProcessor -VMName "<VMName>" -ExposeVirtualizationExtensions $true
37+
```
38+
39+
- VM must be powered off.
40+
41+
1. CPU, memory, and resource allocation:
42+
43+
- Assign at least two virtual CPUs to nested VM.
44+
- Sufficient memory assigned (recommended ≥ 4GB for the VM hosting nested VMs).
45+
46+
1. Network configuration:
47+
48+
- Use an "External" virtual switch for the guest VM to enable outbound access.
49+
- Ensure NAT/port forwarding is correctly set up if needed.
50+
51+
1. Update host and guest:
52+
53+
- Fully patch and update Windows OS for host and guest.
54+
- Use the latest Hyper-V Integration Services and drivers.
55+
56+
1. Check security and policy:
57+
58+
- Credential Guard and Device Guard might block nested virtualization.
59+
- No conflicting Group Policies or anti-virus blocking Hyper-V processes.
60+
61+
Here are common issues and their respective solutions:
62+
63+
## Nested VM can't start Hyper-V role or install other hypervisors
64+
65+
- Errors when enabling or installing Hyper-V in a VM.
66+
- "Hyper-V cannot be installed: The processor does not have required virtualization capabilities" or similar error messages.
67+
- Role installation fails without detailed errors.
68+
69+
### Root causes
70+
71+
- Virtualization extensions not exposed to the guest VM.
72+
- Guest VM isn't Generation 2 or running unsupported OS/version.
73+
- Insufficient resources assigned.
74+
75+
### Resolution
76+
77+
1. Power off the guest VM.
78+
2. Run PowerShell on host:
79+
80+
```powershell
81+
Set-VMProcessor -VMName "<VMName>" -ExposeVirtualizationExtensions $true
82+
```
83+
84+
3. Confirm guest VM is Generation 2 (**Hyper-V Manager** > **VM properties**).
85+
4. Ensure at least two virtual CPUs and ≥4GB RAM allocated.
86+
5. Reboot and retry enabling the Hyper-V role in the guest.
87+
88+
## Network connectivity issues in nested VMs
89+
90+
- Nested VM can't access external network.
91+
- Only internal connectivity works (Host <-> Guest), not Host <-> Physical LAN <-> Nested VM.
92+
- Unreachable IP, failed ping, or application connectivity.
93+
94+
### Root causes
95+
96+
- Virtual switch configured as "Internal" or "Private."
97+
- NAT wrong configuration; port forwarding not set.
98+
- Windows Firewall or security software blocking traffic.
99+
100+
### Resolution
101+
102+
1. In Hyper-V Manager, create or select an "External" virtual switch.
103+
2. Assign the external switch to the nested VM's network adapter.
104+
3. If using NAT with multiple guests, set up port forwarding:
105+
106+
```console
107+
netsh int portproxy add v4tov4 listenaddress=<host IP> listenport=<port> connectaddress=<nested VM IP> connectport=<port>
108+
```
109+
110+
4. Check Windows Firewall and disable or create rules to allow traffic.
111+
5. Restart VMs if network configuration changes.
112+
113+
## Performance degradation in nested virtualization
114+
115+
- Nested VM is slow, lags, or fails to install operating systems and roles.
116+
- Disk and network I/O bottlenecks.
117+
- High resource usage on host.
118+
119+
### Root causes
120+
121+
- Under-provisioned resources—CPU, RAM, disk.
122+
- Overcommitted host resources.
123+
- Outdated host/hypervisor drivers.
124+
- Bandwidth limitations due to virtual switch configuration.
125+
126+
### Resolution
127+
128+
1. Increase guest VM vCPUs (minimum 2; recommended ≥4 for heavy workloads).
129+
2. Assign sufficient RAM (recommended ≥4GB for guest; ≥8GB for host).
130+
3. Use fixed size VHDs instead of dynamically expanding for better performance.
131+
4. Ensure SSD-based storage for host and guest disks.
132+
5. Update host and guest integration services and drivers.
133+
6. Avoid running resource-intensive applications in other host VMs.
134+
135+
## Nested Hyper-V installation or operation blocked by security policies
136+
137+
- Hyper-V role installation blocked.
138+
- Errors referencing "Credential Guard" or "Device Guard."
139+
- "Virtualization-based security is enabled. Nested virtualization is not supported."
140+
141+
### Root causes
142+
143+
- VBS, Credential Guard, Device Guard active in host or guest.
144+
- Group Policies or registry settings prevent virtualization extensions.
145+
146+
### Resolution
147+
148+
1. Disable Credential Guard/Device Guard in host and guest.
149+
150+
- Use Group Policy Editor (**gpedit.msc**) > **Computer Configuration** > **Administrative Templates** > **System** > **Device Guard**.
151+
1. If controlled by registry:
152+
153+
```console
154+
reg delete HKLM\System\CurrentControlSet\Control\DeviceGuard /v EnableVirtualizationBasedSecurity /f
155+
reg delete HKLM\System\CurrentControlSet\Control\DeviceGuard /v RequirePlatformSecurityFeatures /f
156+
```
157+
158+
1. Reboot the VM.
159+
1. Verify with **Msinfo32.exe** that VBS is "Not enabled".
160+
161+
## NAT and port forwarding issues
162+
163+
- Unable to reach nested VMs from external networks.
164+
- "Process cannot access the file because it is being used by another process" when starting NAT driver.
165+
- WinNAT service fails to start.
166+
167+
### Root causes
168+
169+
- Incorrect static mapping of ports.
170+
- Conflicting NAT configuration.
171+
- WinNAT file lock.
172+
173+
### Resolution
174+
175+
1. Remove incorrect NAT configurations:
176+
177+
```console
178+
netsh nat delete <incorrect mapping>
179+
```
180+
181+
2. Restart host, and ensure NAT/WinNAT service isn't locked.
182+
3. Reconfigure NAT/port proxy for required connectivity:
183+
184+
```console
185+
netsh int portproxy add v4tov4 listenaddress=<host IP> listenport=<port> connectaddress=<nested VM IP> connectport=<port>
186+
```
187+
188+
4. Test connectivity from external host using ping and application ports.
189+
190+
## Snapshot/Checkpoint and differencing disk issues
191+
192+
- Snapshots disappear or can't be merged.
193+
- Merge operation fails with "The system cannot find the file specified (0x80070002)" or "The chain of virtual hard disks is broken (0xC03A000D)."
194+
195+
### Root causes
196+
197+
- Parent VHD file moved or deleted.
198+
- Hardware failure.
199+
- Broken differencing disk chain.
200+
201+
### Resolution
202+
203+
1. Ensure all VHD/AVHDX files are in their original locations.
204+
2. Use PowerShell to check chain and merge:
205+
206+
```powershell
207+
Get-VHD -Path <AVHDX path> | fl \*
208+
Merge-VHD -Path <child AVHDX> -DestinationPath <parent VHD>
209+
```
210+
211+
3. If data recovery is needed, restore the parent disk from backup, and then retry the merge.
212+
213+
## VM resource changes not recognized (for example, RAM increase)
214+
215+
- VM doesn't detect increased RAM after configuration.
216+
- No error, but resource remains at previous allocation.
217+
218+
### Root causes
219+
220+
- Configuration not applied/committed while VM was off.
221+
- Platform limitations (nested, cluster, or hot-add not supported).
222+
223+
### Resolution
224+
225+
1. Power off VM before resizing resources.
226+
2. Use **Hyper-V Manager** > **Edit VM settings** > **Increase RAM**.
227+
3. Start VM and verify resource allocation in guest OS.
228+
4. Review documentation for hot-add support in nested scenarios.
229+
230+
## Data collection
231+
232+
Gather the following data for troubleshooting and escalation:
233+
234+
- System information:
235+
236+
- Host and guest OS versions, build numbers.
237+
- CPU type, RAM configuration.
238+
- Virtual machine configuration:
239+
240+
- Hyper-V Manager details (generation, CPUs, RAM, disks).
241+
- Virtual switch/network setup.
242+
- Event logs:
243+
244+
- Hyper-V logs: VMMS, Worker logs, System, Application.
245+
- Cluster logs if in a failover setup.
246+
- PowerShell output:
247+
248+
```powershell
249+
Get-VM -Name <VMName> | fl \*
250+
Get-VMProcessor -VMName <VMName>
251+
Get-VHD -Path <AVHDX path> | fl \*
252+
```
253+
254+
- Network traces:
255+
256+
```console
257+
netsh trace start capture=yes scenario=Virtualization,NetConnection tracefile=<path>
258+
netsh trace start capture=yes scenario=NetConnection level=5 maxsize=1024 tracefile=<path>
259+
```
260+
261+
- Screenshots/Error messages:
262+
263+
Installation errors, role addition failure messages, device manager status.
264+
- Procmon trace (for install/role activation issues).
265+
- MiniDump files (if host or VM crashes).
266+
267+
## Common issues quick reference table
268+
269+
| Issue | Symptoms/Errors | Root cause | Resolution steps |
270+
| --- | --- | --- | --- |
271+
| Nested VM can't start Hyper-V | Role installation fails; CPU extension error | Extensions not exposed; Gen1 VM | Power off VM; `Set-VMProcessor -ExposeVirtualizationExtensions $true`; use Gen2 VM; assign ≥2 vCPUs. |
272+
| Network connectivity issues | No internet/LAN in nested VM | Internal switch/NAT misconfiguration | Use external switch; correct NAT configuration; allow firewall rules. |
273+
| Slow performance | Lag; high resource usage | Under-provisioned resources | Increase vCPUs/RAM; use SSDs; update drivers. |
274+
| Role or Hyper-V installation blocked by security | Policy or VBS/Credential Guard errors | Device/Credential Guard enabled | Disable VBS/Credential Guard; reboot. |
275+
| NAT/port forwarding fails | Can't connect to nested VM; WinNAT errors | Wrong mapping/service lock | Remove/re-add NAT configuration; restart host; `netsh` `portproxy` commands. |
276+
| Snapshot/disk chain broken | Merge fails; file not found; broken chain errors | Parent disk moved/deleted | Restore parent VHD; `Get-VHD`/`Merge-VHD` PowerShell cmdlets. |
277+
| VM doesn't recognize increased RAM | No error; allocation unchanged | Setting not saved/applied, platform | Power off VM; edit settings; start VM; check host/cluster/nested support. |
278+
279+
Nested virtualization is a powerful but complex feature that often encounters resource, networking, configuration, and security challenges. Troubleshooting starts with verifying correct setup and continues by addressing common failure modes including role install problems, networking misconfiguration, storage chain errors, and blocked installations due to security policies. Careful data collection, step-by-step diagnosis, and understanding of platform limitations are essential for stable operation. For persistent issues or unsupported scenarios, engaging with platform support or escalation might be required.
280+
281+
## References
282+
283+
- [What is Nested Virtualization](/virtualization/hyper-v-on-windows/user-guide/nested-virtualization)
284+
- [Set-VMProcessor](/powershell/module/hyper-v/set-vmprocessor)

support/windows-server/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,6 +1140,10 @@ items:
11401140
items:
11411141
- name: Error 0x80090327 when adding a node to a cluster
11421142
href: ./high-availability/error-0x80090327-adding-node-to-cluster.md
1143+
- name: Nested virtualization
1144+
items:
1145+
- name: 'Troubleshooting guide: Hyper-V nested virtualization'
1146+
href: ./high-availability/hyper-v-nested-virtualization.md
11431147
- name: Node removed from the cluster
11441148
items:
11451149
- name: Cluster IP address resources fail on both nodes when one node disconnects

0 commit comments

Comments
 (0)