<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>John Howard - Senior Program Manager in the Hyper-V team at Microsoft</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/jhoward/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/jhoward/feed.xml</link>
    <description>Senior Program Manager, Hyper-V team, Windows Core Operating System Division.</description>
    <lastBuildDate>Wed, 25 Nov 2015 03:01:54 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>NVSPBind - temporarily unavailable</title>
      <link>https://docs.microsoft.com/archive/blogs/jhoward/nvspbind-temporarily-unavailable</link>
      <pubDate>Wed, 28 May 2014 13:59:00 GMT</pubDate>
      <dc:creator><![CDATA[John Howard -MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jhoward/2014/05/28/nvspbind-temporarily-unavailable/</guid>
      <description><![CDATA[Quick note as I've been inundated with emails saying that NVSPBind is not available for download as...]]></description>
      <content:encoded><![CDATA[<p>Quick note as I've been inundated with emails saying that NVSPBind is not available for download as of a week or so back. The reason is that the archive site of code.msdn.microsoft.com was really archived. We're in the process of re-uploading it. Normal service should be resumed soon.<p></p><p>Update 19th June 2014: The tool is now available at <a href="http://gallery.technet.microsoft.com/Hyper-V-Network-VSP-Bind-cf937850">http://gallery.technet.microsoft.com/Hyper-V-Network-VSP-Bind-cf937850</a></p><p></p><p>Cheers,<br>John.</p></p>
]]></content:encoded>
    </item>
    <item>
      <title>Using SR-IOV on Windows Server 2012 R2 Hyper-V, Integration Services may indicate "update required"</title>
      <link>https://docs.microsoft.com/archive/blogs/jhoward/using-sr-iov-on-windows-server-2012-r2-hyper-v-integration-services-may-indicate-update-required</link>
      <pubDate>Wed, 05 Feb 2014 15:03:51 GMT</pubDate>
      <dc:creator><![CDATA[John Howard -MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jhoward/2014/02/05/using-sr-iov-on-windows-server-2012-r2-hyper-v-integration-services-may-indicate-update-required/</guid>
      <description><![CDATA[This is a bug which has been reported to me by a few people now, and a KB has recently been...]]></description>
      <content:encoded><![CDATA[This is a bug which has been reported to me by a few people now, and a KB has recently been published. This issue only occurs if the VM is:

- Running Windows Server 2012 (not Windows Server 2012 R2)<br>- Is configured to use SR-IOV and a VF was available for use by the VM when it powers on (or restarts)

Under these circumstances, even if the Integration Services are up to date in the guest operating system, Hyper-V Manager will incorrectly indicate that the Integration Services need an update. Functionally, there's no impact, the guest will run just fine - it's only the reporting side which is incorrect. If you are in doubt, you can always turn off SR-IOV temporarily and see that the correct status is reported.

For those of you interested why this occurs, it's a bug in the detection logic in the parent partition, and the way in which devices are enumerated/detected. For support of SR-IOV in guest operating systems, we have a driver which runs in the guest, VPCI.sys (Virtual PCI). This is enumerated on VMBus.

The detection logic is that when the guest starts, it communicates the Integration Services status through KVP by enumerating devices on VMBus, looking at their version numbers. When SR-IOV is in use, as per above, this will include VPCI.sys. However, VPCI.sys while enumerated on VMBus, is not installed or serviced as part of the Integration Services setup. Hence for a Windows Server 2012 guest, the version number of VPCI.sys will (correctly) be 6.2.xxxx, even when running on a Windows Server 2012 R2 parent where VPCI.sys is (correctly) 6.3.xxxx.

So you can probably see the issue - the parent side determination has faulty logic when SR-IOV is in use, incorrectly including VPCI.sys in the list which it validates against.

The KB can be found at http://support.microsoft.com/kb/2923885.

Cheers,<br>John.]]></content:encoded>
    </item>
    <item>
      <title>Hyper-V generation 2 virtual machines – part 10</title>
      <link>https://docs.microsoft.com/archive/blogs/jhoward/hyper-v-generation-2-virtual-machines-part-10</link>
      <pubDate>Thu, 14 Nov 2013 10:01:00 GMT</pubDate>
      <dc:creator><![CDATA[John Howard -MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jhoward/2013/11/14/hyper-v-generation-2-virtual-machines-part-10/</guid>
      <description><![CDATA[Part 1: Introduction to generation 2 virtual machines Part 2: Networking and boot order Part 3:...]]></description>
      <content:encoded><![CDATA[<p><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/24/hyper-v-generation-2-virtual-machines-part-1.aspx">Part 1: Introduction to generation 2 virtual machines</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/25/hyper-v-generation-2-virtual-machines-part-2.aspx">Part 2: Networking and boot order</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/28/hyper-v-generation-2-virtual-machines-part-3.aspx">Part 3: Storage</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/29/hyper-v-generation-2-virtual-machines-part-4.aspx">Part 4: Keyboard for Windows 8 &amp; Windows Server 2012</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/31/hyper-v-generation-2-virtual-machines-part-5.aspx">Part 5: Kernel debugging</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/01/hyper-v-generation-2-virtual-machines-part-6.aspx">Part 6: Secure Boot</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/04/hyper-v-generation-2-virtual-machines-part-7.aspx">Part 7: FAQ</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/06/hyper-v-generation-2-virtual-machines-part-8.aspx">Part 8: Manually migrating generation 1 virtual machines to generation 2</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/11/hyper-v-generation-2-virtual-machines-part-9.aspx">Part 9: Installing from ISO</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/14/hyper-v-generation-2-virtual-machines-part-10.aspx">Part 10: Utility for converting generation 1 virtual machines to generation 2 (Convert-VMGeneration)</a></p>
<p>The final part (at least for now, I&rsquo;m hoping a guest author will write part 11) of this series on generation 2 virtual machines in Hyper-V re-visits conversion of a generation 1 virtual machine to a generation 2 virtual machine. <a href="http://blogs.technet.com/b/jhoward/archive/2013/11/06/hyper-v-generation-2-virtual-machines-part-8.aspx" target="_blank">Part 8</a> walked through the manual process, assuming it is possible. However, there is an easier way with a PowerShell script I wrote and recently released. Called <span style="font-family: courier new;">Convert-VMGeneration.ps1</span>, it can be downloaded from <a href="http://code.msdn.microsoft.com/ConvertVMGeneration">http://code.msdn.microsoft.com/ConvertVMGeneration</a>. The script is intended to make life as simple as possible, reducing as many as reasonably possible manual post-migration fix-ups that may be required.</p>
<p><span style="font-family: courier new;">Convert-VMGeneration.ps1</span> is self-documenting &ndash; after downloading to a local drive, running <span style="font-family: courier new;">get-help .\Convert-VMGeneration.ps1</span> &ndash;full will give you everything you need to know on how to use. I will assume that you have read part 8 of this series before use so you understand the three phases of conversion &ndash; capture, apply and clone.</p>
<p>A few tips worth mentioning:</p>
<ul>
<li>Run <span style="font-family: courier new;">reagentc /disable</span> in the guest operating system prior to shutting down and converting (if <span style="font-family: courier new;">reagentc /info </span>indicates it is enabled). After conversion, in the generation 2 virtual machine, run <span style="font-family: courier new;">reagentc /enable</span>. This makes life a lot easier in terms of the Windows Recovery Environment and (lack of) manual intervention.</li>
<li>I <strong><span style="text-decoration: underline;">strongly recommend</span></strong> you use the <span style="font-family: courier new;">&ndash;Path</span> parameter. Alternately, after a VM has been created, move the VM and its related storage to the right path using Hyper-V Manager. Note that if you subsequently perform a storage move, data-disks which were in use by the generation 1 virtual machine will no longer be valid from its perspective.</li>
<li>For the first few times of use, you might want to specify the name of the temporary .WIM file using the <span style="font-family: courier new;">&ndash;WIM</span> parameter, combined with <span style="font-family: courier new;">&ndash;KeepWIM.</span> That&rsquo;ll save some time if a failure occurs during the apply or clone phases as you&rsquo;ll not need to redo the potentially time-consuming capture phase. Using the <span style="font-family: courier new;">-WIM</span> parameter also makes it easier if you are running short of disk space and want to use an alternate location.</li>
<li>Be aware that you may not be able to start both the generation 1 and generation 2 virtual machines simultaneously (for example if they share a data VHDX). In reality, you really don&rsquo;t want both machines on the network at the same time anyway. Be cautious of other implications too such as domain joined machine account passwords changing and so on.</li>
<li>Perform a move of the VM and all its data to another path after migration and you&rsquo;ve verified the functionality of the converted generation 2 virtual machine. This will make it much cleaner to delete the old generation 1 virtual machine and clean up any old files which may be lingering.</li>
<li>The conversion performs a highly destructive step which completely wipes a disk. If everything is to plan, it&rsquo;s the blank VHDX used as the boot disk for the generation 2 virtual machine. However, things could go wrong. For that reason, I strongly recommend you heed the warning (which cannot be suppressed) and make appropriate verifications. Should data loss occur for reasons such as coding error, no liability is assumed. If in doubt, export the generation 1 virtual machine, and import it onto a scratch box. Then do the conversion. That way, you are assured you will not lose anything important IF there is a bug.</li>
<li>Similar to <a href="http://code.msdn.microsoft.com/HVRemote" target="_blank">HVRemote</a> which some of you may have used, this script is not supported or endorsed by Microsoft Corporation.</li>
<li>Don&rsquo;t close the PowerShell window while a conversion is in progress. Due to a bug in Windows, you may leave your system in a state whereby a drive letter is &lsquo;leaked&rsquo; &ndash; it will be visible in Windows File Explorer, but unusable until the system is restarted. To cancel the script while it is progress, use Control-C and wait for it to clean-up instead.</li>
</ul>
<p>Here&rsquo;s an example of the conversion of a Windows Server 2012 virtual machine. The original virtual machine is highly available. The resulting generation 2 virtual machine will need to be made highly available after migration has completed.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/5280.clip_image002_17A265F3.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/5280.clip_5F00_image002_5F00_17A265F3.jpg"><img style="display: inline;" title="clip_image002" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/8836.clip_image002_thumb_7A3014E6.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/8836.clip_5F00_image002_5F00_thumb_5F00_7A3014E6.jpg" alt="clip_image002" width="759" height="479" border="0" /></a></p>
<p>Here&rsquo;s an example where there are some (potential) issues to resolve. One is that there is an additional data partition on the boot disk for the source VM. Windows Recovery Environment was left enabled during the migration and will not operate correctly in the generation 2 virtual machine. Lastly, the original source boot disk was a differencing disk. Appropriate fix-ups may be required to mirror the configuration on the generation 2 virtual machine.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4135.clip_image004_7310D86E.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4135.clip_5F00_image004_5F00_7310D86E.jpg"><img style="display: inline;" title="clip_image004" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/6366.clip_image004_thumb_6BF19BF6.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/6366.clip_5F00_image004_5F00_thumb_5F00_6BF19BF6.jpg" alt="clip_image004" width="759" height="385" border="0" /></a></p>
<p>There are some VM configurations which aren&rsquo;t handled, and the script will block the conversion:</p>
<ul>
<li>The VM is running. The reason is simply that you cannot reasonably expect an operating system to continue running correctly if the firmware is fundamentally changed from under it.</li>
<li>Checkpoints (snapshots) are in use by the generation 1 virtual machine. The reasons partly relate to the above statement &ndash; an online checkpoint is equivalent to a running VM. While offline checkpoints could be converted in theory, there are further problems:</li>
<ul>
<li>The mount-diskimage cmdlet that the script uses under the covers does not support .AVHDX files which are used by checkpoints. Further, the time to do the conversion would be prohibitive &ndash; each checkpoint would have to done individually.</li>
<li>Rebuilding the checkpoint tree with parent/child would be pretty much impossible &ndash; at best an individual offline checkpoint could be converted to a &lsquo;standalone&rsquo; generation 2 virtual machine.</li>
</ul>
<li>Hyper-V replica is enabled. The reason was simply my time to validate this scenario. In theory it should work. Obviously replica would need to be re-enabled after the conversion. The workaround is to disable replica prior to conversion, or use the &ldquo;-IgnoreReplicaCheck&rdquo; parameter.</li>
<li>When a guest cluster is configured in the generation 1 virtual machine using a shared VHDX. A highly available/clustered VM from the parent partition perspective works fine though. I am somewhat doubtful a guest cluster would come across cleanly, and have done no validation. The script hard blocks if any VHDX in the generation 1 virtual machine is shared.</li>
</ul>
<p>I hope you find Convert-VMGeneration.ps1 useful. I&rsquo;ll try to fix any bugs you report as time permits! A note for PowerShell aficionados reading the code &ndash; I make no apologies for my lack of PowerShell skills. This was the first time I&rsquo;ve undertaken writing anything of reasonable complexity in PS. I&rsquo;m sure there are many ways to make the code more powershellesque in efficiency.</p>
<p>So with that, I&rsquo;ve reached the end of the planned parts of this series on generation 2 virtual machines in Hyper-V in Windows 8.1 and Windows Server 2012 R2. I hope you enjoyed them and found them and the conversion utility useful. As always, comments, questions and feedback are welcome.</p>
<p>Cheers, <br />John.</p>]]></content:encoded>
    </item>
    <item>
      <title>Windows Server 2012 R2 - Server Performance Tuning Guidelines</title>
      <link>https://docs.microsoft.com/archive/blogs/jhoward/windows-server-2012-r2-server-performance-tuning-guidelines</link>
      <pubDate>Tue, 12 Nov 2013 11:09:44 GMT</pubDate>
      <dc:creator><![CDATA[John Howard -MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jhoward/2013/11/12/windows-server-2012-r2-server-performance-tuning-guidelines/</guid>
      <description><![CDATA[This is worth a read - the revised for Windows Server 2012 R2 Server Performance Tuning Guidelines...]]></description>
      <content:encoded><![CDATA[<p>This is worth a read - the revised for Windows Server 2012 R2 Server Performance Tuning Guidelines documentation&nbsp;went live at the end of last week. You can <a href="http://msdn.microsoft.com/en-us/library/windows/hardware/dn529133.aspx">find it here</a>. There's lots of useful information in there, and of course, lots of information about Hyper-V as well.<p>Cheers,<br>John.</p></p>
]]></content:encoded>
    </item>
    <item>
      <title>Hyper-V generation 2 virtual machines – part 9</title>
      <link>https://docs.microsoft.com/archive/blogs/jhoward/hyper-v-generation-2-virtual-machines-part-9</link>
      <pubDate>Mon, 11 Nov 2013 09:40:00 GMT</pubDate>
      <dc:creator><![CDATA[John Howard -MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jhoward/2013/11/11/hyper-v-generation-2-virtual-machines-part-9/</guid>
      <description><![CDATA[Part 1: Introduction to generation 2 virtual machines Part 2: Networking and boot order Part 3:...]]></description>
      <content:encoded><![CDATA[<p><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/24/hyper-v-generation-2-virtual-machines-part-1.aspx">Part 1: Introduction to generation 2 virtual machines</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/25/hyper-v-generation-2-virtual-machines-part-2.aspx">Part 2: Networking and boot order</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/28/hyper-v-generation-2-virtual-machines-part-3.aspx">Part 3: Storage</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/29/hyper-v-generation-2-virtual-machines-part-4.aspx">Part 4: Keyboard for Windows 8 &amp; Windows Server 2012</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/31/hyper-v-generation-2-virtual-machines-part-5.aspx">Part 5: Kernel debugging</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/01/hyper-v-generation-2-virtual-machines-part-6.aspx">Part 6: Secure Boot</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/04/hyper-v-generation-2-virtual-machines-part-7.aspx">Part 7: FAQ</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/06/hyper-v-generation-2-virtual-machines-part-8.aspx">Part 8: Manually migrating generation 1 virtual machines to generation 2</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/11/hyper-v-generation-2-virtual-machines-part-9.aspx">Part 9: Installing from ISO</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/14/hyper-v-generation-2-virtual-machines-part-10.aspx">Part 10: Utility for converting generation 1 virtual machines to generation 2 (Convert-VMGeneration)</a></p>
<p>This part of the series on generation 2 virtual machines in Hyper-V talks booting from CD/DVD. It&rsquo;s not specific to Hyper-V, it&rsquo;s more about PCAT and EFI, and the way in which Windows installation media is built.</p>
<p>Try the following &ndash; create a new generation 1 and generation 2 VMs with blank VHDXs, setting them both to boot from Windows 8 64-bit .ISO media, and start them.</p>
<p>Here&rsquo;s what you&rsquo;ll see in a generation 1 virtual machine (or PCAT physical system)</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/2553.clip_image002_4A6F6993.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/2553.clip_5F00_image002_5F00_4A6F6993.jpg"><img style="display: inline;" title="clip_image002" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4213.clip_image002_thumb_0CE20BCA.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4213.clip_5F00_image002_5F00_thumb_5F00_0CE20BCA.jpg" alt="clip_image002" width="545" height="462" border="0" /></a></p>
<p>And here&rsquo;s what you&rsquo;ll see in a generation 2 virtual machine (or EFI physical system)</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/2072.clip_image004_65A7C294.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/2072.clip_5F00_image004_5F00_65A7C294.jpg"><img style="display: inline;" title="clip_image004" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4456.clip_image004_thumb_6C5ACC17.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4456.clip_5F00_image004_5F00_thumb_5F00_6C5ACC17.jpg" alt="clip_image004" width="545" height="464" border="0" /></a></p>
<p>Before anyone comments, yes, we&rsquo;re acutely aware that the generation 2 EFI boot loader messages persist on the screen and it can be a little confusing. Essentially what the generation 2 virtual machine did was:</p>
<ul>
<li>Attempt to boot from the CD SCSI device containing the Windows 8 ISO. This is where the &lsquo;Press any key&hellip;&rsquo; message came from. As no key was pressed, we went to the next boot entry. (And this is where we didn&rsquo;t clear the message from the EFI CD boot loader)</li>
<li>I didn&rsquo;t press F12 (in fact, this VM wasn&rsquo;t connected to a network), so network boot failed</li>
<li>The SCSI VHDX is raw with no partitioning or file system, so this too failed</li>
</ul>
<p>So why did the generation 1 virtual machine start setup from the Windows media? The answer is simply that it&rsquo;s the way Windows media is built, and it&rsquo;s inconsistent between the PCAT and EFI loaders.</p>
<p>However, it&rsquo;s relatively simple to solve if you want to avoid the press any key message. In fact, we almost have all the pieces from previous parts. In particular, part 4 where we injected keyboard drivers into the Windows 8 media.</p>
<p>If you loopback mount Windows 8 or 8.1 RTM media, and navigate to the \efi\microsoft\boot directory, you will see there are two versions of cdboot.efi</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/1325.clip_image006_07FF580E.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/1325.clip_5F00_image006_5F00_07FF580E.jpg"><img style="display: inline;" title="clip_image006" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/0743.clip_image006_thumb_75B6914B.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/0743.clip_5F00_image006_5F00_thumb_5F00_75B6914B.jpg" alt="clip_image006" width="548" height="154" border="0" /></a></p>
<p>The default version, cdboot.efi prompts for a keypress. The unused version, cdboot_noprompt.efi doesn&rsquo;t prompt.</p>
<p>So it&rsquo;s fairly simple to create modified media which uses the noprompt version. First, copy the contents of the ISO to a working directory, rename cdboot.efi to cdboot_prompt.efi, and rename cdboot_noprompt.efi to cdboot.efi.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/1832.clip_image008_4E7C4816.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/1832.clip_5F00_image008_5F00_4E7C4816.jpg"><img style="display: inline;" title="clip_image008" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/6644.clip_image008_thumb_2337B10F.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/6644.clip_5F00_image008_5F00_thumb_5F00_2337B10F.jpg" alt="clip_image008" width="557" height="57" border="0" /></a></p>
<p>Do the same with efisys.bin and efisys_prompt.bin</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/3005.clip_image010_351444DC.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/3005.clip_5F00_image010_5F00_351444DC.jpg"><img style="display: inline;" title="clip_image010" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/2746.clip_image010_thumb_22CB7E1A.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/2746.clip_5F00_image010_5F00_thumb_5F00_22CB7E1A.jpg" alt="clip_image010" width="564" height="58" border="0" /></a></p>
<p>Then re-use our oscdimg command (in an elevated deployment and imaging tools environment) from part 4 to recreate the media.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/6153.clip_image011_6295649F.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/6153.clip_5F00_image011_5F00_6295649F.png"><img style="display: inline;" title="clip_image011" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/6165.clip_image011_thumb_2C27434E.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/6165.clip_5F00_image011_5F00_thumb_5F00_2C27434E.png" alt="clip_image011" width="568" height="232" border="0" /></a></p>
<p>Simply attach this modified media to the generation 2 VM and restart it (and don&rsquo;t press any keys, not that you will be prompted&hellip;)</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/8228.clip_image013_7DCDBDA0.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/8228.clip_5F00_image013_5F00_7DCDBDA0.jpg"><img style="display: inline;" title="clip_image013" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/6082.clip_image013_thumb_27448F92.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/6082.clip_5F00_image013_5F00_thumb_5F00_27448F92.jpg" alt="clip_image013" width="635" height="543" border="0" /></a></p>
<p>The surprise awaits! It&rsquo;s worth it &ndash; stay tuned for part 10.</p>
<p>Cheers, <br />John.</p>]]></content:encoded>
    </item>
    <item>
      <title>Hyper-V generation 2 virtual machines – part 8</title>
      <link>https://docs.microsoft.com/archive/blogs/jhoward/hyper-v-generation-2-virtual-machines-part-8</link>
      <pubDate>Wed, 06 Nov 2013 09:17:00 GMT</pubDate>
      <dc:creator><![CDATA[John Howard -MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jhoward/2013/11/06/hyper-v-generation-2-virtual-machines-part-8/</guid>
      <description><![CDATA[Part 1: Introduction to generation 2 virtual machines Part 2: Networking and boot order Part 3:...]]></description>
      <content:encoded><![CDATA[<p><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/24/hyper-v-generation-2-virtual-machines-part-1.aspx">Part 1: Introduction to generation 2 virtual machines</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/25/hyper-v-generation-2-virtual-machines-part-2.aspx">Part 2: Networking and boot order</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/28/hyper-v-generation-2-virtual-machines-part-3.aspx">Part 3: Storage</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/29/hyper-v-generation-2-virtual-machines-part-4.aspx">Part 4: Keyboard for Windows 8 &amp; Windows Server 2012</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/31/hyper-v-generation-2-virtual-machines-part-5.aspx">Part 5: Kernel debugging</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/01/hyper-v-generation-2-virtual-machines-part-6.aspx">Part 6: Secure Boot</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/04/hyper-v-generation-2-virtual-machines-part-7.aspx">Part 7: FAQ</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/06/hyper-v-generation-2-virtual-machines-part-8.aspx">Part 8: Manually migrating generation 1 virtual machines to generation 2</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/11/hyper-v-generation-2-virtual-machines-part-9.aspx">Part 9: Installing from ISO</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/14/hyper-v-generation-2-virtual-machines-part-10.aspx">Part 10: Utility for converting generation 1 virtual machines to generation 2 (Convert-VMGeneration)</a></p>
<p>Forewarning, this is a very long article!</p>
<p>This part of the series on generation 2 virtual machines in Hyper-V talks about migration. Not &ldquo;Live Migration&rdquo;. Nor &ldquo;Storage Migration&rdquo;. Specifically it answers the question &ldquo;Can I change the generation of a virtual machine, or migrate my existing guest operating system in a generation 1 virtual machine to generation 2?&rdquo;</p>
<p>Let me answer it the short way first. No. There is no way in Hyper-V to change the generation of a virtual machine. Neither is there a means to migrate a generation 1 virtual machine to a generation 2 virtual machine. I could end the post there, but I guess my forewarning would have been a little premature&hellip;!</p>
<p>For those of you thinking &ndash; well what if I export a generation 1 virtual machine and import it as a generation 2 virtual machine after tweaking the export contents. My initial response would be that this is absolutely unsupported and does not work due to firmware differences among other things. Followed by a &ldquo;good luck to you&hellip; taking the re-installation and application migration route may be quicker&rdquo;</p>
<p>However, there is a longer answer which is supported in certain circumstances, due to the use of standard inbox tools and capabilities for deployment. Let&rsquo;s rule out first what definitely cannot be migrated. The obvious categories are any virtual machine running a 32-bit guest operating system; any virtual machine not running Windows (although there may be other solutions I&rsquo;m not aware of); any virtual machine running a version of Windows prior to Windows 8/Windows Server 2012.</p>
<p>So let&rsquo;s drill in and do an example walkthrough of migrating a Windows 8 64-bit client guest operating system. I want to stress up front, the tools used here are absolutely NOT my area of expertise, so answers to any questions you might have will be few and far between. Also, it&rsquo;s pretty in-depth and not for the feint-hearted to try.</p>
<p>For this example, I just used the defaults during the new virtual machine wizard, except increasing the memory to 1GB, to end up with a generation 1 virtual machine with one IDE attached boot disk, and a Windows 8 installation ISO inserted into an IDE attached DVD drive. No network is connected to the virtual machine, and no further storage is attached to a SCSI controller.</p>
<p>Here&rsquo;s our unhappy VM who yearns to be a trendier generation. Let&rsquo;s make him smile by migrating him to a generation 2 virtual machine. I want to emphasise also that the process I&rsquo;m following below may <strong>NOT</strong> be perfect. In the screenshot, I have opened regedit to show that this is 64-bit Windows 8, and msinfo32 showing the BIOS mode is Legacy. The only other change to the VM from a default installation is the desktop background image.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4645.clip_image002_53B43FC1.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4645.clip_5F00_image002_5F00_53B43FC1.jpg"><img style="display: inline;" title="clip_image002" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4667.clip_image002_thumb_5A674944.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4667.clip_5F00_image002_5F00_thumb_5F00_5A674944.jpg" alt="clip_image002" width="694" height="590" border="0" /></a></p>
<p>Here&rsquo;s the settings for this VM</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/8053.clip_image004_01355F85.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/8053.clip_5F00_image004_5F00_01355F85.jpg"><img style="display: inline;" title="clip_image004" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/7875.clip_image004_thumb_611A52C7.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/7875.clip_5F00_image004_5F00_thumb_5F00_611A52C7.jpg" alt="clip_image004" width="616" height="581" border="0" /></a></p>
<p>And here&rsquo;s the disk partition layout. Notice it&rsquo;s a typical MBR style layout</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/2117.clip_image005_1CD9EB7B.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/2117.clip_5F00_image005_5F00_1CD9EB7B.png"><img style="display: inline;" title="clip_image005" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/8054.clip_image005_thumb_4ED18C05.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/8054.clip_5F00_image005_5F00_thumb_5F00_4ED18C05.png" alt="clip_image005" width="634" height="85" border="0" /></a></p>
<p>At a high level, the steps I&rsquo;m going to follow are:</p>
<ul>
<li>Disable the recovery environment</li>
<li>Make a copy of the Windows image as installed</li>
<li>Create a new VHDX</li>
<li>Partition it in GPT format and make it bootable</li>
<li>Put the copy of Windows we previously made onto the new disk</li>
<li>Create a new generation 2 virtual machine and attach the new VHDX</li>
<li>Fix up the recovery environment</li>
</ul>
<p>Besides a couple of minor gotchas, none of the above is rocket science. However, what I&rsquo;m going to entirely ignore are considerations such as:</p>
<ul>
<li>The source VM using a VHD (this should &lsquo;just work&rsquo; actually following the same process, but changing VHDX to VHD where I refer to the source disk)</li>
<li>The source VM being multi-boot</li>
<li>The source VHDX having &lsquo;unusual&rsquo; partitioning</li>
<li>Data or other utility partitions, including the optional recovery partition containing a &lsquo;restore&rsquo; WIM, on the source VHDX</li>
<li>Any additional storage such as Fibre Channel or SCSI attached disks.</li>
<li>Making the new VM mirror the source VM in regard to configuration, particularly advanced configuration such as networking. But to be honest, pretty much everything under this category is not covered in this post.</li>
<li>Any form of disk encryption</li>
<li>Shared VHDX or guest clustering</li>
<li>Implications of replica</li>
<li>Implications of checkpoints (snapshots)</li>
</ul>
<p>The first thing I&rsquo;m going to do is to disable the recovery environment on the source machine <em>while it is running</em>, by running the following command from an elevated command prompt (note <strong>DON&rsquo;T</strong> do this on the parent partition, it&rsquo;s inside the VM!):</p>
<p><span style="font-family: Courier New;">reagentc /info</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/8468.clip_image007_2EB67F48.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/8468.clip_5F00_image007_5F00_2EB67F48.jpg"><img style="display: inline;" title="clip_image007" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/2021.clip_image007_thumb_238CF4FE.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/2021.clip_5F00_image007_5F00_thumb_5F00_238CF4FE.jpg" alt="clip_image007" width="640" height="213" border="0" /></a></p>
<p>If the output indicates the Windows recovery environment (WinRE) is enabled, disable it.</p>
<p><span style="font-family: courier new;">r</span><span style="font-family: courier new;">eagentc /disable</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/8867.clip_image009_6E8065CD.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/8867.clip_5F00_image009_5F00_6E8065CD.jpg"><img style="display: inline;" title="clip_image009" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4670.clip_image009_thumb_433BCEC6.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4670.clip_5F00_image009_5F00_thumb_5F00_433BCEC6.jpg" alt="clip_image009" width="651" height="241" border="0" /></a></p>
<p>The reasons for disabling it are due to tight coupling between BCD and the recovery environment configuration. It&rsquo;s just <strong>much </strong>simpler to migrate the virtual machine when it is not configured. We will re-enable it once the virtual machine has been migrated.</p>
<p>Next, I&rsquo;m going to cleanly shutdown the generation 1 virtual machine (I really hope you don&rsquo;t need instructions for that&hellip;.), and loopback mount its VHDX.</p>
<p>From an elevated PowerShell prompt where the VHDX resides, run:</p>
<p><span style="font-family: courier new;">mount-vhd &ndash;readonly .\migrateme.vhdx</span></p>
<p>At this point you could do some fancy PowerShell to find out what drive letter has popped up on your local machine as the Windows installation for the generation 1 virtual machine. In my case, I just used Explorer and can see it&rsquo;s drive H:. The system partition was also given a drive letter, G:. If no drive letters are present, it could be policy on the parent partition, but you can use diskpart or diskmgmt.msc to assign letters and/or online the disk.</p>
<p>We&rsquo;re going to use dism to capture the image. Note that you can use regular inbox dism for this, it doesn&rsquo;t need to be the version of dism from the ADK which I used in a previous part of this series. From an elevated prompt, run the following replacing H: with the appropriate drive letter for the Windows Installation.</p>
<p><span style="font-family: courier new;">dism /capture-image /imagefile:captured.wim /name:&rdquo;Captured&rdquo; /capturedir=&rdquo;H:\&rdquo;</span></p>
<p>The next job is to create a new VHDX which we will partition in a format suitable for use by a generation 2 virtual machine (note that MBR is required for generation 1, GPT is strongly recommended for generation 2). I am going to use GPT, as should you.</p>
<p>This gets a little tricky for sizing purposes, especially when your source disk is almost full. From the disk partition layout above, the source VHDX is 127GB, and during operating system installation, Windows created a 350MB System Reserved partition.</p>
<p>In a typical GPT layout, you&rsquo;d have a 300MB recovery environment tools partition, a 100MB ESP, a 128MB Microsoft reserved partition, and the remainder for the system. There may be other utility partitions such as for push button reset as found on an OEM type of installation. This means that the OS partition size is slightly smaller than on an MBR same size disk using the Windows defaults. <a href="http://technet.microsoft.com/en-us/library/hh824839.aspx">http://technet.microsoft.com/en-us/library/hh824839.aspx</a> has a lot more information on this.</p>
<p>For this exercise, I&rsquo;m going to assume there is ample space on the source image. To make this even more apparent, I&rsquo;m going to create the new VHDX as a 30GB disk. I&rsquo;m also going loopback mount it, find the disk number it&rsquo;s mounted at, and get a few free drive letters I can work with. You should of course do appropriate sizing! From the elevated PowerShell prompt, run the following:</p>
<p>&nbsp;</p>
<p><span style="font-family: courier new;"># Create a new VHDX <br />New-VHD .\migrated.vhdx &ndash;dynamic &ndash;size 30gb <br /> <br /># Mount the new VHDX <br />Mount-DiskImage c:\working\migrated.vhdx <br /> <br /># And find the mounted VHDX <br />$Target = Get-DiskImage c:\working\migrated.vhdx <br /> <br /># And find the disk number of the mounted VHDX on the parent partition <br />($Target | Get-Disk).Number <br /> <br /># And get some available drive letters <br />ls function:[d-z]: -n | ?{ !(test-path $_) } | select -last 3</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/0878.clip_image011_510E14C1.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/0878.clip_5F00_image011_5F00_510E14C1.jpg"><img style="display: inline;" title="clip_image011" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/1440.clip_image011_thumb_5EE05ABC.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/1440.clip_5F00_image011_5F00_thumb_5F00_5EE05ABC.jpg" alt="clip_image011" width="576" height="447" border="0" /></a></p>
<p>From the output of the above commands, in my case the drive number is 2, and the three drive letters are X:, Y: and Z:. (Note you can just use explorer to get spare drive letters, and there&rsquo;s a few ways of finding the drive number of the new VHDX.)</p>
<p>Now it&rsquo;s time to create a diskpart script to partition the new VHDX. It is <strong><span style="color: #ff0000;">REALLY IMPORTANT</span></strong> to make sure you insert the right disk number, otherwise you risk losing all data on another disk on your system. For that reason, I&rsquo;m not even going to put a number in the script below in case someone comes along and runs it. Here&rsquo;s my script using drive letters X:, Y: and Z:. Save it as dp.txt</p>
<p><span style="font-family: courier new;">select disk <strong><span style="color: #ff0000;">INSERT_YOUR_DISK_NUMBER_HERE</span></strong> <br />clean <br />convert gpt</span></p>
<p><span style="font-family: courier new;">create partition primary size=300 <br />format quick fs=ntfs label="Windows RE tools" <br />assign letter=</span><span style="font-family: courier new;"><strong><span style="color: #ff0000;">X</span> <br /></strong>set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac" <br />gpt attributes=0x8000000000000001</span></p>
<p><span style="font-family: courier new;">create partition efi size=100 <br />format quick fs=fat32 label=System <br />assign letter=<strong><span style="color: #ff0000;">Y</span></strong> <br />create partition msr size=128 <br />create partition primary <br />format quick fs=ntfs label=Windows <br />assign letter=<strong><span style="color: #ff0000;">Z</span></strong></span></p>
<p><span style="font-family: courier new;">list part</span></p>
<p>I expressly have not created a recovery image partition here. Please see the recommended configuration here: <a href="http://technet.microsoft.com/en-us/library/hh825686.aspx">http://technet.microsoft.com/en-us/library/hh825686.aspx</a>.</p>
<p>Next, partition your disk (again <strong><span style="color: #ff0000; font-size: medium;">heed warning about the potential for data loss</span></strong>) by running the following from an elevated command prompt:</p>
<p><span style="font-family: courier new;">diskpart /s dp.txt</span></p>
<p>If all is good, you should see output similar to the following from the command prompt, and the drive letters showing up in Windows File Explorer.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/6747.clip_image013_3EC54DFF.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/6747.clip_5F00_image013_5F00_3EC54DFF.jpg"><img style="display: inline;" title="clip_image013" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/7318.clip_image013_thumb_09B8BECF.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/7318.clip_5F00_image013_5F00_thumb_5F00_09B8BECF.jpg" alt="clip_image013" width="595" height="561" border="0" /></a></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/2541.clip_image015_178B04CA.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/2541.clip_5F00_image015_5F00_178B04CA.jpg"><img style="display: inline;" title="clip_image015" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/1055.clip_image015_thumb_0C617A80.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/1055.clip_5F00_image015_5F00_thumb_5F00_0C617A80.jpg" alt="clip_image015" width="603" height="144" border="0" /></a></p>
<p>At this point, we&rsquo;re going to put or &lsquo;apply&rsquo; the captured image from the source VHDX into the Windows partition on the new VHDX, drive letter Z: in my walkthrough. Run the following from an elevated command prompt:</p>
<p><span style="font-family: courier new;">dism /apply-image /imagefile:captured.wim /applydir:z:\ /index:1</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/5287.clip_image017_3E591B0A.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/5287.clip_5F00_image017_5F00_3E591B0A.jpg"><img style="display: inline;" title="clip_image017" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/2134.clip_image017_thumb_332F90C0.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/2134.clip_5F00_image017_5F00_thumb_5F00_332F90C0.jpg" alt="clip_image017" width="602" height="111" border="0" /></a></p>
<p>This will take some time depending on the size of the capture image and your storage subsystem performance.</p>
<p>Now we need to configure the ESP (EFI System Partition) on the target VHDX. Run the following from an elevated command prompt, where Z: is the target Windows partition and Y: is the target ESP. To be safe, it would be prudent to running bcdboot from the <em><span style="text-decoration: underline;">source</span></em> operating system, not the one on the parent partition, just in case of incompatibilities.</p>
<p><span style="font-family: courier new;">Z:\Windows\System32\bcdboot Z:\Windows /s Y: /f UEFI</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/2548.clip_image019_13148403.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/2548.clip_5F00_image019_5F00_13148403.jpg"><img style="display: inline;" title="clip_image019" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/1376.clip_image019_thumb_450C248D.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/1376.clip_5F00_image019_5F00_thumb_5F00_450C248D.jpg" alt="clip_image019" width="604" height="49" border="0" /></a></p>
<p>At this point, let&rsquo;s do a quick recap of where we are. We have</p>
<ul>
<li>Created a new VHDX</li>
<li>Made it GPT and partitioned it.</li>
<li>Put a copy of the original Windows installation onto it</li>
<li>Created/configured a new BCD store to make the new Windows installation boot</li>
</ul>
<p>A couple more things to do before we can see if the new VHDX actually works in a generation 2 VM. First we need to perform a workaround for a bug in Windows to avoid the drive letter for the ESP on the new VHDX persisting after an unmount. (If you don&rsquo;t do this, the drive letter will persist and you&rsquo;ll have to reboot your parent partition to get rid of it). Then we can unmount it. From an elevated PowerShell prompt run the following. Change NNNN to refer to the disk number of the new VHDX. PartitionNumber is 3 as that is where the ESP is based on our diskpart script from earlier. Y is the temporary drive letter (again in the diskpart script) we used for the ESP.</p>
<p><span style="font-family: Courier New;">Remove-PartitionAccessPath &ndash;DiskNumber <span style="color: #ff0000;">NNNN</span> &ndash;PartitionNumber 3 &ndash;AccessPath Y:\ <br />Dismount-DiskImage c:\working\migated.vhdx</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/2047.clip_image021_24F117D0.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/2047.clip_5F00_image021_5F00_24F117D0.jpg"><img style="display: inline;" title="clip_image021" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/0804.clip_image021_thumb_47B4E03E.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/0804.clip_5F00_image021_5F00_thumb_5F00_47B4E03E.jpg" alt="clip_image021" width="606" height="39" border="0" /></a></p>
<p>Some of you may be asking why I even assigned a drive letter X: above as I didn&rsquo;t touch the recovery partition. It&rsquo;s more for completeness, and when I was also playing around with the recovery environment. You don&rsquo;t need that drive letter to follow along.</p>
<p>As we no longer need from the source VHDX, we can dismount it by running the following from our elevated PowerShell prompt:</p>
<p><span style="font-family: courier new;">dismount-vhd .\migrateme.vhdx</span></p>
<p>Now we&rsquo;ll create a new generation 2 VM using a similar configuration to the source VM, but attaching our migrated VHDX. I won&rsquo;t walk you through that (as you all know how to do it&hellip;), but here it is:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/8726.clip_image023_12A8510E.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/8726.clip_5F00_image023_5F00_12A8510E.jpg"><img style="display: inline;" title="clip_image023" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/8738.clip_image023_thumb_4E67E9C1.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/8738.clip_5F00_image023_5F00_thumb_5F00_4E67E9C1.jpg" alt="clip_image023" width="513" height="513" border="0" /></a></p>
<p>Let&rsquo;s fire it up and see what happens!</p>
<p>&hellip;The good news is that it boots. <br />&hellip;You see the spinny dots under the Hyper-V UEFI firmware logo <br />&hellip;The screen goes blank <br />&hellip;More spinny dots <br />&hellip;&rdquo;Getting devices ready&rdquo;</p>
<p>(Can you feel the tension building? J)</p>
<p>&hellip;&rdquo;Getting ready&rdquo; <br />&hellip;&rdquo;Hi&rdquo; <br />&hellip;&ldquo;While we&rsquo;re getting things ready&rdquo; <br />&hellip;&ldquo;Check out the new way to use Windows&rdquo; <br />&hellip;&rdquo;After your PC is Ready&rdquo;</p>
<p>and so on until</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/7752.clip_image025_4748AD49.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/7752.clip_5F00_image025_5F00_4748AD49.jpg"><img style="display: inline;" title="clip_image025" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4213.clip_image025_thumb_551AF344.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4213.clip_5F00_image025_5F00_thumb_5F00_551AF344.jpg" alt="clip_image025" width="609" height="518" border="0" /></a></p>
<p>SUCCESS!!! We can see the desktop background is from our original virtual machine. Let&rsquo;s take a look in Windows Explorer and diskmgmt.msc to see:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4135.clip_image026_66F78711.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4135.clip_5F00_image026_5F00_66F78711.png"><img style="display: inline;" title="clip_image026" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/7762.clip_image026_thumb_0DC59D52.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/7762.clip_5F00_image026_5F00_thumb_5F00_0DC59D52.png" alt="clip_image026" width="619" height="659" border="0" /></a></p>
<p>We have had the nice side effect of having resized our Windows partition as well. Unfortunately Disk Management doesn&rsquo;t show all partitions, so let&rsquo;s open diskpart from an elevated command prompt to take a closer look.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/1732.clip_image028_3493B392.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/1732.clip_5F00_image028_5F00_3493B392.jpg"><img style="display: inline;" title="clip_image028" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4478.clip_image028_thumb_5B61C9D2.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4478.clip_5F00_image028_5F00_thumb_5F00_5B61C9D2.jpg" alt="clip_image028" width="642" height="389" border="0" /></a></p>
<p>Remember that the above process did not create a recovery partition for PBR. You should adjust the procedures above following ADK guidance if that is how you need the target virtual machine configured.</p>
<p>Remember also that we didn&rsquo;t enable the recovery tools. We can see that it is configured by attempting to boot into RE.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/5040.clip_image030_17216286.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/5040.clip_5F00_image030_5F00_17216286.jpg"><img style="display: inline;" title="clip_image030" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/6138.clip_image030_thumb_1002260E.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/6138.clip_5F00_image030_5F00_thumb_5F00_1002260E.jpg" alt="clip_image030" width="491" height="79" border="0" /></a></p>
<p>Re-enabling is fairly straightforward. Here we enable RE, show it&rsquo;s enabled and set the system to boot next time to RE.</p>
<p><span style="font-family: courier new;">reagentc /enable <br />reagentc /info <br />reagentc /boottore</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/3580.clip_image032_64BD8F06.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/3580.clip_5F00_image032_5F00_64BD8F06.jpg"><img style="display: inline;" title="clip_image032" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/5148.clip_image032_thumb_0B8BA547.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/5148.clip_5F00_image032_5F00_thumb_5F00_0B8BA547.jpg" alt="clip_image032" width="645" height="359" border="0" /></a></p>
<p>And a reboot shows that the recovery environment is working.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4162.clip_image034_5927D1C7.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4162.clip_5F00_image034_5F00_5927D1C7.jpg"><img style="display: inline;" title="clip_image034" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/2746.clip_image034_thumb_5208954F.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/2746.clip_5F00_image034_5F00_thumb_5F00_5208954F.jpg" alt="clip_image034" width="653" height="488" border="0" /></a></p>
<p>What remains at this point is for you to mirror the virtual machine configuration such as advanced networking, processors, storage and so on from the source generation 1 virtual machine to the target generation 2 virtual machine.</p>
<p>So that&rsquo;s it. Although somewhat involved, that is what it takes to convert a workload from generation 1 to generation 2. You may, of course, decide that a clean installation may be simpler.</p>
<p>The last thing I wanted to touch on was the inevitable question that some of you will no-doubt ask when manually walking through these steps on your own VM. The one of &ldquo;I forgot to disable RE before migration &ndash; how do I fix it up?&rdquo;. Below are my rough notes more than anything else, especially as sources of information on this are a little thin on the ground that I could find. But hopefully it will give you some good pointers on what to look. It certainly is possible to re-create the right entries manually. I&rsquo;ve done it, but this isn&rsquo;t a walkthrough as such. There is some tight coupling between the RE configuration held on the file-system and in BCD. Note that this method is UNSUPPORTED &ndash; the supported way is to go back to the start, run reagent /disable before starting the migration, and /enable once the migration is complete.</p>
<p>The first thing to know is when RE is configured, winre.wim is moved to the recovery tools partition. As we didn&rsquo;t migrate that, it won&rsquo;t be present in the Windows partition on the target. You can grab that from the source VHDX loopback mounted. It will be present under \Recovery\{GUID} or \Recovery\WindowsRE, generally in the system partition of a PCAT system. It will be in a hidden directory, and may be marked as a system file. Further, the partition is hidden so you will need to assign a drive letter. Let&rsquo;s assume you have the source VHDX in my example loopback mounted to drives H: and I: this time (it was G: and H: during the earlier part of this walkthrough). The Windows installation is on drive I:, the System Reserved partition is on drive H:</p>
<p>Here&rsquo;s how you would backtrack from a mounted VHDX of a generation 1 virtual machine which still has RE enabled. From the output of reagentc, you can determine the status (enabled), the location, and the BCD GUID.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/3326.clip_image036_78D6AB8F.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/3326.clip_5F00_image036_5F00_78D6AB8F.jpg"><img style="display: inline;" title="clip_image036" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/1263.clip_image036_thumb_58BB9ED2.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/1263.clip_5F00_image036_5F00_thumb_5F00_58BB9ED2.jpg" alt="clip_image036" width="580" height="179" border="0" /></a></p>
<p>From the location, we can use diskpart (even though we happen to already know it&rsquo;s on drive H: ) to find the drive letter where the WinRE WIM file will be located.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/6562.clip_image038_668DE4CD.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/6562.clip_5F00_image038_5F00_668DE4CD.jpg"><img style="display: inline;" title="clip_image038" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4428.clip_image038_thumb_74602AC8.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4428.clip_5F00_image038_5F00_thumb_5F00_74602AC8.jpg" alt="clip_image038" width="589" height="228" border="0" /></a></p>
<p>And if we examine the H: drive, we can see WinRE.WIM is present, just in a hidden folder.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/5008.clip_image040_54451E0B.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/5008.clip_5F00_image040_5F00_54451E0B.jpg"><img style="display: inline;" title="clip_image040" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4011.clip_image040_thumb_4D25E193.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4011.clip_5F00_image040_5F00_thumb_5F00_4D25E193.jpg" alt="clip_image040" width="592" height="555" border="0" /></a></p>
<p>So that&rsquo;s where you would grab winre.wim from. Put a copy (removing the system and hidden attribute using attrib &ndash;s &ndash;h) in \windows\system32\recovery on the new windows installation.</p>
<p>For completeness, go back to the screenshot of reagentc output which also lists the GUID for the BCD entry which we can examine using bcdedit pointing to the BCD database. There is an OSLoader entry present, which you can see is for PCAT due to the use of winload.exe, not winload.efi:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/5582.clip_image042_5AF8278E.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/5582.clip_5F00_image042_5F00_5AF8278E.jpg"><img style="display: inline;" title="clip_image042" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/8228.clip_image042_thumb_68CA6D89.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/8228.clip_5F00_image042_5F00_thumb_5F00_68CA6D89.jpg" alt="clip_image042" width="589" height="211" border="0" /></a></p>
<p>And if you look carefully where I&rsquo;ve circled, the entry refers to another GUID. By default the first 8 digits are +1 in hex, so here you see the 8<sup>th</sup> digit &ldquo;F&rdquo; for the GUID entry with the 8<sup>th</sup> digit &ldquo;E&rdquo;. (This isn&rsquo;t a requirement if you were to manually rebuild the BCD entries)</p>
<p>If you look at that other device entry, you can see it&rsquo;s a ramdisk device.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4527.clip_image044_0F9883CA.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4527.clip_5F00_image044_5F00_0F9883CA.jpg"><img style="display: inline;" title="clip_image044" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4540.clip_image044_thumb_1D6AC9C5.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4540.clip_5F00_image044_5F00_thumb_5F00_1D6AC9C5.jpg" alt="clip_image044" width="598" height="108" border="0" /></a></p>
<p>And finally, the other piece of the puzzle is in the UTF-8 encoded file \windows\system32\recovery\reagent.xml.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4431.clip_image046_4438E005.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4431.clip_5F00_image046_5F00_4438E005.jpg"><img style="display: inline;" title="clip_image046" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/0638.clip_image046_thumb_0F2C50D5.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/0638.clip_5F00_image046_5F00_thumb_5F00_0F2C50D5.jpg" alt="clip_image046" width="607" height="288" border="0" /></a></p>
<p>I&rsquo;ve circled a few things. One is the path to WinRE.wim. Next is some ID starting 313 which I&rsquo;ll come to in a second. Offset is a partition byte offset, and if you go back to the diskpart screenshot above, you can see it&rsquo;s where the recovery tools partition starts on the disk. And also the InstallState indicating it is on. What&rsquo;s that ID? And why does WinreLocation have a null GUID in it? The answer is simple, it&rsquo;s the disk ID of the disk on an MBR disk. On a GPT disk, the ID would be zero, and the GUID populated instead. (You can find disk IDs from diskpart, select disk n, detail disk.)</p>
<p>So now we know what we need to fix up in the migrated VHDX. Unfortunately reagentc is a little &ldquo;temperamental&rdquo; and needs a little coaxing (in other words, it tends to just fail without much information as to why). What you <em>could</em> do is manually recreate each of the BCD entries by hand, and recraft reagent.xml in notepad carefully to match. That (trust me having walked through it) is painful.</p>
<p>Bearing in mind that the new VHDX will not have any recovery BCD entries (OSLoader or Device), we will let reagentc do the work for us instead. We&rsquo;ll do this inside the migrated VM. Keep a copy of reagent.xml, just in case, then with notepad (it&rsquo;s not that friendly though as you will see), carefully edit reagent.xml to change the three circled values to look like the following:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/7585.clip_image048_1CFE96D0.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/7585.clip_5F00_image048_5F00_1CFE96D0.jpg"><img style="display: inline;" title="clip_image048" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/1222.clip_image048_thumb_7CE38A12.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/1222.clip_5F00_image048_5F00_thumb_5F00_7CE38A12.jpg" alt="clip_image048" width="598" height="286" border="0" /></a></p>
<p>Now you can simply use reagentc to enable WinRE (make sure you did copy winre.wim to the \windows\system32\recovery folder first). I&rsquo;ll follow the same path to follow through what changes have been made. Reagent.xml now has a populated WinreBCD and WinreLocation, and InstallState is 1.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/2783.clip_image050_23B1A053.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/2783.clip_5F00_image050_5F00_23B1A053.jpg"><img style="display: inline;" title="clip_image050" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/8640.clip_image050_thumb_03969396.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/8640.clip_5F00_image050_5F00_thumb_5F00_03969396.jpg" alt="clip_image050" width="613" height="331" border="0" /></a></p>
<p>From the output above, confirming the GUID of the disk (starting daf2&hellip;) containing a hidden utility partition for recovery.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/5047.clip_image052_1168D991.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/5047.clip_5F00_image052_5F00_1168D991.jpg"><img style="display: inline;" title="clip_image052" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/2804.clip_image052_thumb_714DCCD3.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/2804.clip_5F00_image052_5F00_thumb_5F00_714DCCD3.jpg" alt="clip_image052" width="622" height="339" border="0" /></a></p>
<p>And the partition can be determine from the offset (135266304). I&rsquo;m going to give the partition a drive letter temporarily (R:). You can remove this latter using the diskpart &ldquo;remove&rdquo; command.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/5531.clip_image054_7F2012CE.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/5531.clip_5F00_image054_5F00_7F2012CE.jpg"><img style="display: inline;" title="clip_image054" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/6102.clip_image054_thumb_25EE290F.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/6102.clip_5F00_image054_5F00_thumb_5F00_25EE290F.jpg" alt="clip_image054" width="632" height="376" border="0" /></a></p>
<p>Confirming the right files are in the \recovery\{GUID} path</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/6840.clip_image056_33C06F0A.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/6840.clip_5F00_image056_5F00_33C06F0A.jpg"><img style="display: inline;" title="clip_image056" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4786.clip_image056_thumb_65B80F94.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4786.clip_5F00_image056_5F00_thumb_5F00_65B80F94.jpg" alt="clip_image056" width="640" height="78" border="0" /></a></p>
<p>And now examining the BCD store entries.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4466.clip_image058_459D02D7.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4466.clip_5F00_image058_5F00_459D02D7.jpg"><img style="display: inline;" title="clip_image058" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4370.clip_image058_thumb_536F48D2.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4370.clip_5F00_image058_5F00_thumb_5F00_536F48D2.jpg" alt="clip_image058" width="643" height="342" border="0" /></a></p>
<p>Notice again the &ldquo;+1&rdquo;, and that the path is to an EFI application for the loader.</p>
<p>So that&rsquo;s pretty much how to convert from a generation 1 to a generation 2 virtual machine in circumstances where it is possible. For a <em><span style="text-decoration: underline;">much</span></em> easier option, you might want to wait just a little longer :)&nbsp; In the next part, part 9, I&rsquo;ll talk about booting from ISO media.</p>
<p>Cheers, <br />John.</p>]]></content:encoded>
    </item>
    <item>
      <title>Hyper-V generation 2 virtual machines – part 7</title>
      <link>https://docs.microsoft.com/archive/blogs/jhoward/hyper-v-generation-2-virtual-machines-part-7</link>
      <pubDate>Mon, 04 Nov 2013 12:31:00 GMT</pubDate>
      <dc:creator><![CDATA[John Howard -MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jhoward/2013/11/04/hyper-v-generation-2-virtual-machines-part-7/</guid>
      <description><![CDATA[Part 1: Introduction to generation 2 virtual machines Part 2: Networking and boot order Part 3:...]]></description>
      <content:encoded><![CDATA[<p><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/24/hyper-v-generation-2-virtual-machines-part-1.aspx">Part 1: Introduction to generation 2 virtual machines</a> <br><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/25/hyper-v-generation-2-virtual-machines-part-2.aspx">Part 2: Networking and boot order</a> <br><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/28/hyper-v-generation-2-virtual-machines-part-3.aspx">Part 3: Storage</a> <br><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/29/hyper-v-generation-2-virtual-machines-part-4.aspx">Part 4: Keyboard for Windows 8 &amp; Windows Server 2012</a> <br><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/31/hyper-v-generation-2-virtual-machines-part-5.aspx">Part 5: Kernel debugging</a> <br><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/01/hyper-v-generation-2-virtual-machines-part-6.aspx">Part 6: Secure Boot</a> <br><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/04/hyper-v-generation-2-virtual-machines-part-7.aspx">Part 7: FAQ</a> <br><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/06/hyper-v-generation-2-virtual-machines-part-8.aspx">Part 8: Manually migrating generation 1 virtual machines to generation 2</a> <br><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/11/hyper-v-generation-2-virtual-machines-part-9.aspx">Part 9: Installing from ISO</a> <br><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/14/hyper-v-generation-2-virtual-machines-part-10.aspx">Part 10: Utility for converting generation 1 virtual machines to generation 2 (Convert-VMGeneration)</a><p>This part of the series on generation 2 virtual machines provides answers to general questions. Most, I provided to our writers a little while ago, and have since worked their way into official documentation at <a href="http://technet.microsoft.com/en-us/library/dn282285.aspx">http://technet.microsoft.com/en-us/library/dn282285.aspx</a>. Technet documentation can sometimes deliberately be a little sparse, so I&rsquo;ve augmented some of the answers where appropriate. Some of these Q&amp;As have already been mentioned in previous parts, but it makes sense to keep them all in one spot.</p><p>These are in no particular order.</p><h4>Q: How can I do kernel debugging of a generation 2 virtual machine?</h4><p><strong></strong>A: See part five for a detailed answer.</p><h4>Q: During installation of Windows 8 64-bit or Windows Server 2012, the keyboard is not active</h4><p><br>A: See part four for a detailed answer.</p><h4>Q: Is RemoteFX supported by generation 2 virtual machines?</h4><p><br>A: No. The reason is that there is a dependency on PCI in the RemoteFX stack. PCI is not present in generation 2 virtual machines, and it was not possible to remove this dependency in the timeframe and resources available for the Windows 8.1 release cycle.</p><h4>Q: Why can&rsquo;t I use a physical CD/DVD in a generation 2 virtual machine?</h4><p><br>A: We dropped support for physical CD/DVD passthrough in generation 2 virtual machines as the majority of end users now use .ISO files, or build VMs from templates. Physical device support is also problematic in migration scenarios. The new SCSI DVD drive in generation 2 virtual machines supports features not supported by the IDE DVD drive such as hot-add remove, and is not limited to a maximum of four devices.</p><h4>Q: Can I use .VHDs in a generation 2 virtual machine?</h4><p><br>A: Without conversion, no. But see following Q&amp;As also. VHDs are not supported in generation 2 virtual machines, only VHDX files are. You can convert an existing VHD used by a generation 1 virtual machine to a VHDX using the Convert-VHD cmdlet, and use that in certain scenarios in a generation 2 VM.</p><h4>Q: Will a VHD converted to VHDX work in a generation 2 virtual machine?</h4><p><br>A: If it is a data disk (ie not an OS bootable disk), then absolutely. If it is an OS bootable disk, then it can be used as a data disk but will not boot, even if the guest operating system is one which is supported by generation 2 virtual machines. A clean operating system installation is required in this scenario along with application migration.</p><h4>Q: Can I attach a VHDX from a generation 2 virtual machine to a generation 1 virtual machine?</h4><p><br>A: Absolutely. VHDX is just a disk container, so there is nothing stopping you attaching it as a data disk to a generation 1 virtual machine and using a different guest operating system to examine the contents. Of course, it requires that the guest operating system is aware of the file system in that VHDX.</p><h4>Q: Can I perform a network installation in a generation 2 virtual machine using IPv6?</h4><p><br>A: Absolutely. In an elevated PowerShell prompt, run Set-VMFirmware &ndash;VMName &lt;Name of VM&gt; -IPProtocolPreference IPv6. Note that this will change the protocol for ALL network adapters in the VM &ndash; you cannot for example have the VM attempt an IPv4 boot from the first network adapter, and IPv6 on the second network adapter.</p><h4>Q: How can I programmatically determine the generation of a virtual machine?</h4><p><br>A: See part one of this series for examples</p><h4>Q: Can I still use a virtual floppy disk to contain an unattended install answer file in a generation 2 virtual machine?</h4><p><br>A: No as floppy disk drive support is not present in generation 2 virtual machines. However, unattended installation supports alternate removable media including .ISO files which can be placed in a virtual DVD drive.</p><h4>Q: Can I iSCSI boot a generation 2 virtual machine?</h4><p><br>A: No, you can only boot from SCSI-attached disk, .ISO attached to a CD/DVD device, or from network</p><h4>Q: Can I boot a generation 2 virtual machine from a virtual FC adapter?</h4><p><br>A: No, you can only boot from SCSI-attached disk, .ISO attached to a CD/DVD device, or from network</p><h4>Q: Can I use large VHDX files in generation 2 virtual machines.</h4><p><br>A: Absolutely, all the way up to the limit of 64TB imposed by VHDX. Large VHDXs can be used as both boot and data disks.</p><h4>Q: Can I &ldquo;loopback mount&rdquo; (ie expose in the parent partition) a VHDX used by a generation 2 virtual machine?</h4><p><br>A: Absolutely. A VHDX is a file format and not tied to a specific virtual machine generation. As such, you can loopback mount a generation 2 virtual machines VHDX exactly the same as for a generation 1 virtual machine.</p><h4>Q: Can I create a VHDX which can be used to boot both a generation 1 and 2 virtual machine?</h4><p><br>A: Technically, this is possible. In fact, Windows to go in Windows 8 Enterprise used such a mechanism to craft a disk layout which works exactly in this way. However, there are limitations, not the least of which is that in the Hyper-V scenario, we have not tested this, neither is it supported. Some of the limitations include the inability to perform service pack installation or operating system upgrade. Additional side effects would be that duplicate BCD stores are required, and mirroring between them is not honoured. Hence some updates may be lost.</p><h4>Q: Can I export a generation 2 virtual machine from a Windows 8.1/Windows Server 2012 R2 server, and import it into/start it on a machine running Windows 8 or Windows Server 2012 Hyper-V?</h4><p><br>A: No, as generation 2 virtual machines are a new feature in Windows 8.1 &amp; Windows Server 2012 R2.</p><h4>Q: What is the dependency between UEFI in a generation 2 virtual machine and the physical platform firmware?</h4><p><br>A: None. The firmware exposed in a Hyper-V virtual machine (mostly) has no correlation to the firmware on the physical platform. Hence there is no requirement for the physical server to have UEFI firmware or support Secure Boot to support both of these features in a generation 2 virtual machine.</p><h4>Q: Do generation 2 virtual machines support <a href="http://msdn.microsoft.com/en-us/library/windows/hardware/br259097.aspx">Measured Boot</a>?</h4><p><br>A: No. But they support the closely related Secure Boot capability. Measured Boot has a dependency on a TPM (Trusted Platform Module) which is not present in a generation 2 (or generation 1 for that matter) virtual machine.</p><h4>Q: Can I run &lt;insert arbitrary UEFI application&gt; in a generation 2 virtual machine?</h4><p><br>A: Probably, although it is unsupported and untested. We don&rsquo;t, for example, provide a UEFI shell or other applications which almost certainly would run in a generation 2 virtual machine, assuming that secure boot was disabled for that VM. The only &ldquo;UEFI applications&rdquo; (used loosely) we support in a generation 2 virtual machines are operating system loaders for supported operating systems.</p><h4>Q: Where is Secure Boot setup mode for a generation 2 virtual machine?</h4><p><br>A: We only support user mode. PK/KEK and the global db/dbx variables cannot be updated. See part six of this series for detailed information on Secure Boot.</p><h4>Q: Where are NVRAM variables held?</h4><p><br>A: On a physical UEFI platform, non-volatile memory is used to store variables. In Hyper-V, NVRAM variables are stored (for the most part, and part 6 has more information on Secure Boot variables) in the configuration file for the virtual machine. NVRAM variables include, but are not limited to, boot entries. Note this is quite different to generation 1 virtual machines.</p><h4>Q: Can I use a passthrough (physical) disk in a generation 2 virtual machine?</h4><p><br>A: Yes. However, we strongly recommend these are not used unless absolutely necessary. It is possible that passthrough disk support may be deprecated in a future release. In reality, the fixed VHDX file format has comparable I/O performance, so there really is little need for the use of a passthrough disk.</p><h4>Q: What is the default generation of a new virtual machine?</h4><p><br>A: The default generation is 1 so that we didn&rsquo;t break backwards compatibility with existing scripts. In PowerShell, to create a generation 2 virtual machine, use &ldquo;&ndash;Generation 2&rdquo; as a parameter to New-VM.</p><h4>Q: How can I change the generation of an existing virtual machine</h4><p><br>A: This is not possible (at least inbox). Generally a clean install and application migration is required. This topic will be covered in a lot more detail in part eight.</p><h4>Q: Is it possible to run both generation 1 and generation 2 virtual machines on the same server.</h4><p><br>A: Absolutely. This is entirely possible and fully supported.</p><h4>Q: Windows installation fails in a generation 2 virtual machine</h4><p><br>A: Make sure your VM has the minimum amount of memory assigned according to the requirements of the operating system. (Unfortunately, creating a new virtual machine using the defaults in the new virtual machine wizard and the New-VM cmdlet is 512MB which is less than the required memory for Windows 8 and Windows 8.1 and their server counterparts.)</p><h4>Q: Why don&rsquo;t we support 64-bit Windows 7 or Windows Server 2008 R2 as a guest operating system in generation 2 virtual machines?</h4><p><br>A: Certainly it is true that Windows 7 support UEFI, the first requirement for generation 2 virtual machines. However, Windows 7 has a hardware dependency on a Programmable Interrupt Controller (PIC) which is not present in generation 2 virtual machines. Even if Secure Boot is disabled, an attempt to install Windows 7 will result in an apparent hang at &ldquo;Starting Windows&rdquo; shortly after boot, consuming 100% VP utilisation. A similar effect to this will be seen if attempting a network install from a WDS server which has a Windows 7 era boot PE image &ndash; network boot will appear to hang as well. For that reason (along with the keyboard issue in Windows 8 PE) I strongly recommend any WDS server are upgraded to the Windows 8.1 PE boot image.</p><h4>Q: When is Linux going to be supported in a generation 2 virtual machine</h4><p><br>A: Linux support is being worked on as of writing. Currently, 64-bit versions of Windows 8 and 8.1, or Windows Server 2012 and Windows Server 2012 R2 are supported guest operating systems.</p><h4>Q: I can install Windows 8 and 8.1 32-bit on my OEM UEFI computer. Why doesn&rsquo;t it install in a generation 2 virtual machine?</h4><p><br>A: See part one of this series. Our UEFI implementation is &ldquo;Class 3&rdquo; and does not have a Compatibility Support Module. In Hyper-V, 32-bit guest operating systems are only supported in generation 1 virtual machines.</p><h4>Q: How many network adapters can a generation 2 virtual machine have?</h4><p><br>A: Eight. Generation 2 virtual machines do not support legacy network adapters. (Note in generation 1 virtual machines, legacy network adapters are only recommended for use during network installation of the guest operating system)</p><h4>Q: Will application &ldquo;A&rdquo; run the same in a generation 2 virtual machine as it does in a generation 1 virtual machine?</h4><p><br>A: Yes. From a <em>generic</em> application perspective, there is no difference between VM generation. It&rsquo;s no different to asking if the application will run the same on both an EFI and BIOS based physical machine.</p><h4>Q: I use virtual switch extension &ldquo;X&rdquo; from vendor &ldquo;Y&rdquo;. Will it still work with generation 2 virtual machines?</h4><p><br>A: Yes, switch extensions are entirely on the parent partition side. Switch extensions are agnostic of, and orthogonal to the virtual machine generation.</p><h4>Q: How many SCSI storage devices can I attach to a generation 2 virtual machine?</h4><p><br>A: A generation 2 virtual machine can have up to 4 SCSI controllers, each with 64 devices attached. Hence the maximum is 256. Note that this can be made up of any combination of VHDX, passthrough disk (see caveat in previous Q&amp;As) or CD/DVD. Generation 2 virtual machines are not limited to four CD/DVD devices in the same way that generation 1 virtual machines are.</p><h4>Q: Why doesn&rsquo;t a newly created generation 2 VM boot from a Windows ISO automatically when a generation 1 VM did?</h4><p><br>A: See part nine of this series. Sorry to keep you in suspense ;)</p><h4>Q: What about performance comparisons between generation 1 and generation 2 virtual machines?</h4><p><br>A: First the official answer. &ldquo;Do not expect any performance differences between generation 1 and 2 virtual machines.&rdquo; And this is certainly true at run-time when a guest workload is doing what it does, for both server and client operating systems. However, and explicitly NOT quoting numbers as they are not relevant, you <em><span style="text-decoration: underline;">may</span></em> see increased performance in two areas.</p><ol>
<li>During guest operating system boot. There are a couple of reasons for this. One is that our UEFI firmware initialises faster than our PCAT BIOS. Also in a generation 1 virtual machine, during the initial part operating system start, while the storage fast-path filter is not loaded in the guest, I/O is using emulation which has more overhead. Generation 2 virtual machines always use VMBus for I/O.</li>
<li>During guest operating system installation from ISO or network. For the same reasons as above, there is no emulation required.</li>
</ol><p>&nbsp;</p><h4>Q: I&rsquo;ve developed a WMI or PowerShell script using documented Hyper-V APIs. Will it work with generation 2 virtual machines?</h4><p><br>A: Possibly! However, the modifications needed should be minor if they don&rsquo;t work. The main areas where scripts may need modification:</p><ul>
<li>Take account of New-VM with the generation parameter and the corresponding attribute on Get-VM; In WMI it&rsquo;s the VirtualSystemSubType field in the Msvm_VirtualSystemSettingData class you need to be aware of. See part one for more information.</li>
<li>Anywhere you use Set-VMBios needs replacing with appropriate calls to Set-VMFirmware;</li>
<li>Any references to legacy NIC will fail. Use a software based network adapter instead.</li>
<li>References to IDE based storage will fail (eg Get-VMHardDiskDrive). Use the SCSI equivalent instead.</li>
</ul><p>&nbsp;</p><h4>Q: What generation should I choose when creating a new virtual machine?</h4><p><br>A: Well really this depends on too many things to be prescriptive. There is no single right answer and my answer below should be taken as non-exhaustive examples of thoughts you should have when making the choice. <br> <br>In this answer, I&rsquo;m constraining myself to <em>just </em>Hyper-V functionality. This means I will not be considering any higher level management layers, integration, processes, template/library, third party applications support (backup for example &ndash; does it support EFI systems?), public cloud, or any other IT infrastructure you may have in place. Nor am I considering heterogeneous virtualization environments, whether that means interoperability/interchange with previous versions of Hyper-V or any other virtualization platform. You should however <strong>NOT</strong> ignore any of these, or other potentially relevant consideration!</p><ul>
<li>Obviously, the guest operating system and architecture must be supported by generation 2 VMs.</li>
<li>Consider the improvements to generation 2 VMs and see if you answer yes to any of these example questions: Is Secure Boot important to you? Is a reduced attack surface important to you? Are the performance characteristics mentioned above important to you? Do you require IPv6 network installation? Am I likely to need to expand the boot disk of a VM at run time?</li>
<li>Consider the longer term direction Microsoft is going to move to (given we are more likely to invest in newer capabilities that are generation 2 specific in future releases). Does it make sense to embrace generation 2 VMs now knowing they will be with us for a long while to come?</li>
<li>Consider the Hyper-V features you use. Unless the VM requires RemoteFX, everything you can do in a generation 1 VM, you can also do in a generation 2 VM.</li>
<li>After that, it comes down to a case of the end-user scenario. I&rsquo;ll give two broad examples &ndash; a generic server and a generic client role.</li>
<ul>
<li>Server: Windows Server 2008 was the last shipped version of Windows Server available in 32-bit. However, given Windows Server 2008 is not supported in generation 2 VMs, to all intents and purposes, for Windows Server, this means you are deploying a 64-bit operating system. There is little reason not to deploy Windows Server 2012 or 2012 R2 as a generation 2 VM with one exception. That being the case of replica to Windows Azure as generation 2 VMs are not currently supported by Windows Azure.</li>
<li>Client: From a memory perspective, 64-bit operating systems tend to use more memory than their 32-bit counterparts. Hence your overall memory footprint may be more using generation 2 virtual machines. However, please remember the many advantages in 64-bit Windows which may well outweigh the additional memory requirements.</li>
</ul>
</ul><p>&nbsp;</p><h4>Q: OK, so I&rsquo;ll move to generation 2. But am I going to have to go through the same in a future release with generation 3?</h4><p><br>A: Well anything is possible, and as you know, I can&rsquo;t talk about anything we haven&rsquo;t released. However, the reason for generation 2 was to build a platform for the future, so they will be with us for a long while yet. As the underlying firmware is so different between generation 1 and generation 2, realistically it&rsquo;s unlikely we would introduce a generation 3 unless there&rsquo;s a UEFI replacement round the corner, or there&rsquo;s some truly fundamental other hardware change we need to do to the virtual machine container. It&rsquo;s reasonably safe to say moving to generation 2 will get you to the point where newer Hyper-V features in future releases are more likely to light up in generation 2 virtual machines, and less likely to be enabled for generation 1 virtual machines.</p><p>&nbsp;</p><p>The next topic in this series is a big one. Start your coffee brewing now. It&rsquo;s all about manually converting a generation 1 virtual machine to generation 2.</p><p>Cheers, <br>John.</p></p>
]]></content:encoded>
    </item>
    <item>
      <title>Hyper-V generation 2 virtual machines – part 6</title>
      <link>https://docs.microsoft.com/archive/blogs/jhoward/hyper-v-generation-2-virtual-machines-part-6</link>
      <pubDate>Fri, 01 Nov 2013 11:52:00 GMT</pubDate>
      <dc:creator><![CDATA[John Howard -MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jhoward/2013/11/01/hyper-v-generation-2-virtual-machines-part-6/</guid>
      <description><![CDATA[Part 1: Introduction to generation 2 virtual machines Part 2: Networking and boot order Part 3:...]]></description>
      <content:encoded><![CDATA[<p><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/24/hyper-v-generation-2-virtual-machines-part-1.aspx">Part 1: Introduction to generation 2 virtual machines</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/25/hyper-v-generation-2-virtual-machines-part-2.aspx">Part 2: Networking and boot order</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/28/hyper-v-generation-2-virtual-machines-part-3.aspx">Part 3: Storage</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/29/hyper-v-generation-2-virtual-machines-part-4.aspx">Part 4: Keyboard for Windows 8 &amp; Windows Server 2012</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/31/hyper-v-generation-2-virtual-machines-part-5.aspx">Part 5: Kernel debugging</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/01/hyper-v-generation-2-virtual-machines-part-6.aspx">Part 6: Secure Boot</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/04/hyper-v-generation-2-virtual-machines-part-7.aspx">Part 7: FAQ</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/06/hyper-v-generation-2-virtual-machines-part-8.aspx">Part 8: Manually migrating generation 1 virtual machines to generation 2</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/11/hyper-v-generation-2-virtual-machines-part-9.aspx">Part 9: Installing from ISO</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/14/hyper-v-generation-2-virtual-machines-part-10.aspx">Part 10: Utility for converting generation 1 virtual machines to generation 2 (Convert-VMGeneration)</a></p>
<p>This part of the series on generation 2 virtual machines in Hyper-V looks at a new feature &ndash; Secure Boot. Secure Boot is essentially a signature checking mechanism during the OS loader to validate that only approved components are allowed to be run. Secure Boot is defined as part of the UEFI specification. Hyper-V implements a subset which allows Windows 8 and Windows 8.1 with default policies to load in a virtual machine with Secure Boot enabled.</p>
<p>While I&rsquo;m not going into huge detail about how Secure Boot works, it essentially comes down to the contents of four NVRAM variables, some of which are read-only, other read/write. (There are a few other variables in NVRAM too.) The four variables of relevance are:</p>
<h4>PK</h4>
<p>The public platform key. This contains the public half of the platform key pair, PK<sub>pub</sub>, which allows the platform &ldquo;owner&rdquo; (think of this as the OEM, or in the Hyper-V case, Microsoft), who has the private half of the key, PK<sub>priv.</sub> to change platform ownership or enroll a Key Exchange Key. In the physical world, the OEM will keep PK<sub>priv</sub> private. This is no different in our implementation - the key pair was generated/signed by the Microsoft corporate PKI infrastructure and the private key secured appropriately.</p>
<h4>KEK</h4>
<p>The Key Exchange Key signature database. The keys in this database establish a trust relationship between the operating system and the platform firmware. In other words, if the operating system attempts to update the authenticated variables db or dbx using a SetVariable() call, the call must have a root of trust back to a certificate held in KEK. In the Hyper-V case, we have a single certificate in this database which allows updates from Windows Update to safely update db and dbx.</p>
<h4>db</h4>
<p>db is a essentially an allow list for operating system loaders. Any operating system which starts when secure boot is enabled must have a root of trust to a key in this database. In the RTM version of Windows 8.1, a single key is in this database which allows &lsquo;PRSS&rsquo;-signed builds of Windows 8 and Windows 8.1 to load. Don&rsquo;t worry about the term PRSS. That&rsquo;s an internal Microsoft term. Just suffice it to say that the builds of Windows which go out to customers are signed this way. Internal daily builds and milestone exit builds (such as Windows 8.1 Preview) are not signed the same.</p>
<h4>dbx</h4>
<p>dbx is the converse of db and is a disallow list. In the RTM version of Windows 8.1, no keys are in this database.</p>
<p>While a virtualization platform such as Hyper-V could model itself entirely on a physical platform for features, we don&rsquo;t entirely for UEFI or secure boot. And with good reason. For example, we don&rsquo;t support capsule updates (which don&rsquo;t make sense as the firmware update can be done from the parent partition by updating the worker process). We don&rsquo;t support authenticated variables outside of the secure boot namespace. We only support specific authenticated variables in the secure boot namespace. We don&rsquo;t support time based authenticated variables. And potentially the one of most interest &ndash; we don&rsquo;t support setup mode. Strictly, these also means we don&rsquo;t have a fully compliant UEFI implementation.</p>
<p>So what is setup mode and why should you care? On a physical box, if no PK is enrolled, the system is said to be in setup mode. In this mode, no authentication is required to modify PK or KEK. Once the PK is enrolled, the firmware switches to user mode. (The actual mode is indicated by another UEFI variable, SetupMode.) By having setup mode, it allows the end user (or OEM) to specify exactly what operating systems can and cannot run when Secure Boot is enabled by pre-populating db/dbx, and (assuming those operating systems are signed appropriately) allow those operating systems to perform secure updates to db/dbx if there is a root of trust in the update chained to a key in KEK.</p>
<p>In Hyper-V, the firmware for a virtual machine is always in user mode. PK and KEK are pre-populated and cannot be changed. db and dbx are also prepopulated, but can be changed. In fact, db and dbx are a little more interesting in the Hyper-V case as this is where it differs somewhat from a physical platform.</p>
<p>On a physical platform, there is a single db and dbx. This is true also in Hyper-V from the perspective of a UEFI application, such as an operating system, running in a VM. However, from the perspective of the parent partition, there are actually two instances of db and dbx.</p>
<p>The first instance is global, non-transient and applies to all VMs. When a VM is powered on, regardless of any subsequent updates it might have securely made to db/dbx, the global contents are always present. The second instance is VM-local and transient. In reality, the local copies of db and dbx are held in the configuration file for the VM (as are other NVRAM variables such as those to define boot order and entries). What is actually projected into the VM is the union of the global and VM-local db and dbx variables.</p>
<p>Let&rsquo;s take an example to make all this a little clearer. Let&rsquo;s pretend that in a far-off parallel universe (bear with me here, and please no comments!), that Microsoft decides Windows 8 is, in-fact, malware, and should fail to boot on machines with Secure Boot enabled. A few things could be done to make this happen:</p>
<p>First the physical world:</p>
<ul>
<li>Microsoft could work with OEMs to update dbx to revoke the signature of the Windows 8 loader. Assuming the OEMs all agree, they build a new version of the firmware to be downloaded by customers, and pre-populate it on new machines coming off the factory floor.</li>
<li>While most new machines bought from those OEMs off the shelf would be caught, for machines in end users hands, the end user would need to update their firmware. This is, a relatively rare occurrence in the real world for client, less so for server. (Which does remind me, I ought to update my machines as I know at least two are out of date&hellip;.).</li>
<li>Or it could be done as a capsule update (assuming the firmware supports such a mechanism) allowing the firmware to be updated safely in the DXE stage of UEFI startup.</li>
<li>Or it could be done by an update through Windows Update to add the signature of Windows 8 to dbx. Remember from above, the (authenticated variable-) update must chain to a root of trust to a key in KEK. This will mostly be fine, as all Windows 8+ logo machines have KEK pre-populated such that this is viable. (Of course, remember advanced users could enter setup mode from firmware if the OEM supports this, and alter PK/KEK. So it&rsquo;s not 100% reliable).</li>
<li>Remember also that the end user could always re-flash their firmware to a previous version, removing the update; turn off Windows Update allowing Windows 8 to once again load with Secure Boot enabled; or remove the root of trust for the dbx Windows Update from KEK. Of course, none of these are good ideas!</li>
</ul>
<p>And compare to the virtual world:</p>
<ul>
<li>Remember Hyper-V doesn&rsquo;t entirely model itself on a physical machine. We have the VM which thinks it is a physical machine, and the parent partition running at a higher level of trust.</li>
<li>So, an update from Windows Update running inside the guest would work, the same as for a physical platform.</li>
<li>But, as PK, KEK and the global db/dbx are maintained by the parent partition which runs Windows, we can simply push out a regular update on the parent partition to add the Windows 8 signature to the binary containing the global copy of dbx. And here&rsquo;s the important bit &ndash; this update does NOT need to chain to a root of trust to a key in KEK. In fact, we can push out an update which patches any of the global secure boot variables.</li>
</ul>
<p>OK, that was a little more detail than I thought! Let&rsquo;s get back to end-user land. Secure Boot is a simple on-off setting on a per-VM basis. For the most part, you won&rsquo;t need to worry about it assuming you are running Windows 8 or Windows 8.1 (and the server counterparts) as a guest operating system. Here&rsquo;s the salient points to take away.</p>
<ul>
<li>When you create a new virtual machine, Secure Boot is enabled by default. The default cannot be changed.</li>
<li>The setting is on the Firmware tab of the VM settings <br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4857.clip_image002_6F5E7AB8.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4857.clip_5F00_image002_5F00_6F5E7AB8.jpg"><img style="display: inline;" title="clip_image002" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/0005.clip_image002_thumb_4E6D98C2.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/0005.clip_5F00_image002_5F00_thumb_5F00_4E6D98C2.jpg" alt="clip_image002" width="541" height="149" border="0" /></a></li>
<li>Secure Boot can only be enabled or disabled while a VM is powered off</li>
<li>The PowerShell equivalent to this checkbox is <span style="font-family: courier new;">Set-VMFirmware &ndash;EnableSecureBoot On|Off</span></li>
<li><span style="font-family: courier new;">(Get-VMFirmware $VM).SecureBoot</span> will return the current setting</li>
<li>When Secure Boot fails, it will typically look like this: <br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/8877.clip_image004_44A8314A.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/8877.clip_5F00_image004_5F00_44A8314A.jpg"><img style="display: inline;" title="clip_image004" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/5226.clip_image004_thumb_5DA69240.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/5226.clip_5F00_image004_5F00_thumb_5F00_5DA69240.jpg" alt="clip_image004" width="545" height="234" border="0" /></a> <br />(Nice logo by the way &ndash; yes, that was one of my Friday afternoon jobs for this release. I never did care much for that Windows Server 2003/2003 R2 era brick theme anyway. Sorry, marketing department!)</li>
<li>Non-Windows guest operating systems will likely not work with Secure Boot enabled due to not having a root of trust back to a key present in KEK</li>
</ul>
<p>In the next part, I&rsquo;ll go through some FAQs about generation 2 virtual machines before getting onto the topic of migration from generation 1 to generation 2.</p>
<p>Cheers, <br />John.</p>]]></content:encoded>
    </item>
    <item>
      <title>Hyper-V generation 2 virtual machines – part 5</title>
      <link>https://docs.microsoft.com/archive/blogs/jhoward/hyper-v-generation-2-virtual-machines-part-5</link>
      <pubDate>Thu, 31 Oct 2013 09:55:00 GMT</pubDate>
      <dc:creator><![CDATA[John Howard -MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jhoward/2013/10/31/hyper-v-generation-2-virtual-machines-part-5/</guid>
      <description><![CDATA[Part 1: Introduction to generation 2 virtual machines Part 2: Networking and boot order Part 3:...]]></description>
      <content:encoded><![CDATA[<p><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/24/hyper-v-generation-2-virtual-machines-part-1.aspx">Part 1: Introduction to generation 2 virtual machines</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/25/hyper-v-generation-2-virtual-machines-part-2.aspx">Part 2: Networking and boot order</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/28/hyper-v-generation-2-virtual-machines-part-3.aspx">Part 3: Storage</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/29/hyper-v-generation-2-virtual-machines-part-4.aspx">Part 4: Keyboard for Windows 8 &amp; Windows Server 2012</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/10/31/hyper-v-generation-2-virtual-machines-part-5.aspx">Part 5: Kernel debugging</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/01/hyper-v-generation-2-virtual-machines-part-6.aspx">Part 6: Secure Boot</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/04/hyper-v-generation-2-virtual-machines-part-7.aspx">Part 7: FAQ</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/06/hyper-v-generation-2-virtual-machines-part-8.aspx">Part 8: Manually migrating generation 1 virtual machines to generation 2</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/11/hyper-v-generation-2-virtual-machines-part-9.aspx">Part 9: Installing from ISO</a> <br /><a href="http://blogs.technet.com/b/jhoward/archive/2013/11/14/hyper-v-generation-2-virtual-machines-part-10.aspx">Part 10: Utility for converting generation 1 virtual machines to generation 2 (Convert-VMGeneration)</a></p>
<p>This part of the series on generation 2 virtual machines in Hyper-V looks at kernel debugging using the serial port. It's spookily simple (it's Halloween!). If you don&rsquo;t have any need for kernel debugging, skip to the next part.</p>
<p>In generation 1 virtual machines, one of the most common ways of attaching a kernel debugger to a guest operating system is using a COM port. However, in generation 2 virtual machines, there are no COM ports. Or are there&hellip;.?</p>
<p>Well the answer is both yes, and no. By default, the answer is no. However, you can change this. For the following screenshots, I&rsquo;m using a Windows 8 virtual machine (in fact using the media I created in the previous part which has the software based keyboard driver added). For example, here&rsquo;s the settings for a typical generation 2 virtual machine where there is no COM port shown.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/5504.clip_image002_3D8E4391.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/5504.clip_5F00_image002_5F00_3D8E4391.jpg"><img style="display: inline;" title="clip_image002" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/6683.clip_image002_thumb_5D3D1D59.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/6683.clip_5F00_image002_5F00_thumb_5F00_5D3D1D59.jpg" alt="clip_image002" width="247" height="326" border="0" /></a></p>
<p>That is simply because Hyper-V Manager will <em>never</em> show COM ports regardless of whether they are present or not in a generation 2 VM. Let&rsquo;s look at PowerShell instead:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/3750.clip_image004_18FCB60D.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/3750.clip_5F00_image004_5F00_18FCB60D.jpg"><img style="display: inline;" title="clip_image004" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/8168.clip_image004_thumb_78E1A94F.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/8168.clip_5F00_image004_5F00_thumb_5F00_78E1A94F.jpg" alt="clip_image004" width="510" height="141" border="0" /></a></p>
<p>Here you can see PowerShell believes there are two COM ports. However, if you look inside device manager in a guest operating system, you&rsquo;ll notice that there really are no COM ports present as devices enumerated to the virtual machine. (I won&rsquo;t include a screenshot, I did that in a previous part.)</p>
<p>While a VM is running, you can set a pipe path for a COM port, so let&rsquo;s do that for COM1:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/5428.clip_image006_38AB8FD5.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/5428.clip_5F00_image006_5F00_38AB8FD5.jpg"><img style="display: inline;" title="clip_image006" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/5432.clip_image006_thumb_467DD5D0.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/5432.clip_5F00_image006_5F00_thumb_5F00_467DD5D0.jpg" alt="clip_image006" width="612" height="105" border="0" /></a></p>
<p>Again, if you were to look inside device manager in the guest, the COM1 port is still not present. However, if you shutdown and re-start the VM, you&rsquo;ll notice that the COM ports are indeed now present.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/1731.clip_image008_54501BCB.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/1731.clip_5F00_image008_5F00_54501BCB.jpg"><img style="display: inline;" title="clip_image008" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4477.clip_image008_thumb_7B1E320B.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4477.clip_5F00_image008_5F00_thumb_5F00_7B1E320B.jpg" alt="clip_image008" width="389" height="496" border="0" /></a></p>
<p>The rest of this isn&rsquo;t rocket science for those of you familiar with kernel debugging, except for one small thing which is relevant to generation 2 virtual machine (or more specifically UEFI based machines with Secure Boot enabled).</p>
<p>Using msconfig, here I&rsquo;m enabling kernel debugging for the VM on COM1, but after hitting OK, you get the following error:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/3480.clip_image010_73FEF593.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/3480.clip_5F00_image010_5F00_73FEF593.jpg"><img style="display: inline;" title="clip_image010" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4061.clip_image010_thumb_6CDFB91B.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4061.clip_5F00_image010_5F00_thumb_5F00_6CDFB91B.jpg" alt="clip_image010" width="503" height="212" border="0" /></a></p>
<p>This is because policy in Windows dictates that Secure Boot and kernel debugging are incompatible. Hence, shut-down the virtual machine and disable Secure Boot in the firmware settings. (I&rsquo;ll talk more about Secure Boot in the next part.)</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/7607.clip_image012_7AB1FF16.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/7607.clip_5F00_image012_5F00_7AB1FF16.jpg"><img style="display: inline;" title="clip_image012" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/3225.clip_image012_thumb_21801557.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/3225.clip_5F00_image012_5F00_thumb_5F00_21801557.jpg" alt="clip_image012" width="596" height="458" border="0" /></a></p>
<p>Use msconfig again to enable kernel debugging which will succeed, then restart the VM. Using windbg on the parent partition, connect to the pipe</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/0172.clip_image014_1A60D8DF.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/0172.clip_5F00_image014_5F00_1A60D8DF.jpg"><img style="display: inline;" title="clip_image014" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/7028.clip_image014_thumb_3D24A14D.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/7028.clip_5F00_image014_5F00_thumb_5F00_3D24A14D.jpg" alt="clip_image014" width="463" height="197" border="0" /></a></p>
<p>At which point you can break in as per normal kernel debugging</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/8508.clip_image016_6F1C41D7.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/8508.clip_5F00_image016_5F00_6F1C41D7.jpg"><img style="display: inline;" title="clip_image016" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/8512.clip_image016_thumb_67FD055F.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/8512.clip_5F00_image016_5F00_thumb_5F00_67FD055F.jpg" alt="clip_image016" width="621" height="315" border="0" /></a></p>
<p>Onwards to part 6 and Secure Boot.</p>
<p>Cheers <br />John.</p>]]></content:encoded>
    </item>
    <item>
      <title>Hyper-V generation 2 virtual machines – part 4</title>
      <link>https://docs.microsoft.com/archive/blogs/jhoward/hyper-v-generation-2-virtual-machines-part-4</link>
      <pubDate>Tue, 29 Oct 2013 10:53:00 GMT</pubDate>
      <dc:creator><![CDATA[John Howard -MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jhoward/2013/10/29/hyper-v-generation-2-virtual-machines-part-4/</guid>
      <description><![CDATA[Part 1: Introduction to generation 2 virtual machines Part 2: Networking and boot order Part 3:...]]></description>
      <content:encoded><![CDATA[<p><a href="/b/jhoward/archive/2013/10/24/hyper-v-generation-2-virtual-machines-part-1.aspx">Part 1: Introduction to generation 2 virtual machines</a> <br /><a href="/b/jhoward/archive/2013/10/25/hyper-v-generation-2-virtual-machines-part-2.aspx">Part 2: Networking and boot order</a> <br /><a href="/b/jhoward/archive/2013/10/28/hyper-v-generation-2-virtual-machines-part-3.aspx">Part 3: Storage</a> <br /><a href="/b/jhoward/archive/2013/10/29/hyper-v-generation-2-virtual-machines-part-4.aspx">Part 4: Keyboard for Windows 8 &amp; Windows Server 2012</a> <br /><a href="/b/jhoward/archive/2013/10/31/hyper-v-generation-2-virtual-machines-part-5.aspx">Part 5: Kernel debugging</a> <br /><a href="/b/jhoward/archive/2013/11/01/hyper-v-generation-2-virtual-machines-part-6.aspx">Part 6: Secure Boot</a> <br /><a href="/b/jhoward/archive/2013/11/04/hyper-v-generation-2-virtual-machines-part-7.aspx">Part 7: FAQ</a> <br /><a href="/b/jhoward/archive/2013/11/06/hyper-v-generation-2-virtual-machines-part-8.aspx">Part 8: Manually migrating generation 1 virtual machines to generation 2</a> <br /><a href="/b/jhoward/archive/2013/11/11/hyper-v-generation-2-virtual-machines-part-9.aspx">Part 9: Installing from ISO</a> <br /><a href="/b/jhoward/archive/2013/11/14/hyper-v-generation-2-virtual-machines-part-10.aspx">Part 10: Utility for converting generation 1 virtual machines to generation 2 (Convert-VMGeneration)</a></p>
<p>This part of the series on generation 2 virtual machines in Hyper-V looks a little more at the keyboard device. This has relevance if you are running Windows 8 or Windows Server 2012 as a guest operating system, and more specifically WinPE/WinRE from these operating systems. PE is used, for example, during Windows setup. In part one, I mentioned that we removed the emulated i8042 keyboard device from generation 2 virtual machines. That means the only keyboard device available is the software based keyboard.</p>
<p>Unfortunately&hellip; this is also where hindsight is a marvelous asset. In PE &amp; RE environments, the software based keyboard driver is not present. It was a pure and simple oversight, and I&rsquo;m probably as good a person to blame as anyone. (Not literally though please ;).) At the time, no-one had thought there might be a need for it to be present in the future. It simply didn&rsquo;t affect any end user scenarios. Generation 2 virtual machines changed those assumptions.</p>
<p>So let&rsquo;s take the case of when you are installing Windows 8 client into a generation 2 virtual machine booted from an ISO. It&rsquo;s the retail version which requires a product key. Setup is built on WinPE, and without the software based keyboard driver, you can&rsquo;t enter the product key. (Well I guess you can use the on-screen keyboard.) Obviously in the case of unattended installs, you can get around this. You would hit the same problem doing a network install where the WDS server boot image (again based on WinPE) provided to the VM is Windows 8/Windows Server 2012 based. If that is the case, update your boot image to 8.1 and the problem will go away. Another workaround is to do an initial boot to an ISO containing Windows 8.1 PE from where Windows 8/Windows Server 2012 can be launched.</p>
<p>Fortunately, it&rsquo;s relatively easy to solve the above using standard servicing mechanisms, which is what I&rsquo;ll walk through in this part.</p>
<p>I&rsquo;m assuming your client or technician machine is Windows 8.1 with Hyper-V enabled (or you have access to a Windows Server 2012 R2 machine with Hyper-V enabled). To start with, grab the Windows Assessment and Deployment Kit for Windows 8.1 (otherwise known as the ADK) from <a href="http://www.microsoft.com/en-ie/download/details.aspx?id=39982">http://www.microsoft.com/en-ie/download/details.aspx?id=39982</a>. Note I have tried this on Windows 8 as well, using the Windows 8 version of the ADK, but with pre-release versions of Windows 8.1. It should still work though.</p>
<p>When installing the ADK, you can use the default options, although if you choose, you only need the &lsquo;Deployment Tools&rsquo; option for this walkthrough.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/6763.clip_image001_51F83928.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/6763.clip_5F00_image001_5F00_51F83928.png"><img width="559" height="413" title="clip_image001" style="display:inline;" alt="clip_image001" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4380.clip_image001_thumb_146ADB5F.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4380.clip_5F00_image001_5F00_thumb_5F00_146ADB5F.png" border="0" /></a></p>
<p>Once installed, start an elevated &ldquo;Deployment and Imaging Tools Environment&rdquo; command prompt.</p>
<p>While it&rsquo;s installing, grab an ISO of Windows 8 (or Windows Server 2012) and copy it locally to the machine where the ADK is installed. For this walkthrough, I&rsquo;m using an en_us Windows 8 RTM ISO although the language should be irrelevant. (Thinking about it, I should have grabbed the en_gb ISO as I still get frustrated continually seeing &ldquo;Favourites&rdquo; misspelt!)</p>
<p>The next think you need is the CAB file which contains the Integration Service .CAB file for Windows 8.1. It is important to use the .CAB file from the final RTM build of Windows 8.1, not the version from Windows 8.1 preview to avoid driver signing issues and a conflict with the Secure Boot feature of generation 2 virtual machines. The CAB file can be found under \Windows\vmguest\support\amd64, named &ldquo;Windows6.2-HyperVIntegrationServices-x64.cab&rdquo;. Copy it to a working directory where the .ISO being modified is located.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4212.clip_image003_5434C1E4.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4212.clip_5F00_image003_5F00_5434C1E4.jpg"><img width="573" height="115" title="clip_image003" style="display:inline;" alt="clip_image003" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/7848.clip_image003_thumb_620707DF.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/7848.clip_5F00_image003_5F00_thumb_5F00_620707DF.jpg" border="0" /></a></p>
<p>Now you need to mount the .ISO as a local drive letter to extract the contents which you are soon going to be modifying. You can mount it by simply typing the name of the .ISO file at the command prompt, or using Windows File Explorer. Simply copy the contents, including sub-directories to a temporary directory. In my case, I&rsquo;m using c:\working\extract. After copying, you can unmount the ISO from explorer by right clicking on the drive and selecting Eject.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/6862.clip_image005_08D51E20.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/6862.clip_5F00_image005_5F00_08D51E20.jpg"><img width="467" height="261" title="clip_image005" style="display:inline;" alt="clip_image005" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/2664.clip_image005_thumb_489F04A5.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/2664.clip_5F00_image005_5F00_thumb_5F00_489F04A5.jpg" border="0" /></a></p>
<p>Next job is to examine the Windows PE boot WIM image which will be in the sources sub-directory where you just extracted the .ISO contents. Use dism /get-imageinfo to do this. There is a little gotcha here, you need to use DISM from the ADK, not the one built into Windows to avoid &ldquo;Error: 87&rdquo; as shown below.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/2063.clip_image006_1D5A6D9E.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/2063.clip_5F00_image006_5F00_1D5A6D9E.png"><img width="647" height="293" title="clip_image006" style="display:inline;" alt="clip_image006" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4152.clip_image006_thumb_442883DE.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4152.clip_5F00_image006_5F00_thumb_5F00_442883DE.png" border="0" /></a></p>
<p>The output shows there are two images in the WIM file, both of which we are going to update. Using another temporary empty directory, in my case, c:\mount, mount one of the images in the above WIM. Again, using dism, we are going to use the /mount-image parameter. Note the use of the /index: parameter too to match each of the images in the WIM per the above screenshot.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/6708.clip_image007_560517AB.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/6708.clip_5F00_image007_5F00_560517AB.png"><img width="645" height="122" title="clip_image007" style="display:inline;" alt="clip_image007" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/6712.clip_image007_thumb_7CD32DEB.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/6712.clip_5F00_image007_5F00_thumb_5F00_7CD32DEB.png" border="0" /></a></p>
<p>Next we need to add the software-based keyboard driver from the CAB file we copied earlier. As the Hyper-V Integration Services are catalog signed, it is necessary to apply the complete package of the integration services rather than the single keyboard driver. This is done using the /add-package parameter to dism.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/5734.clip_image008_3892C69F.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/5734.clip_5F00_image008_5F00_3892C69F.png"><img width="653" height="134" title="clip_image008" style="display:inline;" alt="clip_image008" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/6305.clip_image008_thumb_31738A27.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/6305.clip_5F00_image008_5F00_thumb_5F00_31738A27.png" border="0" /></a></p>
<p>And finally, for this image, unmount it, remembering to commit the changes. This is done using dism with the /unmount-image and /commit parameters.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/8484.clip_image009_062EF320.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/8484.clip_5F00_image009_5F00_062EF320.png"><img width="647" height="119" title="clip_image009" style="display:inline;" alt="clip_image009" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/1121.clip_image009_thumb_512263EF.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/1121.clip_5F00_image009_5F00_thumb_5F00_512263EF.png" border="0" /></a></p>
<p>Here&rsquo;s the raw commands for completeness</p>
<p><span style="font-family:courier new;">dism /get-imageinfo boot.wim <br />dism /mount-image /imagefile:boot.wim /index:1 /mountdir:c:\mount <br />dism /image:c:\mount /add-package /packagepath:Windows6.2-HyperVIntegrationServices-x64.cab <br />dism /unmount-image /mountdir:c:\mount /commit</span></p>
<p>Repeat the above three commands but mounting index 2 in the boot.wim file (which is the Windows Setup image) this time around.</p>
<p>At this point, you might also optionally want to update the recovery WIM in the media too. This is a tiny bit more complicated due to the fact that it&rsquo;s a WIM inside a WIM. To do this, you need to mount install.wim rather than boot.wim to start with. For example below, you can see that the media I am using contains Windows 8 and Windows 8 Pro.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/6648.clip_image010_77F07A2F.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/6648.clip_5F00_image010_5F00_77F07A2F.png"><img width="645" height="199" title="clip_image010" style="display:inline;" alt="clip_image010" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/7713.clip_image010_thumb_1EBE9070.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/7713.clip_5F00_image010_5F00_thumb_5F00_1EBE9070.png" border="0" /></a></p>
<p>The mount of install.wim&hellip;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4617.clip_image011_5CBAB1DF.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4617.clip_5F00_image011_5F00_5CBAB1DF.png"><img width="651" height="106" title="clip_image011" style="display:inline;" alt="clip_image011" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/2134.clip_image011_thumb_6E9745AC.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/2134.clip_5F00_image011_5F00_thumb_5F00_6E9745AC.png" border="0" /></a></p>
<p>Information on winre.wim under \mount\windows\system32\recovery\winre.wim</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/3443.clip_image012_4352AEA5.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/3443.clip_5F00_image012_5F00_4352AEA5.png"><img width="650" height="158" title="clip_image012" style="display:inline;" alt="clip_image012" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4532.clip_image012_thumb_3109E7E3.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4532.clip_5F00_image012_5F00_thumb_5F00_3109E7E3.png" border="0" /></a></p>
<p>Mounting the first (and only) image in WinRE.wim to a second mount temporary directory (c:\mount2)</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/1882.clip_image013_57D7FE23.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/1882.clip_5F00_image013_5F00_57D7FE23.png"><img width="653" height="118" title="clip_image013" style="display:inline;" alt="clip_image013" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4520.clip_image013_thumb_69B491F0.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4520.clip_5F00_image013_5F00_thumb_5F00_69B491F0.png" border="0" /></a></p>
<p>Adding the integration services package (remember c:\mount2, not c:\mount)</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/5618.clip_image014_1082A831.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/5618.clip_5F00_image014_5F00_1082A831.png"><img width="646" height="130" title="clip_image014" style="display:inline;" alt="clip_image014" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/6786.clip_image014_thumb_132B63E2.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/6786.clip_5F00_image014_5F00_thumb_5F00_132B63E2.png" border="0" /></a></p>
<p>Committing the package and unmounting (again remember c:\mount2)</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/0434.clip_image015_2507F7AF.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/0434.clip_5F00_image015_5F00_2507F7AF.png"><img width="653" height="120" title="clip_image015" style="display:inline;" alt="clip_image015" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/8666.clip_image015_thumb_60C79062.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/8666.clip_5F00_image015_5F00_thumb_5F00_60C79062.png" border="0" /></a></p>
<p>And now unmounting the Windows 8 image itself from c:\mount committing the contents.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/8688.clip_image016_59A853EA.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/8688.clip_5F00_image016_5F00_59A853EA.png"><img width="657" height="116" title="clip_image016" style="display:inline;" alt="clip_image016" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/0250.clip_image016_thumb_00766A2B.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/0250.clip_5F00_image016_5F00_thumb_5F00_00766A2B.png" border="0" /></a></p>
<p>Repeat for each image inside install.wim.</p>
<p>At this point, you are ready to re-create the ISO which can be used for Operating System installation on both generation 1 (PCAT) and generation 2 (UEFI) virtual machines. We use oscdimg.exe from the ADK for this purpose. From the sources directory where the modified Windows media is extracted, run the following command (on one line)</p>
<p><span style="font-family:courier new,courier;">Oscdimg </span><br /><span style="font-family:courier new,courier;">-m </span><br /><span style="font-family:courier new,courier;">-o </span><br /><span style="font-family:courier new,courier;">-u2 </span><br /><span style="font-family:courier new,courier;">-udfver102 </span><br /><span style="font-family:courier new,courier;">-bootdata:2 </span><br /><span style="font-family:courier new,courier;">#p0,e,b&lt;Path&gt;\etfsboot.com </span><br /><span style="font-family:courier new,courier;">#pEF,e,b&lt;Path&gt;\efisys.bin </span><br /><span style="font-family:courier new,courier;">&lt;Source Directory&gt; </span><br /><span style="font-family:courier new,courier;">&lt;Target&gt;</span></p>
<p>These are the relevant parameters:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="390" valign="top">
<p>-m</p>
</td>
<td width="390" valign="top">
<p>Ignore the maximum size limit of the image</p>
</td>
</tr>
<tr>
<td width="390" valign="top">
<p>-o</p>
</td>
<td width="390" valign="top">
<p>Optimize by removing duplicate files</p>
</td>
</tr>
<tr>
<td width="390" valign="top">
<p>-u2</p>
</td>
<td width="390" valign="top">
<p>UDF file system ISO image</p>
</td>
</tr>
<tr>
<td width="390" valign="top">
<p>-udfver102</p>
</td>
<td width="390" valign="top">
<p>UDF version will be 1.02</p>
</td>
</tr>
<tr>
<td width="390" valign="top">
<p>-bootdata:2</p>
</td>
<td width="390" valign="top">
<p>Specified there will be two boot catalog entries</p>
</td>
</tr>
<tr>
<td width="390" valign="top">
<p>#p0,e,b&lt;Path&gt;\etfsboot.com</p>
</td>
<td width="390" valign="top">
<p># is the separator between boot entries</p>
<p>p0 sets the platform ID to 0 for the first default boot entry for the BIOS <br />e Specifies floppy disk emulation in the El Torito catalog <br />b&lt;Path&gt;\etfsboot.com Puts the specified file in the boot sectors of the disk</p>
</td>
</tr>
<tr>
<td width="390" valign="top">
<p>#pEF,e,b&lt;Path&gt;efisys.bin</p>
</td>
<td width="390" valign="top">
<p># is the separator between first and second entry</p>
<p>pEF sets the platform ID to &ldquo;EF&rdquo; as defined by the UEFI specification</p>
<p>b&lt;Path&gt;\efisys.bin Puts the specified file (Efisys.bin) in the boot sector of the disk. Efisys.bin is the binary floppy disk layout of the EFI boot code. This disk image contains the files that are used to start from the EFI firmware in the Efi\boot\x64boot.efi folder</p>
</td>
</tr>
<tr>
<td width="390" valign="top">
<p>&lt;Source Directory&gt;</p>
</td>
<td width="390" valign="top">
<p>Is the top directory where the (modified) Windows Media was extracted to.</p>
</td>
</tr>
<tr>
<td width="390" valign="top">
<p>&lt;Target&gt;</p>
</td>
<td width="390" valign="top">
<p>Is the full path to the .ISO that will be generated.</p>
</td>
</tr>
</tbody>
</table>
<p>Note that using just etfsboot.com is not sufficient as this only puts a boot loader suitable for BIOS/PCAT based machines onto the ISO. More information can be found at <a href="http://support.microsoft.com/kb/947024">http://support.microsoft.com/kb/947024</a>. (This KB applies for Windows Server 2008, but can be used for Windows Server 2012/Windows 8 as well).</p>
<p>Using our previous working directories, here&rsquo;s an example.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4807.clip_image017_0E48B026.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4807.clip_5F00_image017_5F00_0E48B026.png"><img width="618" height="257" title="clip_image017" style="display:inline;" alt="clip_image017" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/7534.clip_image017_thumb_5868DC6D.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/7534.clip_5F00_image017_5F00_thumb_5F00_5868DC6D.png" border="0" /></a></p>
<p>Phew! Let&rsquo;s try it out in a new generation 2 virtual machine attaching and installing from the patched ISO.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/4885.clip_image019_7F36F2AD.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/4885.clip_5F00_image019_5F00_7F36F2AD.jpg"><img width="627" height="534" title="clip_image019" style="display:inline;" alt="clip_image019" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/98/metablogapi/2350.clip_image019_thumb_1113867B.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-40-98-metablogapi/2350.clip_5F00_image019_5F00_thumb_5F00_1113867B.jpg" border="0" /></a></p>
<p>Of course, you can also use the patched boot.wim file for use on a WDS server. However, I would recommend instead you put the Windows 8.1 PE and boot.wim on the WDS server instead as these contain the software keyboard driver already.</p>
<p>In the next part, I&rsquo;ll talk about debugging as it relates to generation 2 virtual machines.</p>
<p>Cheers, <br />John.</p>]]></content:encoded>
    </item>
  </channel>
</rss>