Skip to content

Commit 4f67913

Browse files
committed
Update linux-virtual-machine-issue-hyper-v.md
1 parent d69f5a3 commit 4f67913

1 file changed

Lines changed: 169 additions & 106 deletions

File tree

support/windows-server/virtualization/linux-virtual-machine-issue-hyper-v.md

Lines changed: 169 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -10,129 +10,192 @@ ms.custom:
1010
- sap:virtualization and hyper-v\integration components
1111
- pcy:WinComm Storage High Avail
1212
---
13-
# Troubleshooting Linux Virtual Machine Issues on Hyper-V
14-
15-
This article provides a comprehensive guide to diagnosing and resolving common issues encountered when deploying and managing Linux virtual machines (VMs) on Microsoft Hyper-V environments. These issues may include installation challenges, live migration failures, time synchronization problems, missing VM information in management consoles, CPU compatibility discrepancies, and licensing or support inquiries. Resolving these problems is critical for ensuring reliability, compatibility, and optimal performance of Linux workloads in Hyper-V infrastructures.
16-
17-
## Symptoms
18-
19-
### Common issues observed in Linux VMs on Hyper-V
20-
21-
- **VM installation and boot issues**: - Linux OS installations, such as SUSE Linux Enterprise Server (SLES) 15 SP5, stall or fail on Generation 2 VMs but succeed on Generation 1.
22-
- Installation menus appear, but the process cannot complete.
23-
- **Live migration and VM state errors**: - Specific Ubuntu-based or vendor-supplied Linux VMs fail to migrate, with errors occurring at 58–68% completion.
24-
- Error message: "Cannot restore this virtual machine because the saved state data cannot be read. Delete the saved state data and then try to start the virtual machine. (0xC0370027)."
25-
- Event ID: **21502** in Hyper-V logs.
26-
- Additional error codes: **0x80048054** and **0x80070037**.
27-
- **Management console and integration data issues**: - Linux VM IP addresses and hostnames are not visible in Hyper-V Manager, System Center Virtual Machine Manager (SCVMM), or other management consoles.
28-
- Integration Services are installed and configured, but data remains missing.
29-
- **Time synchronization issues**: - Linux VM system time does not sync with the Hyper-V host.
30-
- Time zone inconsistencies are observed on the VM’s real-time clock (RTC), causing application time drift.
31-
- **CPU feature/instruction set issues**: - Missing CPU flags, such as sse4_2, inside Linux VMs (cat /proc/cpuinfo).
32-
- Applications or tools fail due to missing CPU instructions.
33-
- **Frequent VM disconnects**: - Linux VMs, especially Red Hat Enterprise Linux (RHEL)-based, frequently disconnect from the Hyper-V console.
34-
- Error messages appear when connecting via Hyper-V Manager.
35-
- **Licensing, support, and feature inquiries**: - Questions about licensing non-Windows operating systems on Windows Server Standard/Datacenter.
36-
- Inquiries about support for legacy Linux versions or Oracle Database workloads.
37-
- Questions regarding Windows Subsystem for Linux 2 (WSL2) support and nested virtualization requirements.
38-
39-
## Cause
40-
41-
### Root causes categorized by issue type
42-
1. **Configuration and compatibility**: - **Generation 2 VM incompatibility**: Certain Linux distributions require specific Generation 2 Hyper-V settings, such as Secure Boot or UEFI, for successful installation.
43-
- **Unsupported Linux versions**: Older or unlisted Linux versions may not work with Hyper-V integration components, leading to missing data or failed operations.
44-
- **Licensing and support gaps**: Documentation may not cover all scenarios for OS/distribution/version compatibility.
45-
2. **Integration services and VM data reporting**: - **Missing or misconfigured Integration Services**: Without proper configuration, Linux Integration Services may fail to report data like IP addresses and hostnames.
46-
- **Console/SCVMM sync issues**: Synchronization delays or database errors may prevent updated VM data from displaying.
47-
3. **File/state corruption and migration failures**: - **Corrupted VMRS files**: Migration issues may arise if VM saved state or runtime files are corrupted.
48-
- **File permission problems**: Insufficient permissions or locked files related to the VM can block migration or restoration.
49-
4. **Guest OS settings and platform differences**: - **RTC and time zone handling**: Hyper-V provides system time to the guest RTC without time zone metadata; guest OS settings determine interpretation.
50-
- **CPU compatibility mode**: Enabling this mode restricts available CPU instructions for the guest, causing feature gaps.
51-
5. **External or unsupported scenarios**: - **Application/OS-specific issues**: Problems within guest OS or applications, like Oracle Database, require vendor support.
52-
- **Feature or environment limitations**: Advanced features, such as nested virtualization and WSL2, need specific VM configurations or hardware.
53-
54-
## Resolution
55-
56-
### 1. Resolving VM installation issues (Generation 2 Linux VMs)
57-
1. **Review VM configuration**: - Disable Secure Boot or set it to use the correct template (e.g., MicrosoftUEFICertificateAuthority for supported Linux distributions).
58-
- Ensure the VM generation matches the Linux distribution’s requirements.
59-
2. **Adjust VM settings**: - Set the firmware to boot from the correct device (DVD or ISO).
13+
# Troubleshoot Linux virtual machine issues on Hyper-V
14+
15+
This article provides a comprehensive guide to diagnosing and resolving common issues in deploying and managing Linux virtual machines (VMs) on Microsoft Hyper-V environments.
16+
17+
These issues might include installation challenges, live migration failures, time synchronization problems, missing VM information in management consoles, central processing unit (CPU) compatibility discrepancies, and licensing or support inquiries. Resolving these issues is critical for ensuring reliability, compatibility, and optimal performance of Linux workloads in Hyper-V infrastructures.
18+
19+
## Common issues observed in Linux VMs on Hyper-V
20+
21+
- VM installation and boot issues:
22+
23+
- Installations of Linux operating system (OS), such as SUSE Linux Enterprise Server (SLES) 15 SP5, stall or fail on Generation 2 VMs but succeed on Generation 1.
24+
- Installation menus appear, but the process fails to complete.
25+
26+
- Live migration and VM state errors:
27+
28+
- Specific Ubuntu-based or vendor-supplied Linux VMs fail to migrate, with errors occurring between 58% and 68% completion.
29+
- Error message: "Cannot restore this virtual machine because the saved state data can't be read. Delete the saved state data and then try to start the virtual machine. (0xC0370027)."
30+
- Event ID 21502 in Hyper-V logs.
31+
- Additional error codes 0x80048054 and 0x80070037.
32+
33+
- Management console and integration data issues:
34+
35+
- Linux VM IP addresses and hostnames aren't visible in Hyper-V Manager, System Center Virtual Machine Manager (SCVMM), or other management consoles.
36+
- Integration services are installed and configured, but the data remains missing.
37+
38+
- Time synchronization issues:
39+
40+
- Linux VM system time doesn't synchronize with the Hyper-V host.
41+
- Time zone inconsistencies are observed on the VM's real-time clock (RTC), causing application time drift.
42+
43+
- CPU feature/instruction set issues:
44+
45+
- Missing CPU flags, such as `sse4_2`, inside Linux VMs (`cat /proc/cpuinfo`).
46+
- Applications or tools fail due to missing CPU instructions.
47+
48+
- Frequent VM disconnects:
49+
50+
- Linux VMs, especially Red Hat Enterprise Linux (RHEL)-based, frequently disconnect from the Hyper-V console.
51+
- Error messages appear when connecting via Hyper-V Manager.
52+
53+
- Licensing, support, and feature inquiries:
54+
55+
- Questions about licensing non-Windows operating systems on Windows Server Standard/Datacenter.
56+
- Inquiries about support for legacy Linux versions or Oracle Database workloads.
57+
- Questions regarding Windows Subsystem for Linux 2 (WSL2) support and nested virtualization requirements.
58+
59+
## Root causes categorized by issue type
60+
61+
- Configuration and compatibility:
62+
63+
- Generation 2 VM incompatibility: Certain Linux distributions require specific Generation 2 Hyper-V settings, such as Secure Boot or UEFI, for successful installation.
64+
- Unsupported Linux versions: Earlier or unlisted Linux versions might not work with Hyper-V integration components, leading to missing data or failed operations.
65+
- Licensing and support gaps: Documentation might not cover all scenarios for OS/distribution/version compatibility.
66+
67+
- Integration services and VM data reporting:
68+
69+
- Missing or misconfigured Integration services: Without proper configuration, Linux Integration services might fail to report data like IP addresses and hostnames.
70+
- Console/SCVMM synchronization issues: Synchronization delays or database errors might prevent updated VM data from displaying.
71+
72+
- File/state corruption and migration failures:
73+
74+
- Corrupted VMRS files: Migration issues might arise if VM saved state or runtime files are corrupted.
75+
- File permission problems: Insufficient permissions or locked files related to the VM can block migration or restoration.
76+
77+
- Guest OS settings and platform differences:
78+
79+
- RTC and time zone handling: Hyper-V provides system time to the guest RTC without time zone metadata; the guest OS settings determine interpretation.
80+
- CPU compatibility mode: Enabling this mode restricts available CPU instructions for the guest, causing feature gaps.
81+
82+
- External or unsupported scenarios:
83+
84+
- Application/OS-specific issues: Problems within guest OS or applications, like Oracle Database, require vendor support.
85+
- Feature or environment limitations: Advanced features, such as nested virtualization and WSL2, need specific VM configurations or hardware.
86+
87+
## Resolve VM installation issues (Generation 2 Linux VMs)
88+
89+
1. Review VM configuration:
90+
91+
- Disable Secure Boot or set it to use the correct template (for example, `MicrosoftUEFICertificateAuthority` for supported Linux distributions).
92+
- Ensure the VM generation matches the Linux distribution's requirements.
93+
94+
2. Adjust VM settings:
95+
96+
- Set the firmware to boot from the correct device (DVD or ISO).
6097
- Remove unnecessary hardware, such as legacy network adapters.
61-
3. **Retry installation**: - Reattempt the OS installation after making the necessary changes.
62-
4. **Workaround**: - If issues persist, install the OS on a Generation 1 VM.
63-
64-
### 2. Resolving live migration and state file errors
65-
1. **Check event logs and error codes**: - Review Hyper-V logs for Event ID **21502** and error codes such as **0xC0370027**, **0x80048054**, or **0x80070037**.
66-
2. **Inspect VM state files**: - Ensure .vmrs and .vmcx files are accessible on both source and destination nodes.
67-
3. **Create a new VM**: - Shut down the affected VM.
68-
- Create a new VM and attach the original OS/data disks. Match CPU and RAM settings to the original configuration.
69-
4. **Test migration**: - Attempt live migration with the new VM.
70-
5. **Monitor for recurrence**: - If resolved, continue monitoring the VM. If the issue persists, escalate for further disk or file system investigation.
71-
72-
### 3. Resolving management console and integration data issues
73-
1. **Verify Integration Services**: - Use the command lsmod | grep hv in the guest OS to confirm that Hyper-V modules are loaded.
74-
- Ensure the latest Linux Integration Services are installed.
75-
2. **Enable data exchange**: - In VM settings, ensure "Data Exchange" is enabled under Integration Services.
76-
3. **Update management console**: - Apply the latest updates to Hyper-V, SCVMM, or other management platforms.
77-
4. **Correct SCVMM database**(if needed): - Backup the SCVMM database.
78-
- Use SQL queries to update missing VM names or IPs.
79-
80-
### 4. Resolving time synchronization issues
81-
1. **Update Integration Services**: - Ensure the guest OS has the latest Linux Integration Services installed.
82-
2. **Verify time sync settings**: - In Hyper-V Manager, ensure "Time Synchronization" is enabled.
83-
3. **Adjust guest OS settings**: - Use timedatectl to configure the system clock and time zone correctly. For example: timedatectl set-timezone UTC.
84-
4. **Delay application startup**: - For time-sensitive applications, delay startup until synchronization completes.
85-
86-
### 5. Resolving CPU feature/instruction set issues
87-
1. **Disable CPU compatibility mode**: - In Hyper-V Manager or via PowerShell:
88-
89-
Set-VMProcessor -VMName -CompatibilityForMigrationEnabled $false
90-
2. **Validate in guest OS**: - Run cat /proc/cpuinfo to confirm that required CPU flags are present.
91-
3. **Restart VM**: - Restart the VM to apply changes.
92-
93-
### 6. Resolving frequent VM disconnects
94-
1. **Check network and VM health**: - Verify that network adapters are correctly configured and functioning.
95-
2. **Review VM cloning practices**: - Ensure unique MAC addresses and proper cleanup after cloning.
96-
3. **Adjust Secure Boot settings**: - Enable or disable Secure Boot as required by the Linux distribution.
97-
4. **Contact Linux vendor support**: - Escalate issues that persist to the Linux distribution vendor.
98-
99-
### 7. Resolving licensing, support, and feature inquiries
100-
1. **Licensing questions**: - Consult Microsoft licensing specialists for queries about licensing non-Windows OSes on Windows Server.
101-
2. **Legacy OS or unsupported features**: - Refer to the relevant vendor for support on legacy Linux versions, Oracle Database, or WSL2.
102-
3. **Nested virtualization**: - Confirm that your VM size or hardware supports nested virtualization.
98+
99+
3. Retry installation: Reattempt the OS installation after making the necessary changes.
100+
4. If issues persist, install the OS on a Generation 1 VM.
101+
102+
## Resolve live migration and state file errors
103+
104+
1. Check event logs and error codes: Review Hyper-V logs for Event ID 21502 and error codes such as 0xC0370027, 0x80048054, or 0x80070037.
105+
2. Inspect VM state files: Ensure `.vmrs` and `.vmcx` files are accessible on both source and destination nodes.
106+
3. Create a new VM:
107+
108+
1. Shut down the affected VM.
109+
2. Create a new VM and attach the original OS/data disks. Match CPU and RAM settings to the original configuration.
110+
111+
4. Test migration: Attempt live migration with the new VM.
112+
5. Monitor for recurrence: If the issue is resolved, continue monitoring the VM. If the issue persists, escalate for further disk or file system investigation.
113+
114+
## Resolve management console and integration data issues
115+
116+
1. Verify integration services:
117+
118+
- Use the `lsmod | grep hv` command in the guest OS to confirm that Hyper-V modules are loaded.
119+
- Ensure the latest Linux integration services are installed.
120+
121+
2. Enable data exchange: In the VM settings, ensure "Data Exchange" is enabled under integration services.
122+
3. Update management console: Apply the latest updates to Hyper-V, SCVMM, or other management platforms.
123+
4. Correct SCVMM database (if needed):
124+
125+
1. Back up the SCVMM database.
126+
2. Use SQL queries to update missing VM names or IP addresses.
127+
128+
## Resolve time synchronization issues
129+
130+
1. Update integration services: Ensure the guest OS has the latest Linux integration services installed.
131+
2. Verify time synchronization settings: In Hyper-V Manager, ensure "Time Synchronization" is enabled.
132+
3. Adjust guest OS settings: Use `timedatectl` to configure the system clock and time zone correctly. For example, `timedatectl set-timezone UTC`.
133+
4. Delay application startup: For time-sensitive applications, delay startup until synchronization completes.
134+
135+
## Resolve CPU feature/instruction set issues
136+
137+
1. Disable CPU compatibility mode in Hyper-V Manager or via PowerShell:
138+
139+
```powershell
140+
Set-VMProcessor -VMName -CompatibilityForMigrationEnabled $false
141+
```
142+
143+
2. Validate in guest OS: Run `cat /proc/cpuinfo` to confirm that required CPU flags are present.
144+
3. Restart VM: Restart the VM to apply changes.
145+
146+
## Resolve frequent VM disconnects
147+
148+
1. Check network and VM health: Verify that network adapters are correctly configured and functioning.
149+
2. Review VM cloning practices: Ensure unique MAC addresses and proper cleanup after cloning.
150+
3. Adjust Secure Boot settings: Enable or disable Secure Boot as required by the Linux distribution.
151+
4. Contact Linux vendor support: Escalate issues that persist to the Linux distribution vendor.
152+
153+
## Resolve licensing, support, and feature inquiries
154+
155+
- Licensing questions: Consult Microsoft licensing specialists for queries about licensing non-Windows operating systems on Windows Server.
156+
- Legacy OS or unsupported features: Refer to the relevant vendor for support on legacy Linux versions, Oracle Database, or WSL2.
157+
- Nested virtualization: Confirm that your VM size or hardware supports nested virtualization.
103158
104159
## Data collection
105160
106161
To assist in troubleshooting, gather the following logs and information:
107-
- **VML traces** (for live migration):
108162
109-
VmlTrace.exe /m a /f all all
110-
VmlTrace.exe stop
163+
- VML traces (for live migration):
111164
112-
```plaintext
113-
 
165+
```console
166+
VmlTrace.exe /m a /f all all
167+
VmlTrace.exe stop
114168
```
115-
- **NetSH network trace**:
116169
117-
netsh trace start capture=yes tracefile=network-trace.etl overwrite=yes persistent=yes
118-
netsh trace stop
170+
- NetSH network trace:
119171
120-
```plaintext
121-
 
172+
```console
173+
netsh trace start capture=yes tracefile=network-trace.etl overwrite=yes persistent=yes
174+
netsh trace stop
122175
```
123-
- **Integration Services check**:
124176
177+
- Integration services check:
178+
179+
```powershell
125180
Get-VMIntegrationService -VMName
126-
- **CPU validation**:
181+
```
182+
183+
- CPU validation:
127184
185+
```console
128186
cat /proc/cpuinfo
129-
- **Time settings** (Linux):
187+
```
188+
189+
- Time settings (Linux):
130190
191+
```console
131192
timedatectl status
132-
timedatectl set-timezone
193+
timedatectl set-timezone
194+
```
133195
134196
## References
135-
- [Supported Linux and FreeBSD Virtual Machines on Hyper-V](https://learn.microsoft.com/en-us/windows-server/virtualization/hyper-v/supported-centos-and-red-hat-enterprise-linux-virtual-machines-on-hyper-v)
136-
- [Linux Integration Services Documentation](https://learn.microsoft.com/en-us/windows-server/virtualization/hyper-v/supported-debian-virtual-machines-on-hyper-v)
137197
138-
If issues persist after following these steps, collect the relevant logs and contact Microsoft Support or your Linux distribution vendor for further assistance.
198+
- [Supported Linux and FreeBSD Virtual Machines on Hyper-V](/windows-server/virtualization/hyper-v/supported-centos-and-red-hat-enterprise-linux-virtual-machines-on-hyper-v)
199+
- [Linux Integration Services Documentation](/windows-server/virtualization/hyper-v/supported-debian-virtual-machines-on-hyper-v)
200+
201+
If issues persist after following these steps, collect the relevant logs and contact Microsoft Support or your Linux distribution vendor for further assistance.

0 commit comments

Comments
 (0)