Expanding Virtualbox Harddrive
I ran into an interesting issue the other day. My virtualbox harddrive was running out of space and I couldn't figure out how to expand it. Finally, I did the following:
1. Create a new disk using Virtual Disk Manager (in VirtualBox goto File -> Virtual Disk Manager).
2. Download System Rescue CD (http://www.sysresccd.org/Download).
3. Set the new disk image as the second hard disk and the System Rescue CD iso file as it's CD.
4. Boot from the CD.
5. At the command prompt type startx.
6. When X Windows starts, type gparted in the terminal.
7. In gparted select the windows partition and choose copy.
8. Select the second hard disk.
9. Right click on the representation of the disk and click paste
10. Gparted will prompt you for the size of the disk, drag the slider to the max size and click apply.
11. When it's done, right click on the disk and choose Manage Flags, and select Boot.
14. Exit gparted and power off the VM.
15. Change the VM settings to the new bigger disk and deselect the iso as the CD.
16. Boot the VM into your windows install on it's new bigger disk!
2. Download System Rescue CD (http://www.sysresccd.org/Download).
3. Set the new disk image as the second hard disk and the System Rescue CD iso file as it's CD.
4. Boot from the CD.
5. At the command prompt type startx.
6. When X Windows starts, type gparted in the terminal.
7. In gparted select the windows partition and choose copy.
8. Select the second hard disk.
9. Right click on the representation of the disk and click paste
10. Gparted will prompt you for the size of the disk, drag the slider to the max size and click apply.
11. When it's done, right click on the disk and choose Manage Flags, and select Boot.
14. Exit gparted and power off the VM.
15. Change the VM settings to the new bigger disk and deselect the iso as the CD.
16. Boot the VM into your windows install on it's new bigger disk!
It's as simple as that. Go figure!

Easy!
Thank you very much!
After 'dragging the slider to the max' and click 'Apply', a dialog complains:
"Partition cannot have sector of size -1"
Why is this happening?