{"id":793,"date":"2011-07-21T19:34:18","date_gmt":"2011-07-22T00:34:18","guid":{"rendered":"http:\/\/swildow.darktech.org\/wp\/?p=793"},"modified":"2019-07-30T14:31:16","modified_gmt":"2019-07-30T19:31:16","slug":"how-to-fix-the-%e2%80%9ccannot-attach-the-virtual-hard-disk-%e2%80%a6%e2%80%9d","status":"publish","type":"post","link":"http:\/\/www.wildow.com\/blog\/?p=793","title":{"rendered":"How to fix the \u201cCannot attach the virtual hard disk \u2026\u201d"},"content":{"rendered":"<p>link\u00a0<a href=\"http:\/\/blog.wisefaq.com\/2009\/12\/31\/how-to-fix-the-cannot-attach-the-virtual-hard-disk\/\">http:\/\/blog.wisefaq.com\/2009\/12\/31\/how-to-fix-the-cannot-attach-the-virtual-hard-disk\/<\/a><\/p>\n<p><!--more--><\/p>\n<p><em>\u2026 to the virtual machine.\u00a0 Check the values provided and try again.\u201d\u00a0<\/em>error<\/p>\n<p>It sucks as an error message.\u00a0 Would it take too much programming effort to make it more meaningful\u00a0<a title=\"http:\/\/blogs.technet.com\/windows_vpc\/default.aspx\" href=\"http:\/\/blogs.technet.com\/windows_vpc\/default.aspx\">Virtual PC team<\/a>?<\/p>\n<p><strong>What does it mean?<\/strong><\/p>\n<p>It means you have a Virtual Hard Disk file larger than 127.5GB.\u00a0 Which Virtual PC does not support.<br \/>\nYou might have created this with the\u00a0<a href=\"http:\/\/technet.microsoft.com\/en-us\/sysinternals\/ee656415.aspx\">Microsoft Disk2VHD tool<\/a>.<br \/>\nTo confirm the \u201cdisk is too big\u201d problem, open the Settings on an existing Virtual PC, and try to attach the drive:<\/p>\n<p>In other words, we\u2019ve captured a 160GB hard disk, and Virtual PC won\u2019t let us use it.<\/p>\n<p><strong>But we can fix it, it\u2019s a two step process<\/strong><\/p>\n<p>First we use\u00a0<a title=\"A Description of the Diskpart Command-Line Utility\" href=\"http:\/\/support.microsoft.com\/kb\/300415\">DiskPart<\/a>, and then we use\u00a0<a title=\"VhdResize will resize Microsoft's VHD files and will also convert between Fixed and Dynamic file types. This is a sector by sector copy operation from one size\/type to the other and the source file remains unaltered.\" href=\"http:\/\/vmtoolkit.com\/files\/folders\/converters\/entry87.aspx\">VHD Resizer<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>1.DiskPart<\/strong><\/p>\n<p><code>DISKPART&gt; select vdisk file=c:\\users\\dale\\desktop\\worktest.vhd<\/code><\/p>\n<p><code>DiskPart successfully selected the virtual disk file.<\/code><\/p>\n<p><code>DISKPART&gt; attach vdisk<\/code><\/p>\n<p><code>100 percent completed<\/code><\/p>\n<p><code>DiskPart successfully attached the virtual disk file.<\/code><\/p>\n<p><code>DISKPART&gt; list volume<\/code><\/p>\n<p><code>Volume ###\u00a0 Ltr\u00a0 Label\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Fs\u00a0\u00a0\u00a0\u00a0 Type\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Size\u00a0\u00a0\u00a0\u00a0 Status\u00a0\u00a0\u00a0\u00a0 Info<br \/>\n----------\u00a0 ---\u00a0 -----------\u00a0 -----\u00a0 ----------\u00a0 -------\u00a0 ---------\u00a0 --------<br \/>\nVolume 0\u00a0\u00a0\u00a0\u00a0 E\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 DVD-ROM\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0 B\u00a0 No Media<br \/>\nVolume 1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 NTFS\u00a0\u00a0 Partition\u00a0\u00a0\u00a0 100 MB\u00a0 Healthy\u00a0\u00a0\u00a0 System<br \/>\nVolume 2\u00a0\u00a0\u00a0\u00a0 D\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 NTFS\u00a0\u00a0 Partition\u00a0\u00a0\u00a0 199 GB\u00a0 Healthy<br \/>\nVolume 3\u00a0\u00a0\u00a0\u00a0 C\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 NTFS\u00a0\u00a0 Partition\u00a0\u00a0\u00a0 265 GB\u00a0 Healthy\u00a0\u00a0\u00a0 Boot<br \/>\nVolume 4\u00a0\u00a0\u00a0\u00a0 F\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 NTFS\u00a0\u00a0 Partition\u00a0\u00a0\u00a0 149 GB\u00a0 Healthy<\/code><\/p>\n<p><code>DISKPART&gt; select volume 4<\/code><\/p>\n<p><code>Volume 4 is the selected volume.<\/code><\/p>\n<p><code>DISKPART&gt; list volume<\/code><\/p>\n<p><code>Volume ###\u00a0 Ltr\u00a0 Label\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Fs\u00a0\u00a0\u00a0\u00a0 Type\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Size\u00a0\u00a0\u00a0\u00a0 Status\u00a0\u00a0\u00a0\u00a0 Info<br \/>\n----------\u00a0 ---\u00a0 -----------\u00a0 -----\u00a0 ----------\u00a0 -------\u00a0 ---------\u00a0 --------<br \/>\nVolume 0\u00a0\u00a0\u00a0\u00a0 E\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 DVD-ROM\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0 B\u00a0 No Media<br \/>\n...<br \/>\n* Volume 4\u00a0\u00a0\u00a0\u00a0 F\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 NTFS\u00a0\u00a0 Partition\u00a0\u00a0\u00a0 149 GB\u00a0 Healthy<\/code><\/p>\n<p><code>DISKPART&gt; shrink querymax<\/code><\/p>\n<p><code>The maximum number of reclaimable bytes is:\u00a0 106 GB (108636 MB)<\/code><\/p>\n<p><code>DISKPART&gt; shrink desired=40960<\/code>\u00a0(Note: desired is the amount we want to prune of the image)<\/p>\n<p><code>DiskPart successfully shrunk the volume by:\u00a0\u00a0 40 GB<\/code><\/p>\n<p><code>DISKPART&gt; list volume<\/code><\/p>\n<p><code>Volume ###\u00a0 Ltr\u00a0 Label\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Fs\u00a0\u00a0\u00a0\u00a0 Type\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Size\u00a0\u00a0\u00a0\u00a0 Status\u00a0\u00a0\u00a0\u00a0 Info<br \/>\n----------\u00a0 ---\u00a0 -----------\u00a0 -----\u00a0 ----------\u00a0 -------\u00a0 ---------\u00a0 --------<br \/>\nVolume 0\u00a0\u00a0\u00a0\u00a0 E\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 DVD-ROM\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0 B\u00a0 No Media<br \/>\n...<br \/>\n* Volume 4\u00a0\u00a0\u00a0\u00a0 F\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 NTFS\u00a0\u00a0 Partition\u00a0\u00a0\u00a0 109 GB\u00a0 Healthy<\/code><\/p>\n<p><code>DISKPART&gt; detach vdisk<\/code><\/p>\n<p><code>DiskPart successfully detached the virtual disk file.<\/code><\/p>\n<p><code>DISKPART&gt; exit<\/code><\/p>\n<p>What we now have is a VHD file still sized at 149GB, but with a 109GB partition in it.\u00a0 What we need to do next is resize the VHD to 109GB.<\/p>\n<p><strong>2. VHDResizer.<\/strong><\/p>\n<p>Use VHDResizer to resize your newly shrunk VHD file, in this example WorkTest.VHD<\/p>\n<p>&nbsp;<\/p>\n<p>(yes, I picked a New Size larger than 109GB, I went for 120GB instead).<\/p>\n<p><strong>And finally\u2026<\/strong><\/p>\n<p>Success!\u00a0 It boots!<\/p>\n<p>This article might be useful as well:<br \/>\n<a href=\"http:\/\/prologika.com\/CS\/blogs\/blog\/archive\/2010\/01\/07\/virtual-adventures.aspx\">Mount base and differencing VHD disks using Windows Virtual PC on Windows 7 x64.<\/a><\/p>\n<p>To recap, the tools used were:<br \/>\n<a href=\"http:\/\/support.microsoft.com\/kb\/300415\">DiskPart<\/a>\u00a0(included in Windows)<br \/>\n<a href=\"http:\/\/technet.microsoft.com\/en-us\/sysinternals\/ee656415.aspx\">Disk2VHD<\/a><br \/>\n<a href=\"http:\/\/vmtoolkit.com\/files\/folders\/converters\/entry87.aspx\">VHDResizer<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>link\u00a0http:\/\/blog.wisefaq.com\/2009\/12\/31\/how-to-fix-the-cannot-attach-the-virtual-hard-disk\/<\/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-793","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\/793","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=793"}],"version-history":[{"count":4,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/793\/revisions"}],"predecessor-version":[{"id":2101,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/793\/revisions\/2101"}],"wp:attachment":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=793"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=793"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}