{"id":1203,"date":"2009-01-11T11:23:00","date_gmt":"2009-01-11T11:23:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/cesardelatorre\/2009\/01\/11\/windows-7-natively-booting-from-a-vhd-file-virtual-pc-image\/"},"modified":"2009-01-11T11:23:00","modified_gmt":"2009-01-11T11:23:00","slug":"windows-7-natively-booting-from-a-vhd-file-virtual-pc-image","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/windows-7-natively-booting-from-a-vhd-file-virtual-pc-image\/","title":{"rendered":"Windows 7 &#8211; Natively Booting from a .VHD file (Virtual PC image)"},"content":{"rendered":"<p><P>[Update 15 August 2009 &#8211; Tested with Windows 7 RTM final version]&nbsp;<\/P>\n<P>The most important thing to keep in mind is that we currently (prior to Windows 7) cannot natively boot from any kind of .VHD.&nbsp;<\/P>\n<P>Actually, I have just managed to boot from a Windows 7&nbsp;installed on a new .VHD, and&nbsp;I installed it right from the Windows 7 DVD. We can do a similar process with &#8220;Windows Server 2008 R2 (beta)&#8221; installed on a .VHD file, as well.<\/P>\n<P>If you&#8217;d use Virtual PC 2007 to install the Virtual image, the produced .VHD wouldn&#8217;t work when trying to boot from the .VHD.<B>&nbsp;<\/B><\/P>\n<P><B>A.- &nbsp;Creating the .VHD file and Windows 7 installation on that .VHD file<\/B><\/P>\n<P><B>UPDATED: When using Windows 7 RC1 &#8220;plain vanilla&#8221; installed, it usually creates a small initial partition (about 100Mb),&nbsp;and then, when you do the following steps, you have to specify d: drive instead c: drive. If you try with c: and you get an error message sying something like &#8220;You don&#8217;t have space enough&#8221;, try&nbsp;specifying&nbsp;d: drive.&nbsp;<\/B><\/P>\n<P><B>1. Boot the machine using the Windows 7 DVD<BR>2. Choose Windows Repair<BR>3. start CMD<BR>4. Run Diskpart<BR>5. Type: Create vdisk file=c:\\Windows7.vhd maximum=40000 type=expandable<BR>6. Type: select vdisk file=c:\\Windows7.vhd<BR>7. Type: attach vdisk (in previous Betas, it was &#8216;surface&#8217; instead of &#8216;attach&#8217;)<BR>8. Type: &#8216;exit&#8217; (you exit Windows Repair, but<\/B><B>&nbsp;<U>Do Not Reboot<\/U>)<BR>9. Install Windows 7 to this attached .VHD (From Win7 installation, you now have to &#8216;see&#8217; another Hard Drive, <U>you&#8217;ll need to create a partition &amp; format it, first<\/U>. You might get an error\/warning saying that your computer hardware might not support this disk, just ignore it..).<BR>10. Reboot, and you got it!!!!<\/B><\/P>\n<P><B>&#8212;<\/B><\/P>\n<P><B>B.- Configure boot options<\/B><\/P>\n<P>You might want to chenge dual boot options, options string name, etc.&nbsp;&nbsp;<\/P>\n<P>When you want to configure the boot options of windows you can use <B>bcdedit.exe<\/B> or <B>EasyBCD<\/B>&nbsp;to modify the boot settings.<\/P>\n<P>Be careful if you use EasyBCD, as current version might not have new Windows 7 options, yet&#8230; <\/P>\n<P>So, <B>bcdedit.exe<\/B> is harder to use, as it is a console app, but it will work ok for sure! \ud83d\ude42<\/P>\n<P>For instance, once you have booted in Windows 7 (any boot, you might have 2 &#8216;Windows 7&#8217; option strings&#8230; ;-)), you might want to change those boot options strings. In order to do so, start a CMD prompt and run bcdedit.exe (in \\Windows\\System32) to see the GUID of your boot options:<\/P>\n<P><B>bcdedit \/v<\/B><\/P>\n<P>Remember\/copy the GUID&nbsp;of your VHD installation and type the following line, of course, changing my &#8216;xxxxxxxx&#8217; stuff to your GUID.<\/P>\n<P><B>bcdedit \/set {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} description &#8220;Windows 7 .VHD Image&#8221;<\/B><\/P>\n<P>You can put the description you like, but the above line&nbsp;will change&nbsp;the description for your VHD installation boot option.<\/P>\n<P>You can also change the order of the boot options typing the following:<\/P>\n<P><B>bcdedit \/displayorder {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} \/addlast<\/B><\/P>\n<P>&#8212;<\/P>\n<P>Finally, once you have these kind of .VHD images, you can copy it and have as many BOOT options as you want.<\/P>\n<P>The easiest way is to copy an originall boot menu option, like:<\/P>\n<P><B>bcdedit \/copy {Original_GUID_Number} \/d &#8220;my new description&#8221;<\/B><BR>or<BR><B>bcdedit \/copy {current} \/d &#8220;my new description&#8221;<BR><\/B>or<BR><B>bcdedit \/copy {default} \/d &#8220;my new description&#8221;<\/B><BR><\/P>\n<P>Type again the following to see the new GUID for your new copied boot option:<\/P>\n<P><B>bcdedit \/v<\/B><\/P>\n<P>Copy that GUID to&nbsp;a notepad or a paper&#8230;&nbsp;<\/P>\n<P>After that, you must change the 2 pointers within the menu option, so they point to the new\/right .VHD file:<BR><B><\/B><\/P>\n<P><SPAN class=\"Apple-style-span\">bcdedit \/set {My_new_GUID_Number} device vhd=[C:]\\MyNewVpcFile.vhd<\/SPAN>&nbsp;<\/P>\n<P><B>bcdedit \/set {My_new_GUID_Number} osdevice vhd=[C:]\\MyNewVpcFile.vhd<\/B><\/P>\n<P>&#8212;<\/P>\n<P>So! ,this kind of natively booting is great when you have many Virtual PC images and you want to run it the fastest possible way, I mean, almost like a native installation (We might have a slight delay because everything is stored within a single file, but, it must be a very small difference). In any&nbsp;case, we&#8217;re not running a virtual environment nor 2 operating systems at the same time, it must be much faster than using <B>Virtual PC<\/B> or <B>VMware<\/B>.&nbsp;\ud83d\ude42<\/P>\n<P>Btw, if you need more detailed info because you don&#8217;t really know Windows 7 setup, neither&nbsp;bcdedit.exe, check the following post. It is a STEP BY STEP procedure with pictures, etc.:<\/P>\n<P><A href=\"http:\/\/www.sevenforums.com\/tutorials\/2953-virtual-hard-drive-vhd-file-create-start-boot.html\">http:\/\/www.sevenforums.com\/tutorials\/2953-virtual-hard-drive-vhd-file-create-start-boot.html<\/A><\/P>\n<P>&nbsp;<\/P><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[Update 15 August 2009 &#8211; Tested with Windows 7 RTM final version]&nbsp; The most important thing to keep in mind is that we currently (prior to Windows 7) cannot natively boot from any kind of .VHD.&nbsp; Actually, I have just managed to boot from a Windows 7&nbsp;installed on a new .VHD, and&nbsp;I installed it right [&hellip;]<\/p>\n","protected":false},"author":362,"featured_media":12806,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[116],"class_list":["post-1203","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cesardelatorre","tag-windows-7"],"acf":[],"blog_post_summary":"<p>[Update 15 August 2009 &#8211; Tested with Windows 7 RTM final version]&nbsp; The most important thing to keep in mind is that we currently (prior to Windows 7) cannot natively boot from any kind of .VHD.&nbsp; Actually, I have just managed to boot from a Windows 7&nbsp;installed on a new .VHD, and&nbsp;I installed it right [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/posts\/1203","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/users\/362"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/comments?post=1203"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/posts\/1203\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/media\/12806"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/media?parent=1203"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/categories?post=1203"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cesardelatorre\/wp-json\/wp\/v2\/tags?post=1203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}