Tutorials  /  Security

Hyper-V Gen1 to Gen2 Upgrade: Step-by-Step Guide

Ccentron Redaktion · June 2024 ·5 min read ·Security, Tutorial

Hyper-V offers two generations of virtual machines (VMs): Gen1 and Gen2. Gen1 VMs use traditional BIOS, while Gen2 VMs use UEFI, providing advanced features and better performance. Upgrading existing Gen1 VMs to Gen2 allows you to take advantage of modern UEFI-based features. This updated guide walks you through the process.

Differences Between Gen1 and Gen2 VMs

Gen1 VMs (BIOS):

  • Use a traditional BIOS.
  • Support older operating systems and software.
  • Have limited features compared to Gen2.

Gen2 VMs (UEFI):

  • Use UEFI instead of BIOS.
  • Support Secure Boot and other advanced security features.
  • Offer better performance and modern capabilities.
  • Require a 64-bit operating system that supports UEFI.
SEC

Matching infrastructure at centron

Hardening does not stop at the server: cloud firewalls filter traffic before it reaches the VM – centrally managed, no per-rule surcharge. Explore cloud firewalls →

Prerequisites for the Upgrade

Before starting the upgrade, ensure the following prerequisites are met:

  • Operating System Compatibility: Verify that the VM's operating system supports UEFI. This typically includes modern Windows and Linux distributions.
  • Disk Format: Confirm that the disk uses GPT (GUID Partition Table). Use the MBR2GPT tool for conversion if required.
  • Complete Backup: Create a full backup of the current Gen1 VM.
  • Free Storage Space: Ensure there is enough storage space for the conversion.

Updated Steps to Upgrade from Gen1 to Gen2

Hyper-V does not support direct conversion from Gen1 to Gen2. Instead, you must create a new Gen2 VM and migrate the data. Follow these updated steps:

Step 1: Backup the VM

Before proceeding, export the current Gen1 VM as a backup:

  1. Open Hyper-V Manager.
  2. Right-click on the Gen1 VM and select Export.
  3. Choose a location to save the exported VM and confirm the operation.

Step 2: Prepare the System

Perform necessary updates and preparations to ensure smooth migration:

  • Remove non-essential software that may cause compatibility issues.
  • Run a disk cleanup to free up space.
  • Confirm that the disk is formatted as GPT. If not, use the MBR2GPT tool to convert it:

mbr2gpt /convert /allowFullOS

Step 3: Convert the VHDX File

Use a tool like Disk2vhd to create a virtual hard drive (VHDX) from the Gen1 VM:

  1. Download and run Disk2vhd inside the Gen1 VM.
  2. Select the system and boot partitions.
  3. Save the VHDX file to a location accessible from the Hyper-V host.

Step 4: Create Gen2 VM

Create a new Gen2 VM in Hyper-V Manager:

  1. Open Hyper-V Manager and click New > Virtual Machine.
  2. Follow the wizard and select Generation 2 for the VM generation.
  3. Assign resources such as CPU, memory, and network adapters as needed.

Step 5: Attach VHDX File

Attach the previously created VHDX file to the Gen2 VM:

  1. Open the settings of the new Gen2 VM.
  2. Navigate to SCSI Controller > Add Hard Drive.
  3. Select the VHDX file created in Step 3.

Step 6: Start and Verify the VM

Start the new Gen2 VM and verify functionality:

  1. Boot the VM and ensure it starts without errors.
  2. Check that the operating system recognizes UEFI features such as Secure Boot.
  3. Test all applications and services to confirm they work as expected.

Post-Upgrade Tasks and Optimizations

After successfully starting the Gen2 VM, perform the following optimizations:

  1. Enable UEFI Features:
    • Turn on Secure Boot in the VM settings for enhanced security.
    • Utilize other UEFI features as needed.
  2. Update Drivers:
    • Ensure all drivers are compatible with the Gen2 VM configuration.
    • Update to the latest versions if necessary.
  3. Optimize Performance:
    • Adjust CPU, memory, and network settings to improve performance.
    • Monitor resource usage and make necessary adjustments.

Additional Notes

  • Using MBR2GPT: If your Gen1 VM disk is formatted as MBR, use the MBR2GPT tool to convert it before creating the VHDX file.
  • Supported Operating Systems: Check the official Microsoft documentation to ensure that your VM's operating system supports UEFI and Gen2 VMs. (Learn more)
  • Testing Environment: Perform the migration in a test environment before applying it to production systems.

Conclusion

Upgrading a Hyper-V Gen1 VM to a Gen2 VM enables you to take advantage of modern UEFI features, better performance, and enhanced security. By carefully following the steps outlined above, you can successfully complete the migration and modernize your virtual infrastructure.

Jetzt 200 € Guthaben sichern

Testen Sie Ihr Setup auf ccloud³

Registrieren Sie sich in der ccloud³ und erhalten Sie 200 € Startguthaben für Ihr Projekt – z. B. für eine PostgreSQL-VM mit automatischen Backups.

centron Redaktion Technische Redaktion

Das Redaktionsteam von centron schreibt Anleitungen aus dem Betriebsalltag: getestet auf unserer eigenen Plattform, betrieben im Rechenzentrum in Hallstadt bei Bamberg.

Kategorie Security
Teilen
Noch offene Fragen?

Our team will help you with your specific setup - in German or English, by people who run the platform themselves.

War dieses Tutorial hilfreich?

Your answer is stored anonymously and helps us improve our tutorials.

Kommentare

No comments yet - be the first to ask a question about this tutorial.

Sign in to comment

Comments are open to centron customers. Sign in to your account to ask a question about this tutorial.

Weiterlesen

Das könnte Sie auch interessieren

Jetzt kostenlos anfangen

Melden Sie sich an und erhalten Sie in den ersten 60 Tagen ein Guthaben von 200 € bei centron.

Dieses Werbeangebot gilt nur für neue Konten. Angebot ausschließlich für Gewerbetreibende.

Jetzt loslegen Sales kontaktieren