<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>garrymartin.com &#187; windows</title>
	<atom:link href="http://www.garrymartin.com/blog/tag/windows/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.garrymartin.com/blog</link>
	<description>Championing the subtle difference between &#34;easy&#34; and &#34;easy when you know how&#34; ;-)</description>
	<lastBuildDate>Thu, 29 Oct 2009 18:54:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Native VHD Boot Windows 7 or Windows Server 2008 R2 from an External USB Drive</title>
		<link>http://www.garrymartin.com/blog/2009/10/native-vhd-boot-windows-7-or-windows-server-2008-r2-from-an-external-usb-drive/</link>
		<comments>http://www.garrymartin.com/blog/2009/10/native-vhd-boot-windows-7-or-windows-server-2008-r2-from-an-external-usb-drive/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 06:22:52 +0000</pubDate>
		<dc:creator>Garry Martin</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[vhd boot]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.garrymartin.com/blog/?p=56</guid>
		<description><![CDATA[Are you excited about Native VHD Boot for Windows 7 (Enterprise or Ultimate) and Windows Server 2008 R2 but wish you could use an external USB drive to store the .VHD files? Well unfortunately it isn’t officially supported but, if that doesn’t worry you too much, you might find this post interesting…
Background
In order to get [...]]]></description>
			<content:encoded><![CDATA[<p>Are you excited about Native VHD Boot for Windows 7 (Enterprise or Ultimate) and Windows Server 2008 R2 but wish you could use an external USB drive to store the .VHD files? Well unfortunately it isn’t officially supported but, if that doesn’t worry you too much, you might find this post interesting…</p>
<h2>Background</h2>
<p>In order to get Native VHD Boot working from an external USB Disk, there are a few things we need to understand about device drivers and their load orders.</p>
<p>Setup and the PnP manager configure devices starting with the system root device, followed by the child devices of the root device, the children of those devices, and so on. To influence the driver load order outside of this sequence, we need to change the .INF files for the USB related drivers, specifying relevant values in the <em>service-install-section</em>, specifically the <strong>StartType</strong> and the <strong>LoadOrderGroup</strong> entries.</p>
<p>A PnP driver should have a start type of <strong>SERVICE_DEMAND_START (0×3)</strong>, specifying that the PnP manager can load the driver whenever it finds a device that the driver services. USB drivers normally behave in this manner and have this start type.</p>
<p>However, if a driver is required to boot the machine (such as when, oh I don’t know, maybe attempting something like native VHD boot from an external USB drive), the drivers for the device should have a start type of <strong>SERVICE_BOOT_START (0×0)</strong>.</p>
<p>On system boot, the operating system loader loads drivers of type SERVICE_BOOT_START before it transfers control to the kernel. These drivers are in memory when the kernel gets control. Boot-start drivers can use the .INF LoadOrderGroup entries to order their loading. You can see the <strong>List</strong> order at HKLM/SYSTEM/CurrentControlSet/Control/ServiceGroupOrder.</p>
<p>For Native VHD Boot from an external USB drive to work, we need to modify the behaviour of six device drivers:</p>
<ul>
<li><strong>usbccgp</strong> - Microsoft USB Generic Parent Driver</li>
<li><strong>usbehci</strong> - Microsoft USB 2.0 Enhanced Host Controller Miniport Driver</li>
<li><strong>usbohci</strong> - USB Open Host Controller Miniport Driver</li>
<li><strong>usbuhci</strong> - Microsoft Universal Host Controller Miniport Driver</li>
<li><strong>usbhub</strong> - Microsoft USB Standard Hub Driver</li>
<li><strong>usbstor</strong> - USB Mass Storage Driver</li>
</ul>
<p>The USB drivers have a LoadOrderGroup entry of <strong>Base</strong>, which is considerably down the list, and critically much later than we need to use them as a boot device. We therefore need to modify the LoadOrderGroup to something more appropriate that will be processed earlier in the boot cycle. There is some debate about the best entries to use for this purpose, and whilst it seems the below is <em>technically</em> most appropriate, I began this journey with all entries set to use <strong>Boot Bus Extender</strong> and have continued to use that without issue. However, you may want to try the settings below as an alternative:</p>
<ul>
<li><strong>usbccgp</strong> - Boot Bus Extender</li>
<li><strong>usbehci</strong> - Boot Bus Extender</li>
<li><strong>usbohci</strong> - Boot Bus Extender</li>
<li><strong>usbuhci</strong> - Boot Bus Extender</li>
<li><strong>usbhub</strong> - System Bus Extender</li>
<li><strong>usbstor</strong> - SCSI Miniport</li>
</ul>
<p>So, to enable Native VHD Boot from an external USB drive, we need to modify the <strong>StartType</strong> and <strong>LoadOrderGroup</strong> of each of those drivers, and critically, ensure that they don’t get reset to their defaults.</p>
<h2>Requirements</h2>
<p>You’ll need a computer running Windows 7 or Windows Server 2008 R2 and a suitable external USB drive to store your .VHD files and to create the necessary bootloader. You’ll also need the following tools:</p>
<ul>
<li><a href="http://www.microsoft.com/downloads/details.aspx?familyid=696DD665-9F76-4177-A811-39C26D3B3B34&amp;displaylang=en">Windows Automated Installation Kit (WAIK) for Windows 7</a></li>
<li><a href="http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx">PsExec v1.96</a></li>
<li><a href="http://code.msdn.microsoft.com/wim2vhd">Windows Image to Virtual Hard Disk (WIM2VHD) Converter</a></li>
<li><a href="http://home.mnet-online.de/horst.muc/wbat32.htm#inifile">Horst Schaeffer’s INI File Tool</a></li>
</ul>
<h2>Process</h2>
<p><em><strong>Disclaimer</strong>: This is close to a step-by-step guide, but it assumes a certain level of technical knowledge and understanding. Hopefully I’ve made it as easy to follow and as painless as possible but tread carefully. To quote <a title="Less Virtual, More Machine - Windows 7 and the magic of Boot to VHD" href="http://www.hanselman.com/blog/CategoryView.aspx?category=Win7&amp;page=3">Scott Hanselman</a>:</em></p>
<blockquote cite="http://www.hanselman.com/blog/CategoryView.aspx?category=Win7&amp;page=3">
<p>“This is some advanced stuff and you may lose a finger. No warranty express or implied.”</p>
</blockquote>
<p>To begin with, we need to create our .VHD file. <a href="http://blogs.msdn.com/mikekol/">Mike Kolitz</a> has created a fantastic script called WIM2VHD that takes much of the hard work out of this task for us. The example below uses a Windows Server 2008 R2 WIM file as source, and creates a 49GB Enterprise edition dynamically expanding .VHD file from it.</p>
<div class="dirtycodenoclick"><code>CSCRIPT WIM2VHD.WSF /WIM:&quot;M:\Sources\SERVER\install.wim&quot; /SKU:SERVERENTERPRISE /VHD:&quot;M:\BootVHDs\W2K8R2ENT.vhd&quot; /SIZE:50176 /DISKTYPE:DYNAMIC</code></div>
<p>Now that we have created the .VHD file, we need to make some changes to the operating system contained within it. From the same elevated command prompt used for the previous command, we’ll use diskpart.exe to mount the .VHD. Note the use of LIST VOLUME so that we can see the correct volume number, select it, and assign a drive letter to it - you’ll need to change the number in SELECT VOLUME to match your environment:</p>
<div class="dirtycodenoclick"><code>DISKPART<br />
SELECT VDISK FILE=&quot;M:\BootVHDs\W2K8R2ENT.vhd&quot;<br />
ATTACH VDISK<br />
LIST VOLUME<br />
SELECT VOLUME 8<br />
ASSIGN LETTER=R<br />
EXIT</code></div>
<p>At this stage, I use the offline servicing tool, <code>dism.exe</code>, to change the default language, keyboard layout and timezone to something more appropriate for the United Kingdom. You can obviously make other changes too if necessary:</p>
<div class="dirtycodenoclick"><code>DISM /IMAGE:R: /Set-SysLocale:en-GB<br />
DISM /IMAGE:R: /Set-UserLocale:en-GB<br />
DISM /IMAGE:R: /Set-InputLocale:409:00000409<br />
DISM /IMAGE:R: /Set-TimeZone:&quot;GMT Standard Time&quot;</code></div>
<p>Next, we need to make changes to the registry for each of the six USB device drivers. We’ll use the built in <code>reg.exe</code> command to do this. By default, when an operating system is launched from a dynamically expanding .VHD file using native VHD boot, it expands to its maximum size, reverting to its dynamic size when it is shutdown. I also modify the <strong>VirtualDiskExpandOnMount</strong> registry value to prevent this:</p>
<div class="dirtycodenoclick"><code>REG LOAD HKLM\TEMP R:\WINDOWS\SYSTEM32\CONFIG\SYSTEM<br />
REG ADD HKLM\TEMP\ControlSet001\services\usbccgp /v Group /t REG_SZ /d &quot;Boot Bus Extender&quot; /f<br />
REG ADD HKLM\TEMP\ControlSet001\services\usbccgp /v Start /t REG_DWORD /d 0 /f<br />
REG ADD HKLM\TEMP\ControlSet001\services\usbehci /v Group /t REG_SZ /d &quot;Boot Bus Extender&quot; /f<br />
REG ADD HKLM\TEMP\ControlSet001\services\usbehci /v Start /t REG_DWORD /d 0 /f<br />
REG ADD HKLM\TEMP\ControlSet001\services\usbhub /v Group /t REG_SZ /d &quot;Boot Bus Extender&quot; /f<br />
REG ADD HKLM\TEMP\ControlSet001\services\usbhub /v Start /t REG_DWORD /d 0 /f<br />
REG ADD HKLM\TEMP\ControlSet001\services\usbohci /v Group /t REG_SZ /d &quot;Boot Bus Extender&quot; /f<br />
REG ADD HKLM\TEMP\ControlSet001\services\usbohci /v Start /t REG_DWORD /d 0 /f<br />
REG ADD HKLM\TEMP\ControlSet001\services\USBSTOR /v Group /t REG_SZ /d &quot;Boot Bus Extender&quot; /f<br />
REG ADD HKLM\TEMP\ControlSet001\services\USBSTOR /v Start /t REG_DWORD /d 0 /f<br />
REG ADD HKLM\TEMP\ControlSet001\services\usbuhci /v Group /t REG_SZ /d &quot;Boot Bus Extender&quot; /f<br />
REG ADD HKLM\TEMP\ControlSet001\services\usbuhci /v Start /t REG_DWORD /d 0 /f<br />
REG ADD HKLM\TEMP\ControlSet001\services\FsDepends\Parameters /v VirtualDiskExpandOnMount /t REG_DWORD /d 4 /f<br />
REG UNLOAD HKLM\TEMP</code></div>
<p>The next step is to modify the .INF files so that the operating system does not reset these values to their defaults at any point. As some of the files require SYSTEM permissions to modify them, we use the excellent SysInternals <code>psexec.exe</code> command to launch a command prompt in the SYSTEM security context.</p>
<div class="dirtycodenoclick"><code>PSEXEC –i –d –s C:\Windows\System32\cmd.exe</code></div>
<p>From the <strong>resultant</strong> command window, we use Horst Schaeffer’s INI File Tool to modify any .INF files that might reset the device driver values to their defaults:</p>
<div class="dirtycodenoclick"><code>INIFILE R:\Windows\inf\usb.inf [StandardHub.AddService] StartType&nbsp;&nbsp; = 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; SERVICE_BOOT_START<br />
INIFILE R:\Windows\inf\usb.inf [StandardHub.AddService] LoadOrderGroup = Boot Bus Extender<br />
INIFILE R:\Windows\inf\usb.inf [CommonClassParent.AddService] StartType&nbsp;&nbsp; = 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; SERVICE_BOOT_START<br />
INIFILE R:\Windows\inf\usb.inf [CommonClassParent.AddService] LoadOrderGroup = Boot Bus Extender<br />
INIFILE R:\Windows\inf\usbport.inf [EHCI.AddService] StartType&nbsp;&nbsp; = 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; SERVICE_BOOT_START<br />
INIFILE R:\Windows\inf\usbport.inf [EHCI.AddService] LoadOrderGroup = Boot Bus Extender<br />
INIFILE R:\Windows\inf\usbport.inf [OHCI.AddService] StartType&nbsp;&nbsp; = 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; SERVICE_BOOT_START<br />
INIFILE R:\Windows\inf\usbport.inf [OHCI.AddService] LoadOrderGroup = Boot Bus Extender<br />
INIFILE R:\Windows\inf\usbport.inf [UHCI.AddService] StartType&nbsp;&nbsp; = 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; SERVICE_BOOT_START<br />
INIFILE R:\Windows\inf\usbport.inf [UHCI.AddService] LoadOrderGroup = Boot Bus Extender<br />
INIFILE R:\Windows\inf\usbport.inf [ROOTHUB.AddService] StartType&nbsp;&nbsp; = 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; SERVICE_BOOT_START<br />
INIFILE R:\Windows\inf\usbport.inf [ROOTHUB.AddService] LoadOrderGroup = Boot Bus Extender<br />
INIFILE R:\Windows\inf\usbstor.inf [USBSTOR.AddService] StartType&nbsp;&nbsp; = 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; SERVICE_BOOT_START<br />
INIFILE R:\Windows\inf\usbstor.inf [USBSTOR.AddService] LoadOrderGroup = Boot Bus Extender<br />
INIFILE R:\Windows\inf\brmfcsto.inf [USBSTOR.AddService] StartType&nbsp;&nbsp; = 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; SERVICE_BOOT_START<br />
INIFILE R:\Windows\inf\brmfcsto.inf [USBSTOR.AddService] LoadOrderGroup = Boot Bus Extender</code></div>
<p>Now we delete the precompiled INF files, and copy our modified INF files to appropriate locations. Note that the file locations differ for x64 and x86 builds.</p>
<p><em>For x64 builds only:</em></p>
<div class="dirtycodenoclick"><code>DEL /Q R:\Windows\inf\usb.pnf<br />
DEL /Q R:\Windows\System32\DriverStore\FileRepository\usb.inf_amd64_neutral_e2b28ecac19a29af\usb.pnf<br />
DEL /Q R:\Windows\winsxs\amd64_usb.inf_31bf3856ad364e35_6.1.7600.16385_none_26ed589d28235a16\usb.pnf<br />
DEL /Q R:\Windows\inf\usbport.pnf<br />
DEL /Q R:\Windows\System32\DriverStore\FileRepository\usbport.inf_amd64_neutral_5a41ca742f7973cc\usbport.pnf<br />
DEL /Q R:\Windows\winsxs\amd64_usbport.inf_31bf3856ad364e35_6.1.7600.16385_none_19b7511a1d3ea7fd\usbport.pnf<br />
DEL /Q R:\Windows\inf\usbstor.pnf<br />
DEL /Q R:\Windows\System32\DriverStore\FileRepository\usbstor.inf_amd64_neutral_c301b770e0bfb179\usbstor.pnf<br />
DEL /Q R:\Windows\winsxs\amd64_usbstor.inf_31bf3856ad364e35_6.1.7600.16385_none_a47b405db18421ea\usbstor.pnf<br />
DEL /Q R:\Windows\inf\brmfcsto.pnf<br />
DEL /Q R:\Windows\System32\DriverStore\FileRepository\brmfcsto.inf_amd64_neutral_2d7208355536945e\brmfcsto.pnf<br />
DEL /Q R:\Windows\winsxs\amd64_brmfcsto.inf_31bf3856ad364e35_6.1.7600.16385_none_7fe64f7a6167bcf6\brmfcsto.pnf<br />
COPY /Y R:\Windows\inf\usb.inf R:\Windows\System32\DriverStore\FileRepository\usb.inf_amd64_neutral_e2b28ecac19a29af<br />
COPY /Y R:\Windows\inf\usb.inf R:\Windows\winsxs\amd64_usb.inf_31bf3856ad364e35_6.1.7600.16385_none_26ed589d28235a16<br />
COPY /Y R:\Windows\inf\usbport.inf R:\Windows\System32\DriverStore\FileRepository\usbport.inf_amd64_neutral_5a41ca742f7973cc<br />
COPY /Y R:\Windows\inf\usbport.inf R:\Windows\winsxs\amd64_usbport.inf_31bf3856ad364e35_6.1.7600.16385_none_19b7511a1d3ea7fd<br />
COPY /Y R:\Windows\inf\usbstor.inf R:\Windows\System32\DriverStore\FileRepository\usbstor.inf_amd64_neutral_c301b770e0bfb179<br />
COPY /Y R:\Windows\inf\usbstor.inf R:\Windows\winsxs\amd64_usbstor.inf_31bf3856ad364e35_6.1.7600.16385_none_a47b405db18421ea<br />
COPY /Y R:\Windows\inf\brmfcsto.inf R:\Windows\System32\DriverStore\FileRepository\brmfcsto.inf_amd64_neutral_2d7208355536945e<br />
COPY /Y R:\Windows\inf\brmfcsto.inf R:\Windows\winsxs\amd64_brmfcsto.inf_31bf3856ad364e35_6.1.7600.16385_none_7fe64f7a6167bcf6<br />
EXIT</code></div>
<p><em>For x86 builds only:</em></p>
<div class="dirtycodenoclick"><code>DEL /Q R:\Windows\inf\usb.pnf<br />
DEL /Q R:\Windows\System32\DriverStore\FileRepository\usb.inf_x86_neutral_e24d8d3fec6e4567\usb.pnf<br />
DEL /Q R:\Windows\winsxs\x86_usb.inf_31bf3856ad364e35_6.1.7600.16385_none_cacebd196fc5e8e0\usb.pnf<br />
DEL /Q R:\Windows\inf\usbport.pnf<br />
DEL /Q R:\Windows\System32\DriverStore\FileRepository\usbport.inf_x86_neutral_ba59fa32fc6a596d\usbport.pnf<br />
DEL /Q R:\Windows\winsxs\x86_usbport.inf_31bf3856ad364e35_6.1.7600.16385_none_bd98b59664e136c7\usbport.pnf<br />
DEL /Q R:\Windows\inf\usbstor.pnf<br />
DEL /Q R:\Windows\System32\DriverStore\FileRepository\usbstor.inf_x86_neutral_83027f5d5b2468d3\usbstor.pnf<br />
DEL /Q R:\Windows\winsxs\x86_usbstor.inf_31bf3856ad364e35_6.1.7600.16385_none_485ca4d9f926b0b4\usbstor.pnf<br />
DEL /Q R:\Windows\inf\brmfcsto.pnf<br />
DEL /Q R:\Windows\System32\DriverStore\FileRepository\brmfcsto.inf_x86_neutral_39ae61431a44cded\brmfcsto.pnf<br />
DEL /Q R:\Windows\winsxs\x86_brmfcsto.inf_31bf3856ad364e35_6.1.7600.16385_none_23c7b3f6a90a4bc0\brmfcsto.pnf<br />
COPY /Y R:\Windows\inf\usb.inf R:\Windows\System32\DriverStore\FileRepository\usb.inf_x86_neutral_e24d8d3fec6e4567<br />
COPY /Y R:\Windows\inf\usb.inf R:\Windows\winsxs\x86_usb.inf_31bf3856ad364e35_6.1.7600.16385_none_cacebd196fc5e8e0<br />
COPY /Y R:\Windows\inf\usbport.inf R:\Windows\System32\DriverStore\FileRepository\usbport.inf_x86_neutral_ba59fa32fc6a596d<br />
COPY /Y R:\Windows\inf\usbport.inf R:\Windows\winsxs\x86_usbport.inf_31bf3856ad364e35_6.1.7600.16385_none_bd98b59664e136c7<br />
COPY /Y R:\Windows\inf\usbstor.inf R:\Windows\System32\DriverStore\FileRepository\usbstor.inf_x86_neutral_83027f5d5b2468d3<br />
COPY /Y R:\Windows\inf\usbstor.inf R:\Windows\winsxs\x86_usbstor.inf_31bf3856ad364e35_6.1.7600.16385_none_485ca4d9f926b0b4<br />
COPY /Y R:\Windows\inf\brmfcsto.inf R:\Windows\System32\DriverStore\FileRepository\brmfcsto.inf_x86_neutral_39ae61431a44cded<br />
COPY /Y R:\Windows\inf\brmfcsto.inf R:\Windows\winsxs\x86_brmfcsto.inf_31bf3856ad364e35_6.1.7600.16385_none_23c7b3f6a90a4bc0<br />
EXIT</code></div>
<p>The next part is optional. It creates a differencing .VHD from the original file. The allows you to leave the base .VHD file intact and make all subsequent changes to the differencing .VHD instead. It’s a great way of building a base operating system image and then branching it for development work or testing. Once again, make sure you note the correct volume number when doing this. So, from the original elevated command prompt:</p>
<div class="dirtycodenoclick"><code>DISKPART<br />
SELECT VDISK FILE=&quot;M:\BootVHDs\W2K8R2ENT.vhd&quot;<br />
DETACH VDISK<br />
CREATE VDISK FILE=&quot;M:\BootVHDs\W2K8R2ENT_DIFF.vhd&quot; PARENT=&quot;M:\BootVHDs\W2K8R2ENT.vhd&quot;<br />
SELECT VDISK FILE=&quot;M:\BootVHDs\W2K8R2ENT_DIFF.vhd&quot;<br />
ATTACH VDISK<br />
LIST VOLUME<br />
SELECT VOLUME 8<br />
ASSIGN LETTER=R<br />
EXIT</code></div>
<p>Now all that is left to do is to create a bootloader on the external USB disk and create an entry for our Native VHD Boot. When you BCDEDIT /COPY {default} below, note the resultant GUID that you are given and use that instead of the {5aaa2c7a-a627-11de-83c7-001372bf1815} listed in the example. So, continuing from the same command window:</p>
<div class="dirtycodenoclick"><code>BOOTSECT /NT60 M: /FORCE /MBR<br />
BCDBOOT R:\WINDOWS /S M:<br />
BCDEDIT /STORE M:\BOOT\BCD /COPY {default} /d &quot;Windows Server 2008 R2 Enterprise&quot;<br />
BCDEDIT /STORE M:\BOOT\BCD /SET {5aaa2c7a-a627-11de-83c7-001372bf1815} DEVICE VHD=[LOCATE]\BootVHDs\W2K8R2ENT_DIFF.vhd<br />
BCDEDIT /STORE M:\BOOT\BCD /SET {5aaa2c7a-a627-11de-83c7-001372bf1815} OSDEVICE VHD=[LOCATE]\BootVHDs\W2K8R2ENT_DIFF.vhd<br />
BCDEDIT /STORE M:\BOOT\BCD /SET {5aaa2c7a-a627-11de-83c7-001372bf1815} DETECTHAL ON</code></div>
<p>And that’s it. Reboot your computer, select your external USB disk as your boot device, and you should see the entry you created above. Windows will start, perform the final stages of setup (rebooting a couple of times in the process) and you will be done.</p>
<p>I have personally used this method to store a large number of .VHD files (fixed, dynamic and differencing) and to use them to boot Windows 7 Enterprise and Ultimate in both x64 and x86 platform versions, and the various Windows Server 2008 R2 editions, and found it to be an extremely flexible option.</p>
<p>I’ve even had some success swapping the external USB disk between machines. It doesn’t always work (and to be honest, I haven’t had the time to look any deeper into why) but I’ve used the same native VHD boot instance on a Fujitsu Siemens Celsius H240, Lifebook T4210 and Lifebook S7220, swapping it backwards and forwards between machines and letting Windows manage the driver changes each time without issue.</p>
<p>I’ve also had success with native VHD boot using .VHD files created from Windows Backup and have recently started looking at using the files created from the SysInternals <a href="http://technet.microsoft.com/en-us/sysinternals/ee656415.aspx">Disk2vhd</a> tool too. Pop back sometime soon for those adventures...</p>
<p><span style='font-size:7.0pt'>
<p>Originally a <a href="http://www.markwilson.co.uk/blog/2009/10/native-vhd-boot-windows-7-or-server-2008-r2-from-an-external-usb-drive.htm">guest post</a> at <a href="http://www.markwilson.co.uk/blog/">Mark Wilson's blog</a>.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.garrymartin.com/blog/2009/10/native-vhd-boot-windows-7-or-windows-server-2008-r2-from-an-external-usb-drive/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Native VHD Boot on a Windows XP computer</title>
		<link>http://www.garrymartin.com/blog/2009/10/native-vhd-boot-on-a-windows-xp-computer/</link>
		<comments>http://www.garrymartin.com/blog/2009/10/native-vhd-boot-on-a-windows-xp-computer/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 17:53:31 +0000</pubDate>
		<dc:creator>Garry Martin</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[vhd boot]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.garrymartin.com/blog/?p=77</guid>
		<description><![CDATA[Like almost every other corporate in the world, where I work there is a standard build deployed to everyone. The default in our particular organisation is a 32-bit Windows XP OS regardless of the capabilities of the laptop or desktop it is deployed to. Over the years, this has caused a number of problems that [...]]]></description>
			<content:encoded><![CDATA[<p>Like almost every other corporate in the world, where I work there is a standard build deployed to everyone. The default in our particular organisation is a 32-bit Windows XP OS regardless of the capabilities of the laptop or desktop it is deployed to. Over the years, this has caused a number of problems that have required an increasing number of “exemptions” from standard policy to allow people to run a different Windows version or platform.</p>
<p>Whilst this hasn’t been too much of a problem for the majority of the Architects I work with - after all, we’re fairly self-sufficient when it comes to supporting our environments and are infinitely capable of collectively dreaming up ever more creative workarounds for the things that don’t work - it isn’t a solution that’s manageable at scale.</p>
<p>Then, along came Windows 7 and Windows Server 2008 R2 and with them came the introduction of a great new feature - <a href="http://technet.microsoft.com/en-us/library/dd440864(WS.10).aspx">Native VHD Boot</a>. With a little configuration, this has enabled us to leave the existing Windows XP corporate build in place, and to deploy a 32-bit or 64-bit Windows 7 (Enterprise or Ultimate) or 64-bit Windows Server 2008 R2 build side-by-side, crucially without having to make any changes to the Windows XP build or the existing disk partitioning scheme.</p>
<p>To achieve this, we created a new Windows 7 or Windows Server 2008 R2 bootloader, and “chained” the original Windows XP bootloader from it. At boot, this allows us to select a Native VHD Boot into, for example, a 64-bit Windows Server 2008 R2 Enterprise build, or to select the chained bootloader which allows us to boot into the corporate Windows XP build.</p>
<p>Of course, you’ll need to create your VHD-contained Windows 7 or Windows Server 2008 R2 OS build and put it to your local disk, and this post doesn’t go into that detail, but once you have done that, the steps below will allow you to create a new bootloader and chain your existing Windows XP corporate build from it.
<p>To begin, boot your computer using your Windows 7 or Windows Server 2008 R2 installation media. When you reach the Install Windows screen, press Shift+F10 to run up a Command Prompt window.
<p>To write the new Windows 7 or Windows Server 2008 R2 bootloader:</p>
<div class="dirtycodenoclick"><code>BOOTSECT /NT60 C: /FORCE /MBR</code></div>
<p>To create a BCD store from the Windows VHD:</p>
<div class="dirtycodenoclick"><code>DISKPART<br />
SELECT VDISK FILE=C:\BOOTVHDS\W2K8R2ENTX64.VHD<br />
ATTACH VDISK<br />
ASSIGN LETTER=X<br />
EXIT<br />
BCDBOOT X:\WINDOWS /S C:</code></div>
<p>To set up the Native VHD Boot:</p>
<div class="dirtycodenoclick"><code>BCDEDIT /SET {default} DEVICE VHD=[LOCATE]\BOOTVHDS\W2K8R2ENTX64.VHD<br />
BCDEDIT /SET {default} OSDEVICE VHD=[LOCATE]\BOOTVHDS\W2K8R2ENTX64.VHD<br />
BCDEDIT /SET {default} DETECTHAL ON</code></div>
<p>To set up the legacy boot:</p>
<div class="dirtycodenoclick"><code>BCDEDIT /CREATE {ntldr} /d &quot;Chain Legacy Bootloader&quot;<br />
BCDEDIT /SET {ntldr} DEVICE PARTITION=C:<br />
BCDEDIT /SET {ntldr} PATH \ntldr<br />
BCDEDIT /DISPLAYORDER {ntldr} -ADDLAST</code></div>
<p>To put things back to normal, should you ever need to:</p>
<div class="dirtycodenoclick"><code>BOOTSECT /NT52 C: /FORCE /MBR</code></div>
<p><span style='font-size:8px'>
<p>Originally a <a href="http://www.markwilson.co.uk/blog/2009/10/native-boot-from-vhd-on-a-windows-xp-computer.htm">guest post</a> at <a href="http://www.markwilson.co.uk/blog/">Mark Wilson's blog</a>.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.garrymartin.com/blog/2009/10/native-vhd-boot-on-a-windows-xp-computer/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
