Disk expansansion in VirtualBox

I have been using Sun’s (now Oracle’s) VirtualBox to run Ubuntu 10.04 as a guest operating system inside a Windows 7 host.  I’ve also tried Windows 7 inside an Ubuntu host, but I’m doing it the other way ’round now since I end up using so many Windows-specific applications.

Anyway, what started out as an experiment has become a routine setup for me.  Unfortunately, when I set up the Ubuntu guest, I didn’t give it much virtual disk space.  So I’m confronted with cloning and enlarging the virtual disk I use for Ubuntu.

After reading many out-dated accounts of how to do this that don’t take into account the UUID and grub problems that could result in simply cloning the contents of disks, I think I have a solution.  Here is what I tried using VirtualBox 3.2.2:

  1. Create a new virtual disk (vdi) the size you want using the tools in virtualbox (File -> Virtual Media Manager).
  2. Set the new vdi as slave in the specified Virtualbox (Machine -> Settings -> Storage).
  3. Download (if needed) and attach the latest .iso for Clonezilla (Settings -> Storage).
  4. Check that the boot order will pick up the CD before the hard drives.
  5. Use Virtualbox to boot from Clonezilla.
  6. Follow Clonezilla prompts to copy the old hard drive (vdi) to the new hard drive (vdi).  Naturally, make sure you get order correct.  Use the disk-to-disk option and allow Clonezilla to use grub when done.
  7. When done, use Virtualbox to dismount the Clonezille iso.
  8. If any adjustments are needed in the partitions on the new disk, you can download (if needed) the gparted live iso (the one you can boot from) and use virtualbox to boot from it.  I had to do that to adjust the sizes of the partitions.
  9. After the new disk is just how you want it, dismount any iso from the cd drive, remove the original vdi drive, and reassign the new vdi drive the the top boot order (IDE primary master, e.g.).
  10. Now boot from virtualbox.
  11. If all goes well, give yourself a nice beverage.

vbox windows xp guest startup hangs on black screen

Ubuntu wanted to update some CUPS programs and maybe some others.   I didn’t pay that much attention to the auto update message before I clicked on it to go ahead.  After the updates, none of which were kernel updates, my windows xp guest wouldn’t start correctly.  It would make it to a black screen and just hang with no useful information in sight.

I shut down the guest, then removed all the options I could under settings.  That allowed Windows XP to boot.  I then shut down XP and enabled all the settings I needed and reboot XP.  All was well.