{"id":229,"date":"2010-01-05T16:33:28","date_gmt":"2010-01-05T14:33:28","guid":{"rendered":"http:\/\/dev.flauschig.ch\/wordpress\/?p=229"},"modified":"2010-01-05T16:33:28","modified_gmt":"2010-01-05T14:33:28","slug":"win7-boot-from-vhd-part-i","status":"publish","type":"post","link":"http:\/\/dev.flauschig.ch\/wordpress\/?p=229","title":{"rendered":"Win7 Boot from VHD &#8211; Part I"},"content":{"rendered":"<p>There is this fancy new feature in Windows 7 called &#8220;Boot from VHD&#8221;. It essentially allows you to boot your machine from a virtual disk without having to virtualize the rest of your hardware. This can be quite helpful if you want to experiment with your Win7 without reinstalling all the time because you screwed up.<\/p>\n<p>First I&#8217;ll explain how you can create and manage virtual disks. In the second part I will discuss how to install a second Win7 on the created virtual disk and how to set up the bootloader correctly.<br \/>\n<!--more--><br \/>\nThere are two ways to create virtual disks. The first is by means of the &#8220;Disk Management&#8221; utility in your computer management tool (right click your &#8220;Computer&#8221; and click &#8220;Manage&#8221;). There you can create and attach virtual disks by selecting &#8220;More Actions &gt; &#8230;&#8221;. The second way to do it is by using the diskpart command line utility. I will focus on this method because it has more options and allows greater flexibility.<\/p>\n<p>A virtual disk (*.vhd) is simply a file that contains the virtual disk&#8217;s data. You can create &#8220;fixed&#8221; or &#8220;expandable&#8221; disks. For a fixed disk, the entire disk size is allocated at once while expandable disk files grow as the virtual disk is written to. There is one issue with booting from expandable disks: if you don&#8217;t have enough physical space on the disk where your VHD resides, booting from that disk will be impossible because when booting from a VHD, windows will expand the image to full size to run.<\/p>\n<p>Start a command prompt as administrator and enter<br \/>\n<code>&gt; diskpart.exe<\/code><br \/>\nThis brings you to the diskpart command prompt where you can operate on disks all you like.<\/p>\n<p>Try entering<br \/>\n<code>&gt; help<\/code><br \/>\nor<br \/>\n<code>&gt; help create vdisk<\/code><br \/>\nYou can use this as a reference point to learn all about windows disk management.<\/p>\n<p>To create a new VHD for example, you would enter<br \/>\n<code>&gt; create vdisk file=\"C:\\virtualdisks\\myvirtualdisk.vhd\" maximum=32000<\/code><br \/>\nThis will create a new VHD file for a 32GB virtual drive.<\/p>\n<p>You can&#8217;t do much with this yet. To work with the new disk, you will have to &#8220;mount&#8221; or &#8220;attach&#8221; it first<br \/>\n<code>&gt; select vdisk file=\"C:\\virtualdisks\\myvirtualdisk.vhd\"<br \/>\n&gt; attach vdisk<\/code><\/p>\n<p>And once the disk is virtually attached to your system, you can continue by setting it up properly<br \/>\n<code>&gt; create partition primary<br \/>\n&gt; assign letter=X<br \/>\n&gt; format quick label=VirtualDisk<\/code><br \/>\nThis will make the disk accessible as drive X: (properly formated and labeled).<\/p>\n<p>Now you can start using the virtual disk as you would any regular disk, OR you can try to install another Windows 7 on it and boot the new installation. I&#8217;ll explain how to do that in the next part of this discussion.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There is this fancy new feature in Windows 7 called &#8220;Boot from VHD&#8221;. It essentially allows you to boot your machine from a virtual disk without having to virtualize the rest of your hardware. This can be quite helpful if you want to experiment with your Win7 without reinstalling all the time because you screwed &hellip; <\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[14],"tags":[],"class_list":{"0":"entry","1":"post","2":"publish","3":"author-executor","4":"has-more-link","5":"post-229","7":"format-standard","8":"category-tools"},"acf":[],"views":2420,"_links":{"self":[{"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/229"}],"collection":[{"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=229"}],"version-history":[{"count":0,"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/229\/revisions"}],"wp:attachment":[{"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=229"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}