Skip to content

Commit 15fd418

Browse files
committed
updates
1 parent 56d9450 commit 15fd418

2 files changed

Lines changed: 132 additions & 102 deletions

File tree

support/windows-server/high-availability/hyper-v-nested-virtualization.md

Lines changed: 128 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -10,249 +10,275 @@ ms.custom:
1010
- sap:clustering and high availability\nested virtualization
1111
- pcy:WinComm Storage High Avail
1212
---
13-
# Troubleshooting Guide: Hyper-V Nested Virtualization
14-
15-
## Introduction
13+
# Troubleshooting guide: Hyper-V nested virtualization
1614

1715
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 on Windows Server 2016 or later, Windows 10/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.
1816

1917
## Troubleshooting Checklist
2018

2119
Before diving into specific issues, follow this checklist to ensure the environment is correctly set up for nested virtualization:
22-
1. **Verify Host Compatibility** - Host is Windows Server 2016+ or Windows 10/11 Pro/Enterprise.
20+
21+
1. Verify host compatibility
22+
23+
- Host is Windows Server 2016 and later versions, or Windows 10/11 Pro/Enterprise.
2324
- Host CPU supports VT-x (Intel) or AMD-V (AMD); Hardware virtualization enabled in BIOS/UEFI.
24-
2. **Confirm Guest VM Settings** - Guest VM is Generation 2.
25-
- Guest VM running compatible OS (Windows Server 2016+, Windows 10/11+, select Linux with Hyper-V support).
26-
3. **Enable Nested Virtualization** - For Hyper-V, set via PowerShell:
2725

28-
```plaintext
29-
Set-VMProcessor -VMName "<VMName>" -ExposeVirtualizationExtensions $true
30-
```
26+
1. Confirm guest VM settings
27+
28+
- Guest VM is Generation 2.
29+
- Guest VM running compatible OS (Windows Server 2016, and later versions, Windows 10/11, and later versions, select Linux with Hyper-V support).
30+
31+
1. Enable nested virtualization
3132

32-
**Copy**
33-
- VM must be powered off.
34-
4. **CPU, Memory & Resource Allocation** - Assign at least two virtual CPUs to nested VM.
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.
3544
- Sufficient memory assigned (recommended ≥ 4GB for the VM hosting nested VMs).
36-
5. **Network Configuration** - Use an "External" virtual switch for the guest VM to enable outbound access.
45+
46+
1. Network configuration
47+
48+
- Use an "External" virtual switch for the guest VM to enable outbound access.
3749
- Ensure NAT/port forwarding is correctly set up if needed.
38-
6. **Update Host & Guest** - Fully patch and update Windows OS for host and guest.
50+
51+
1. Update host and guest
52+
53+
- Fully patch and update Windows OS for host and guest.
3954
- Use latest Hyper-V Integration Services and drivers.
40-
7. **Check Security & Policy** - Credential Guard and Device Guard may block nested virtualization.
55+
56+
1. Check security and policy
57+
58+
- Credential Guard and Device Guard might block nested virtualization.
4159
- No conflicting Group Policies or anti-virus blocking Hyper-V processes.
4260
43-
## Common Issues and their Respective Solutions
61+
Here are common issues and their respective solutions:
4462
45-
### 1. **Nested VM Cannot Start Hyper-V Role or Install Other Hypervisors**
63+
## Nested VM can't start Hyper-V role or install other hypervisors
4664
47-
**Symptoms:**
4865
- Errors when enabling or installing Hyper-V in a VM.
4966
- "Hyper-V cannot be installed: The processor does not have required virtualization capabilities" or similar.
5067
- Role installation fails without detailed errors.
5168
52-
**Root Causes:**
69+
### Root causes
70+
5371
- Virtualization extensions not exposed to the guest VM.
54-
- Guest VM is not Generation 2 or running unsupported OS/version.
72+
- Guest VM isn't Generation 2 or running unsupported OS/version.
5573
- Insufficient resources assigned.
5674
57-
**Resolution:**
75+
### Resolution
76+
5877
1. Power off the guest VM.
5978
2. Run PowerShell on host:
6079
61-
```plaintext
80+
```powershell
6281
Set-VMProcessor -VMName "<VMName>" -ExposeVirtualizationExtensions $true
6382
```
6483
65-
**Copy**
66-
3. Confirm guest VM is Generation 2 (Hyper-V Manager > VM properties).
84+
3. Confirm guest VM is Generation 2 (**Hyper-V Manager** > **VM properties**).
6785
4. Ensure at least two virtual CPUs and ≥4GB RAM allocated.
6886
5. Reboot and retry enabling the Hyper-V role in the guest.
6987
70-
### 2. **Network Connectivity Issues in Nested VMs**
88+
## Network connectivity issues in nested VMs
7189
72-
**Symptoms:**
73-
- Nested VM cannot access external network.
90+
- Nested VM can't access external network.
7491
- Only internal connectivity works (Host <-> Guest), not Host <-> Physical LAN <-> Nested VM.
7592
- Unreachable IP, failed ping, or application connectivity.
7693
77-
**Root Causes:**
78-
- Virtual Switch configured as "Internal" or "Private".
94+
### Root causes
95+
96+
- Virtual switch configured as "Internal" or "Private."
7997
- NAT wrong configuration; port forwarding not set.
8098
- Windows Firewall or security software blocking traffic.
8199
82-
**Resolution:**
100+
### Resolution
101+
83102
1. In Hyper-V Manager, create or select an "External" virtual switch.
84-
2. Assign the external switch to the nested VMs network adapter.
103+
2. Assign the external switch to the nested VM's network adapter.
85104
3. If using NAT with multiple guests, set up port forwarding:
86105
87-
```plaintext
106+
```console
88107
netsh int portproxy add v4tov4 listenaddress=<host IP> listenport=<port> connectaddress=<nested VM IP> connectport=<port>
89108
```
90109
91-
**Copy**
92110
4. Check Windows Firewall and disable or create rules to allow traffic.
93111
5. Restart VMs if network configuration changes.
94112
95-
### 3. **Performance Degradation in Nested Virtualization**
113+
## Performance degradation in nested virtualization
96114
97-
**Symptoms:**
98115
- Nested VM is slow, lags, or fails to install operating systems and roles.
99116
- Disk and network I/O bottlenecks.
100117
- High resource usage on host.
101118
102-
**Root Causes:**
119+
### Root causes
120+
103121
- Under-provisioned resources—CPU, RAM, disk.
104122
- Overcommitted host resources.
105123
- Outdated host/hypervisor drivers.
106124
- Bandwidth limitations due to virtual switch configuration.
107125
108-
**Resolution:**
126+
### Resolution
127+
109128
1. Increase guest VM vCPUs (minimum 2; recommended ≥4 for heavy workloads).
110129
2. Assign sufficient RAM (recommended ≥4GB for guest; ≥8GB for host).
111130
3. Use fixed size VHDs instead of dynamically expanding for better performance.
112131
4. Ensure SSD-based storage for host and guest disks.
113132
5. Update host and guest integration services and drivers.
114133
6. Avoid running resource-intensive applications in other host VMs.
115134
116-
### 4. **Nested Hyper-V Installation or Operation Blocked by Security Policies**
135+
## Nested Hyper-V installation or operation blocked by security policies
117136
118-
**Symptoms:**
119137
- Hyper-V role installation blocked.
120-
- Errors referencing "Credential Guard" or "Device Guard".
138+
- Errors referencing "Credential Guard" or "Device Guard."
121139
- "Virtualization-based security is enabled. Nested virtualization is not supported."
122140
123-
**Root Causes:**
141+
### Root causes
142+
124143
- VBS, Credential Guard, Device Guard active in host or guest.
125144
- Group Policies or registry settings prevent virtualization extensions.
126145
127-
**Resolution:**
128-
1. Disable Credential Guard/Device Guard in host and guest. - Use Group Policy Editor (gpedit.msc) > Computer Configuration > Administrative Templates > System > Device Guard.
129-
2. If controlled by registry:
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:
130152
131-
```plaintext
153+
```console
132154
reg delete HKLM\System\CurrentControlSet\Control\DeviceGuard /v EnableVirtualizationBasedSecurity /f
133155
reg delete HKLM\System\CurrentControlSet\Control\DeviceGuard /v RequirePlatformSecurityFeatures /f
134156
```
135157
136-
**Copy**
137-
3. Reboot the VM.
138-
4. Verify with msinfo32 that VBS is "Not enabled".
158+
1. Reboot the VM.
159+
1. Verify with **Msinfo32.exe** that VBS is "Not enabled".
139160
140-
### 5. **NAT & Port Forwarding Problems**
161+
## NAT and port forwarding issues
141162
142-
**Symptoms:**
143163
- Unable to reach nested VMs from external networks.
144-
- "Process cannot access the file because it is being used by another process" when starting NAT Driver.
164+
- "Process cannot access the file because it is being used by another process" when starting NAT driver.
145165
- WinNAT service fails to start.
146166
147-
**Root Causes:**
167+
### Root causes
168+
148169
- Incorrect static mapping of ports.
149170
- Conflicting NAT configuration.
150171
- WinNAT file lock.
151172
152-
**Resolution:**
173+
### Resolution
174+
153175
1. Remove incorrect NAT configurations:
154176
155-
```plaintext
177+
```console
156178
netsh nat delete <incorrect mapping>
157179
```
158180
159-
**Copy**
160-
2. Restart host, ensure NAT/WinNAT service is not locked.
181+
2. Restart host, ensure NAT/WinNAT service isn't locked.
161182
3. Reconfigure NAT/port proxy for required connectivity:
162183
163-
```plaintext
184+
```console
164185
netsh int portproxy add v4tov4 listenaddress=<host IP> listenport=<port> connectaddress=<nested VM IP> connectport=<port>
165186
```
166187
167-
**Copy**
168188
4. Test connectivity from external host using ping and application ports.
169189
170-
### 6. **Snapshot/Checkpoint and Differencing Disk Issues**
190+
## Snapshot/Checkpoint and differencing disk issues
191+
192+
- Snapshots disappear or can't be merged.
193+
- Merge operation fails: "The system cannot find the file specified (0x80070002)" or "The chain of virtual hard disks is broken (0xC03A000D)."
171194
172-
**Symptoms:**
173-
- Snapshots disappear or cannot be merged.
174-
- Merge operation fails: "The system cannot find the file specified (0x80070002)" or "The chain of virtual hard disks is broken (0xC03A000D)".
195+
### Root causes
175196
176-
**Root Causes:**
177197
- Parent VHD file moved or deleted.
178198
- Hardware failure.
179199
- Broken differencing disk chain.
180200
181-
**Resolution:**
201+
### Resolution
202+
182203
1. Ensure all VHD/AVHDX files are in original location.
183204
2. Use PowerShell to check chain and merge:
184205
185-
```plaintext
206+
```powershell
186207
Get-VHD -Path <AVHDX path> | fl \*
187208
Merge-VHD -Path <child AVHDX> -DestinationPath <parent VHD>
188209
```
189210
190-
**Copy**
191211
3. If data recovery needed, restore parent disk from backup, then retry merge.
192212
193-
### 7. **VM Resource Changes Not Recognized (e.g., RAM Increase)**
213+
## VM resource changes not recognized (for example, RAM increase)
194214
195-
**Symptoms:**
196-
- VM does not detect increased RAM after configuration.
215+
- VM doesn't detect increased RAM after configuration.
197216
- No error, but resource remains at previous allocation.
198217
199-
**Root Causes:**
218+
### Root causes
219+
200220
- Configuration not applied/committed while VM was off.
201221
- Platform limitations (nested, cluster, or hot-add not supported).
202222
203-
**Resolution:**
223+
### Resolution
224+
204225
1. Power off VM before resizing resources.
205-
2. Use Hyper-V Manager > Edit VM settings > Increase RAM.
226+
2. Use **Hyper-V Manager** > **Edit VM settings** > **Increase RAM**.
206227
3. Start VM; verify resource allocation in guest OS.
207228
4. Review documentation for hot-add support in nested scenarios.
208229
209-
## Data Collection
230+
## Data collection
210231
211232
Gather the following data for troubleshooting and escalation:
212-
- **System Information**: - Host and guest OS versions, build numbers.
213-
- CPU type, RAM configuration.
214-
- **Virtual Machine Configuration**: - Hyper-V Manager details (generation, CPUs, RAM, disks).
215-
- Virtual switch/network setup.
216-
- **Event Logs**: - Hyper-V logs: VMMS, Worker logs, System, Application.
217-
- Cluster logs if in a failover setup.
218-
- **PowerShell Output**:
219-
220-
```plaintext
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
221249
Get-VM -Name <VMName> | fl \*
222250
Get-VMProcessor -VMName <VMName>
223251
Get-VHD -Path <AVHDX path> | fl \*
224252
```
225253
226-
**Copy**
227-
- **Network Traces**:
254+
- Network traces:
228255
229-
```plaintext
256+
```console
230257
netsh trace start capture=yes scenario=Virtualization,NetConnection tracefile=<path>
231258
netsh trace start capture=yes scenario=NetConnection level=5 maxsize=1024 tracefile=<path>
232259
```
233260
234-
**Copy**
235-
- **Screenshots/Error Messages**: - Installation errors, role addition failure messages, device manager status.
236-
- **Procmon Trace** (for install/role activation issues).
237-
- **MiniDump Files** (if host or VM crashes).
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).
238266
239-
## Common Issues Quick Reference Table
267+
## Common issues quick reference table
240268
241-
| Issue | Symptoms/Errors | Root Cause | Resolution Steps |
269+
| Issue | Symptoms/Errors | Root cause | Resolution steps |
242270
| --- | --- | --- | --- |
243-
| Nested VM can't start Hyper-V | Role install fails; CPU extension error | Extensions not exposed; Gen1 VM | Power off VM; Set-VMProcessor -ExposeVirtualizationExtensions $true; Use Gen2 VM; Assign ≥2 vCPUs |
271+
| Nested VM can't start Hyper-V | Role install fails; CPU extension error | Extensions not exposed; Gen1 VM | Power off VM; `Set-VMProcessor -ExposeVirtualizationExtensions $true`; Use Gen2 VM; Assign ≥2 vCPUs |
244272
| Network connectivity issues | No internet/LAN in nested VM | Internal switch/NAT misconfig | Use external switch; Correct NAT config; Allow firewall rules |
245273
| Slow performance | Lag; high resource usage | Under-provisioned resources | Increase vCPUs/RAM; Use SSDs; Update drivers |
246-
| Role or Hyper-V install blocked by security | Policy or VBS/Credential Guard errors | Device/Credential Guard enabled | Disable VBS/Credential Guard; Reboot |
247-
| NAT/port forwarding fails | Cannot connect to nested VM; WinNAT errors | Wrong mapping/service lock | Remove/re-add NAT config; Restart host; netsh portproxy commands |
248-
| Snapshot/disk chain broken | Merge fails; file not found; broken chain errors | Parent disk moved/deleted | Restore parent VHD; Get-VHD/Merge-VHD PowerShell commands |
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 config; 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 |
249277
| 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 |
250278
251-
## References
252-
- [<u>Microsoft Learn: Nested Virtualization</u>](https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/nested-virtualization)
253-
- [<u>Configure Hyper-V Nested Virtualization</u>](https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/nested-virtualization)
254-
- [<u>Set-VMProcessor Documentation</u>](https://learn.microsoft.com/en-us/powershell/module/hyper-v/set-vmprocessor)
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.
255280
256-
## Summary
281+
## References
257282
258-
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 may be required.
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)