mikelindner.com

powering the Internet since 1995

| Photography | Computing | Cooking |

Resizing Virtualbox Disk

April 18th, 2010

Virtualbox does not have the function to resize virtual disks.  Strange as it may seem in a virtualised environment, but there we are.

It’s pretty simple to “trade up” to a new virtual disk however – just follow Mike’s simple steps!

1. Create a new virtual disk with the Virtual Media Manager (on the File menu) to the size you’d like.

2. Use the Settings dialog to add the virtual disk to your virtual machine

3. Insert a Gparted LiveCD into your cd drive, and mount it with the virtual machine’s setting dialog.

4. Reboot into Gparted and check you have both disks.

5. Get a command line and enter the following command:

dd if=/dev/sda of=/dev/sdb

Please NOTE: You must check (use the Gparted program that starts when Gparted boots) that you are using the correct disk names, the ones above are the most likely in a simple WinXP virtual machine – you must know what you are doing here

6. When the dd command finishes – and it will take a long time  in the order of 30 mins for 4 Gb – you can now shut the machine down and, using the settings dialog, unmount the CD and the OLD hdd.

7. Boot up to make sure your new hdd is working.

8. Remount the cdrom and reboot into Gparted again.

9. Use the Gparted dialog to resize the disk.

10. Boot into your mew vdisk, your guest OS will probably want to do a file system check, but that’s it, you can now enjoy a larger virtual disk, with very little pain.