Generation 2 Virtual Machine Overview
Published: June 24, 2013
Updated: November 5, 2013
Applies To: Windows Server 2012 R2
Virtual machine generation determines the virtual hardware and functionality that is presented to the virtual machine. In Hyper-V there are two supported virtual machine generations, generation 1 and generation 2. Generation 2 virtual machines have a simplified virtual hardware model, and it supports Unified Extensible Firmware Interface (UEFI) firmware instead of BIOS-based firmware. Additionally, the majority of legacy devices are removed from generation 2 virtual machines.
This topic describes the various benefits to a generation 2 virtual machine and lists the requirements for generation 2 virtual machines.
In previous versions of Hyper-V there was only one type of virtual machine. Hyper-V in Windows Server 2012 R2 includes two types of virtual machine generations that can be selected when you create a new virtual machine.
Generation 1 Provides the same virtual hardware to the virtual machine as in previous versions of Hyper-V.
Generation 2 Provides the following new functionality on a virtual machine:
Secure Boot (enabled by default)
Boot from a SCSI virtual hard disk
Boot from a SCSI virtual DVD
PXE boot by using a standard network adapter
UEFI firmware support
- Secure Boot (enabled by default)
|IDE drives and legacy network adapter support has been removed.|
The following guest operating systems are supported as generation 2 virtual machines.
Windows Server 2012
Windows Server 2012 R2
64-bit versions of Windows 8
64-bit versions of Windows 8.1
|After a virtual machine is created, you cannot change its generation.|
In previous versions of Hyper-V, if you wanted to perform a remote installation of the guest operating system by using PXE boot, you were required to install a legacy network adapter for the PXE boot, in addition to the standard network adapter that you would use after the operating system was installed.
Generation 2 virtual machines support PXE boot by using a standard network adapter, so there is no need to install a legacy network adapter. The legacy network adapter has been removed from generation 2 virtual machines.
In previous versions of Hyper-V, you could not boot a virtual machine from a SCSI-attached virtual hard disk or from a DVD.
Generation 2 virtual machines can boot from a virtual hard disk or DVD that is attached to the SCSI controller. The virtual IDE controller has been removed from generation 2 virtual machines.
Secure Boot is a feature that helps prevent unauthorized firmware, operating systems, or UEFI drivers (also known as option ROMs) from running at boot time.
|Secure Boot is enabled by default for generation 2 virtual machines. This can be modified after the virtual machine has been created.|
The following are some frequently asked questions regarding generation 2 virtual machines.
Yes. This is expected because generation 2 does not support all of the Hyper-V-supported guest operating systems. Guest operating systems that are not supported by generation 2 virtual machines need to be installed in a generation 1 virtual machine.
In the daily running of a virtual machine there is no performance difference between a generation 1 and generation 2 virtual machines. You might see a slight improvement in virtual machine boot and installation times with generation 2 virtual machines.
The following are the benefits of using a generation 2 virtual machine.
Can boot the virtual machine from a SCSI device or a standard network adapter
Helps prevent unauthorized firmware, operating systems, or UEFI drivers from running at boot time when Secure Boot is enabled
By default COM ports are not presented in generation 2 virtual machines. You can configure COM ports through PowerShell or WMI.
To enable kernel debugging using a COM port you must do the following two steps.
Disable Secure Boot. Kernel debugging is not compatible with Secure Boot, so Secure Boot must be disabled in the virtual machine. Use the Set-VMFirmware PowerShell cmdlet to disable Secure Boot when the virtual machine is in an off state. The following command will disable Secure Boot on virtual machine TestVM
Set-VMFirmware –Vmname TestVM –EnableSecureBoot Off
Configure a COM port. Use the Set-VMComPort PowerShell cmdlet to add a COM port to the virtual machine. The following example will configure the first COM port on virtual machine TestVM to connect to named pipe TestPipe on the local computer.
Set-VMComPort –VMName TestVM 1 \\.\pipe\TestPipe
|Configured COM ports are not visible when looking at the settings of a virtual machine in the Hyper-V Manager Console.|
No. RemoteFX is not supported by generation 2 virtual machines.
No. The virtual DVD drive in generation 2 virtual machines only supports ISO image files.
No. Generation 2 virtual machines only support VHDX format virtual hard drives. You can convert VHD files to VHDX format using the Edit Virtual Hard Disk Wizard in the Hyper-V Manager Console or use the Convert-VHD PowerShell cmdlet.
No. A clean install of the operating system is required.
While this is technically possible, it is possible that unexpected errors may occur. Therefore a VHDX file that is bootable to both generation 1 and generation 2 virtual machines is not supported or recommended.
Yes. A VHDX file itself is a container for a disk and as such can be mounted regardless of the virtual machine generation.
No. The virtual machine generation is a property of the virtual machine not the virtual hard disk.
Yes, the VHDX file can be attached to either IDE or SCSI controller of a generation 1 virtual machine. If this is a bootable VHDX file the generation 1 virtual machine will not boot.
No. Generation 2 virtual machine is a new feature to Windows Server 2012 R2.
No. The virtual firmware and configuration are independent of the physical platform.
Microsoft does not provide or support a UEFI shell or other UEFI applications. Using a non-Microsoft UEFI shell or UEFI applications is technically possible if complied from sources directly. If these applications are not appropriately digitally signed you will be required to disable Secure Boot for the virtual machine.
The boot entries for a generation 2 virtual machine are stored in the configuration file for the virtual machine.
By default a virtual machine created by both the New Virtual Machine Wizard and the New-VM PowerShell cmdlet create generation 1 virtual machines. In the New Virtual Machine Wizard you can select Generation 2 on the Specify Generation. In PowerShell you can use the –Generation parameter to specify the generation of a virtual machine.
While Windows 7 and Windows Server 2008 R2 support UEFI, they depend on a Programmable Interrupt Controller (PIC) which is not present in generation 2 virtual machine hardware.
Generation 2 virtual machines do not support 32-bit guest operating systems as the 64-bit only UEFI firmware does not have a Compatibility Service Module (CSM).
8. Generation 2 virtual machines do not support legacy network adapters.
256. Generation 2 virtual machines support up to 4 SCSI controllers with each controller supporting 64 devices. Generation 2 virtual machines can have more than 4 DVD drives.
On a generation 2 virtual machine you can add a DVD drive while the virtual machine is running.
Yes. By default generation 2 virtual machines uses IPv4. Use can set a virtual machine to use IPv6 instead of IPv4 using the Set-VMFirmware PowerShell cmdlet. The following example will set the preferred protocol to IPv6 for virtual machine name TestVM
Set-VMFirmware –VMName TestVM –IPProtocolPreference IPv6
No. Generation 2 virtual machines do not support virtual floppy drives. As an alternate use an ISO image file on a DVD drive.