Cloning a VirtualBox Win XP installation to a larger drive

For whatever combination of reasons, I haven't had any good luck in cloning Windows XP installations to a new, larger drive.  It just has never worked for me until today (sort of).  I want to document my success in copying a Win XP Pro installation from a 10gb VirtualBox VDI to a 30gb VirtualBox VDI.  It's not the same as moving Windows to a 'real' disk, but it's better than anything else I've been able to do so far.  

  1. Create the new, bigger hdd (vdi file) in VirtualBox.  I did this as part of creating a whole new Virtual Machine.  
  2. Attach the 'old' vdi file/disk as another hard drive in the new virtual machine.
  3. Also attach a downloaded gparted .iso file as the virtual cd/dvd drive.
  4. Boot the device (to gparted)
  5. Open a shell, and issue a 'sudo dd if=/dev/sda of=/dev/sdb' command, assuming /dev/sda is the old vdi, and /dev/sdb is the new one
  6. Wait for a long time (about 35 minutes for a 10gb, nearly full, partition)
  7. Shut down the virtual machine, disconnect the 'old' hard drive/vdi and remove the .iso file from the virtual cd/dvd drive
  8. Boot the machine and confirm that it starts properly, then shut it down again
  9. Re-attach the gparted .iso dvd, and boot to it
  10. From gparted, resize the partition on your new vdi file to take up all the space on the drive
  11. Shut down, remove the .iso from the dvd/cd drive, and reboot
  12. Watch/hope as Windows XP disk checker verifies your hard drive (it's checking because the disk size has changed)

That's it.  I hope it wasn't a fluke!Resources: http://mylinuxramblings.wordpress.com/2011/05/20/mini-how-to-cloning-hard-disks-which-fail-using-clonezilla/I needed that one; Clonezilla failed to copy the disk (and the partition) despite multiple attempts, and following other recipes that claim success doing it that way.http://forums.virtualbox.org/viewtopic.php?p=65211#p65211Looks good, and lots of kudos from others about their success in doing it that way.

FAQ and article with resources regarding resizing disks in general

Add new comment

The content of this field is kept private and will not be shown publicly.

Filtered HTML

  • Web page addresses and email addresses turn into links automatically.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Add new comment

Filtered HTML

  • Web page addresses and email addresses turn into links automatically.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.