Operating Systems : Expand size of VirtualBox disk

This page last changed on Aug 18, 2015 by admin.

The goal

Expand the disk size of a Windows (XP/7) VM running in VirtualBox 4.0 on Mac OS X.

Verify current settings

VBoxManage list hdds

This will display a list of existing VirtualBox harddisks with their UUIDs.

Resize the device

Open up a terminal and use the VBoxManager to resize the storage device.

VBoxManage modifyhd <uuid> --resize <new size in megabytes>

Resize the partition in Windows 7

Open up Disk Management and extend the volume to use the newly created space.

Resize the partition in XP

  1. Download a GParted LiveCD from here http://sourceforge.net/projects/gparted/files/gparted-live-stable/
  2. Mount this ISO in the virtual machine
  3. Make sure the CD is the first item in the boot order
  4. Boot the virtual machine
  5. Resize the partition with GParted
  6. Shut down the VM
  7. Remove the ISO from the configuration

Windows XP will perform a CHKDSK operation on first boot after the resize and wants to restart once. But after that you are good to go. Enjoy the space!