Thursday, June 24, 2010

Expanding a Windows VM System partition

There are two jobs to do to expand a Windows VM's System partition. The first is to expand the virtual disk. The second is to expand the guest OS's partition to include the newly added drive space.

Expanding the Virtual Disk
  1. Shutdown the VM if it is running.

  2. To expand the virtual disk, use vmware-vdiskmanager on the relevant vmdk file.
    I was resizing a 4Gb drive to be 6Gb so for me the command was:

    vmware-vdiskmanager -x 6GB Windows.vmdk

    The vmware-vdiskmanager.exe tool should be located in the Program Files/VMWare/VMWare Server directory. The tool will chug for a while and report that it has resized your drive.

Expand the Guest OS's Partition
To perform this step I made use of the gparted utility that comes with Ubuntu. There is a Gparted linux distro. I tried it but had problems loading it in VMware. I'm sure you can use any livecd that contains the gparted utility.
  1. Get the ubuntu iso (I used 9.10 because I had it lying around) and set it to be in your CD drive in the VM options (accessible while the VM is off by choosing "Edit Virtual Machine Settings").

  2. Start the VM. Click the VM quickly as soon as it begins to load and press ESC to enter the boot menu. Choose Boot from CD and then try out ubuntu without installing it (that's ubuntu's livecd mode).

  3. Once you're in ubuntu press alt-f2 to open the run menu and launch gnome-terminal.

  4. From the terminal launch sudo gparted.

  5. In gparted, click the divider between your existing partition and the unallocated space and drag it over to give the unallocated space to the system partition. Save your changes and close gparted.

  6. Shutdown the VM.

  7. Start the VM and allow it to boot into Windows like it usually does. Windows will do a disk check and boot with your newly resized drive.


References:

No comments:

Post a Comment