Monday, March 30, 2009

Resizing a VHD (Virtual Hard Drive)


2. Select the Source vhd to resize.

3. Fill in the full path to the destination vhd and the name of the vhd. Example: C:\Virtual Images\blah.vhd.

2. Type in the size that you want the hard drive to be.

3. Click the resize button. (Note: This is kind of resource intensive.)
 
4. On a computer with Virtual Server 2005 R2 SP1 installed, open a command prompt window.

5. Change to the directory C:\Program Files\Microsoft Virtual Server\vhdmount

6. Type the command vhdmount /p <Path to vhd file>\vhdfilename and hit return. Example: vhdmount /p "C:\Virtual Images\VSIMAGE.vhd"

7. You should see a message about the virtual hard drive being plugged in. At some point you will probably also see an Autoplay window pop up.

8. In the command window type diskpart and hit return.
 
9. WARNING: Since the drive is plugged into your computer, if you select the wrong drive you could potentially trash your computer.
 
10. Type list disk and hit return. On my computer this returned this.

 Disk ### Status Size Free Dyn Gpt
 -------- ------ ------ ----- --- ---
 Disk 0  Online  74 GB   0 B
 Disk 1  Online  15 GB  10 GB
 
11. Type select disk 1. The disk number will change depending on what you see in step 10.
 
12. Type list part. On my computer this returned this.
 Partition ### Type  Size  Offset
 ------------- ----------- -------  -------
 Partition 1  Primary  5107 MB    32 kb
 
13. Type select part 1, The partition number will change depending on what you see in step 12.
 
14. Type extend.
 
15. Type exit.
 
16. At the command prompt type: vhdmount /u /c <Path to vhd file>\vhdfilename and hit return. Example: vhdmount /u /c "C:\Virtual Images\VSIMAGE.vhd"
 
17. Fire up the Virtual Image that you named in step 3.
 
18. Once the Virtual machine loads you will see a message about adding your hardware and then it will want to reboot. Let it, and you should be good to go.

No comments:

Post a Comment