Windows Virtual PC Cannot attach the virtual hard disk

Asked By 20 points N/A Posted on -
qa-featured

Hello,

I have created Virtual Hard Disk with Microsoft Disk2VHD toll.

On it I have done some backup files, but only on it I have back up files.

When I want to use this Virtual back up error message appears.

Please help, I need to solve this problem it its possible.

Thank you in advance.

Camella

Windows Virtual PC

Cannot attach the virtual hard disk to the virtual machine. Check the values provided and try again.

OK

SHARE
Answered By 0 points N/A #121830

Windows Virtual PC Cannot attach the virtual hard disk

qa-featured

Good day camella

Here I provided you a solution to your queries.

Your problem means you have a Virtual Hard Disk file larger than 127.5GB.  Which Virtual PC does not support.

In other words, we’ve captured a 160GB hard disk, and Virtual PC won’t let us use it.

But we can fix it, it’s a two step process

First we use DiskPart, and then we use VHD Resizer.

1.DiskPart

DISKPART> select vdisk file=c:usersdaledesktopworktest.vhd

DiskPart successfully selected the virtual disk file.

DISKPART> attach vdisk

100 percent completed

DiskPart successfully attached the virtual disk file.

DISKPART> list volume

Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
———-  —  ———–  —–  ———-  ——-  ———  ——–
Volume 0     E                       DVD-ROM         0 B  No Media
Volume 1                      NTFS   Partition    100 MB  Healthy    System
Volume 2     D                NTFS   Partition    199 GB  Healthy
Volume 3     C                NTFS   Partition    265 GB  Healthy    Boot
Volume 4     F                NTFS   Partition    149 GB  Healthy

DISKPART> select volume 4

Volume 4 is the selected volume.

DISKPART> list volume

Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
———-  —  ———–  —–  ———-  ——-  ———  ——–
Volume 0     E                       DVD-ROM         0 B  No Media
…
* Volume 4     F                NTFS   Partition    149 GB  Healthy

DISKPART> shrink querymax

The maximum number of reclaimable bytes is:  106 GB (108636 MB)

DISKPART> shrink desired=40960 (Note: desired is the amount we want to prune of the image)

DiskPart successfully shrunk the volume by:   40 GB

DISKPART> list volume

Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
———-  —  ———–  —–  ———-  ——-  ———  ——–
Volume 0     E                       DVD-ROM         0 B  No Media
…
* Volume 4     F                NTFS   Partition    109 GB  Healthy

DISKPART> detach vdisk

DiskPart successfully detached the virtual disk file.

DISKPART> exit

What we now have is a VHD file still sized at 149GB, but with a 109GB partition in it.  What we need to do next is resize the VHD to 109GB.

2. VHDResizer.

Use VHDResizer to resize your newly shrunk VHD file, in this example WorkTest.VHD

(and yes, you picked a New Size larger than 109GB, you went for 120GB instead).

And finally…

Success!  It boots!

Regards,

iamraymone

Related Questions