{"id":922,"date":"2012-03-01T23:57:38","date_gmt":"2012-03-02T04:57:38","guid":{"rendered":"http:\/\/swildow.darktech.org\/wp\/?p=922"},"modified":"2012-03-01T23:57:38","modified_gmt":"2012-03-02T04:57:38","slug":"boot-from-vhd","status":"publish","type":"post","link":"http:\/\/www.wildow.com\/blog\/?p=922","title":{"rendered":"Boot From VHD"},"content":{"rendered":"<p><a href=\"http:\/\/www.tsaysoft.com\/knowhow\/BootFromVHD\/\">http:\/\/www.tsaysoft.com\/knowhow\/BootFromVHD\/<\/a><\/p>\n<h1>Boot From VHD<\/h1>\n<p>Windows 7 provides a unique feature called Boot From VHD. Essentially it is a storage virtualization. Usually a virtual machine consists of a virtual CPU, virtual devices, and virtual storages. Boot From VHD lets you use a real CPU, real devices, but a virtual storage. It doesn&#8217;t require Intel VT or AMD-V on the machine. After setting up Boot From VHD, what you have is a multi-boot machine. The boot is not from a partition, but from a VHD file.<\/p>\n<p><!--more--><\/p>\n<p>You can follow the steps below to create a dual-boot machine. One boot from a real drive and the other boot from a VHD file.<\/p>\n<ul>\n<li>Put Windows 7 DVD in the DVD drive and boot from DVD\/CD. In the welcome screen, you type Shift-F10 to start a command prompt.<\/li>\n<li>Locate you drive and folder to be used to store the VHD file. If you have only one hard drive, it ususally becomes drive D when in Windows Preinstallation Environment (WinPE).<\/li>\n<li>Run diskpart, and then use the command\u00a0<em>create vdisk<\/em>\u00a0and\u00a0<em>attach vdisk<\/em>\u00a0to mount the VHD file.\u00a0For example, D:\\VM\\Win7.vhd is the desired VHD file, and the desired size is 25GB.<\/li>\n<\/ul>\n<pre>D:\\VM&gt;diskpart\r\n\r\nMicrosoft DiskPart version 6.1.7600\r\nCopyright (C) 1999-2008 Microsoft Corporation.\r\nOn computer: MINWINPC\r\n\r\nDISKPART&gt; <strong>create vdisk file=D:\\VM\\Win7.vhd type=expandable maximum=25000<\/strong>\r\n\r\n 100 percent completed\r\n\r\nDiskPart successfully created the virtual disk file.\r\n\r\nDISKPART&gt; <strong>attach vdisk<\/strong>\r\n\r\n 100 percent completed\r\n\r\nDiskPart successfully attached the virtual disk file.<\/pre>\n<ul>\n<li>To make sure the VHD file is mounted correctly. Use the command\u00a0<em>list disk<\/em>\u00a0to verify.<\/li>\n<\/ul>\n<pre>DISKPART&gt; <strong>list disk<\/strong>\r\n\r\n  Disk ###  Status         Size     Free     Dyn  Gpt\r\n  --------  -------------  -------  -------  ---  ---\r\n  Disk 0    Online          232 GB      0 B\r\n* Disk 1    Online           24 GB    24 GB<\/pre>\n<ul>\n<li>Use the command\u00a0<em>exit<\/em>\u00a0to exit diskpart and command prompt.<\/li>\n<\/ul>\n<pre>DISKPART&gt; exit\r\n\r\nLeaving DiskPart...\r\n\r\nD:\\VM&gt;exit<\/pre>\n<ul>\n<li>Start the installation of Windows 7. Select the VHD disk. In this case, it is Disk 1. Setup will show a warning for\u00a0 this disk, but you can click Next to continue and the setup.<\/li>\n<li>Once the setup completes, it should create a new boot loader entry in Boot Manager, and use it as the default. The default boot loader is for VHD and the second one is for the real drive. Use the command\u00a0<em>bcdedit \/v<\/em>\u00a0to see Boot Manager and Loader settings. Each boot loader is identified by a GUID. You may get different GUIDs.<\/li>\n<\/ul>\n<pre>C:\\&gt;<strong>bcdedit \/v<\/strong>\r\n\r\nWindows Boot Manager\r\n--------------------\r\nidentifier              {9dea862c-5cdd-4e70-acc1-f32b344d4795}\r\ndevice                  partition=\\Device\\HarddiskVolume1\r\ndescription             Windows Boot Manager\r\nlocale                  en-US\r\ninherit                 {7ea2e1ac-2e61-4728-aaa3-896d9d0a9f0e}\r\ndefault                 {51f3be40-8088-11de-ace6-0014223d6008}\r\nresumeobject            {51f3be3f-8088-11de-ace6-0014223d6008}\r\ndisplayorder            {51f3be40-8088-11de-ace6-0014223d6008}\r\n                        {51f3be3c-8088-11de-ace6-0014223d6008}\r\ntoolsdisplayorder       {b2721d73-1db4-4c62-bf78-c548a880142d}\r\ntimeout                 30\r\n\r\nWindows Boot Loader\r\n-------------------\r\nidentifier              <strong>{51f3be40-8088-11de-ace6-0014223d6008}<\/strong>\r\ndevice                  vhd=[D:]\\VM\\Win7.vhd,locate=custom:12000002\r\npath                    \\Windows\\system32\\winload.exe\r\ndescription             Windows 7\r\nlocale                  en-US\r\ninherit                 {6efb52bf-1766-41db-a6b3-0ee5eff72bd7}\r\nrecoverysequence        {51f3be41-8088-11de-ace6-0014223d6008}\r\nrecoveryenabled         Yes\r\nosdevice                vhd=[D:]\\VM\\Win7.vhd,locate=custom:22000002\r\nsystemroot              \\Windows\r\nresumeobject            {51f3be3f-8088-11de-ace6-0014223d6008}\r\nnx                      OptIn\r\n\r\nWindows Boot Loader\r\n-------------------\r\nidentifier              <strong>{51f3be3c-8088-11de-ace6-0014223d6008}<\/strong>\r\ndevice                  partition=D:\r\npath                    \\Windows\\system32\\winload.exe\r\ndescription             Windows 7\r\nlocale                  en-US\r\ninherit                 {6efb52bf-1766-41db-a6b3-0ee5eff72bd7}\r\nrecoverysequence        {51f3be3d-8088-11de-ace6-0014223d6008}\r\nrecoveryenabled         Yes\r\nosdevice                partition=D:\r\nsystemroot              \\Windows\r\nresumeobject            {51f3be3b-8088-11de-ace6-0014223d6008}\r\nnx                      OptIn<\/pre>\n<ul>\n<li>Use the command<em>\u00a0bcdedit \/set<\/em>\u00a0to change the description of a boot loader. For example, to change the description of the boot loader for VHD to &#8220;Windows 7 on VHD&#8221;<\/li>\n<\/ul>\n<pre>C:\\&gt;<strong>bcdedit \/set {51f3be40-8088-11de-ace6-0014223d6008} description \"Windows 7 on VHD\"<\/strong><\/pre>\n<ul>\n<li>Use the command\u00a0<em>bcdedit \/displayorder<\/em>\u00a0to change the list order of boot loaders. For exmaple, to move the boot loader for VHD to the last one in the list.<\/li>\n<\/ul>\n<pre>C:\\&gt;<strong>bcdedit \/displayorder {51f3be40-8088-11de-ace6-0014223d6008} \/addlast<\/strong><\/pre>\n<ul>\n<li>Use the command\u00a0<em>bcdedit \/default<\/em>\u00a0to change the default boot loader. For example, to make the boot loader for the real drive as the default boot.<\/li>\n<\/ul>\n<pre>C:\\&gt;<strong>bcdedit \/default {51f3be3c-8088-11de-ace6-0014223d6008}<\/strong><\/pre>\n<p>Now the machine has become a dual-boot machine. The first and default boot loader is for the real drive, and the second boot loader is for the VHD file.<\/p>\n<p>So what&#8217;s the difference between the two? When you boot from the real drive, the real drive will get drive letter C. If you want to read from or write to Win7.vhd, you can use Disk Management (diskmgmt.msc) to attach VHD. When you boot from VHD, Win7.vhd will get drive letter C, and the real drive get the letter D. You can read from or write to both of them. One interesting thing is that when you check the size of Win7.vhd on Drive D, you will find the size is what you defined for the VHD, even the type is expandable. You might think you could create an expandable VHD with a big drive size. When the VHD drive size is too big, bigger than the free space on the real drive, you will get a blue screen when booting from VHD.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>http:\/\/www.tsaysoft.com\/knowhow\/BootFromVHD\/ Boot From VHD Windows 7 provides a unique feature called Boot From VHD. Essentially it is a storage virtualization. Usually a virtual machine consists of a virtual CPU, virtual devices, and virtual storages. Boot From VHD lets you use &#8230; <a class=\"more-link\" href=\"http:\/\/www.wildow.com\/blog\/?p=922\">Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-922","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/922","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=922"}],"version-history":[{"count":1,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/922\/revisions"}],"predecessor-version":[{"id":923,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/922\/revisions\/923"}],"wp:attachment":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=922"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=922"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=922"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}