Friday, July 30, 2010

Enlarge VirtualBox NTFS Disk Image

I ran out of disk space on my virtual Windows XP computer. I deleted some files and uninstalled a few unnecessary applications, but this didn't quite cut it, so I decided to enlarge the disk image from 10GB to 30GB - a sizeable upgrade, that should be enough for quite a while:
  1. backup and then shutdown the Windows VM
  2. create a new virtual disk with the appropriate size, via the File->Virtual Media Manager tool
  3. attach this disk image to the Windows VM via the storage settings dialog
  4. download the GParted Live ISO image (I used the "testing" image)
  5. mount the ISO image on the Windows' VM virtual optical drive (again, via the storage settings dialog)
  6. boot the VM from the ISO image (should happen automatically)
  7. use GParted to copy the NTFS partition from the small disk image, and then paste it to the new large disk image
  8. GParted should now ask you for the size of the new pasted partition: modify its size so that it takes up all available space on the new disk image
  9. apply the chages, and wait for the process to finish
  10. set the boot flag on the new partition
  11. close GParted and shutdown the VM
  12. remove the CD image from the virtual optical disk drive, and set the new disk image as the only disk image attached to the VM
  13. start the Windows VM - it should boot (unless you missed the boot flag part above) and then Windows will automatically run a disk check and start normally afterwards

No comments:

Post a Comment