Extending the system disk on a Windows VM

I have had to do this on a few different occasions, and while its simple, I do not always remember the procedure so here it is for others to reference when needed.

The issue is you setup your windows VM and after a while you start running out of disk space.  What do you do?

The easies thing is to add a new disk to the VM image and put most of the installed programs there, but that requires that you have planned ahead of time.  If you resize the system disk in a Windows VM, you will have the un allocated space when you restart the VM, but Windows does not let you extend that drive. Here is that easiest way to proceed.  Keep in mind that you will most likely loose all your snapshots using this procedure.

Requirements

  • Windows VM whose disk will be extended
  • Second Windows VM that will be used to extend the disk size of the first.
  • Windows XP or higher on both VMs

Procedure

  1. Shut down the VM image you want to extend.
  2. Open the settings of a second Windows VM (it must be shutdown as well).
  3. Add a new disk to the second Windows VM, but instead of creating a new disk file, choose the system disk from the VM you want to extend.
  4. Start the second Windows VM.
  5. Check to make sure the new drive and all its contents show up now in the VM.
  6. Start a terminal session (cmd.exe)
  7. Type diskpart
  8. At the new prompt, type list volume
  9. Choose the right value by typing select volume <#>, where <#> is the number of the volume you want to extend.
  10. Once the volume has been selected, just type extend.  This will extend the drive to use all the available unallocated space.
  11. type exit.
  12. Shut down the second VM.
  13. Remove the drive you added in step 3 from the second VM.
  14. Start the Windows VM you wanted to extend and now the disk space should be available for use.

Hope you found this useful and good luck.


Posted

in

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *