Sunday, January 17, 2010

VirtualBox Resize Hard Drive

I've recently upgraded my development and virtual machines to 64bit to start working with SharePoint 2010. Much to my surprise, VirtualPC from Microsoft doesn't support 64bit guest operating systems. VirtualBox from Sun does and I've been really pleased with it so far.

On to the topic at hand. I created a new virtual hard drive and didn't give it enough space. Did quite a bit of Googling before finding an easy way to fix the mess I made for myself. This process really isn't resizing, it's copying and replacing.

1. Create a new virtual hard drive. (See step 3c below - click new)
2. Copy the contents of the old virtual hard drive to the new virtual hard drive.
           a. Open up a command window.
           b. Change the directory to the VirtualBox directory. The default is
               "C:\Program Files\Sun\VirtualBox"
           c. Execute this command VBoxManage clonehd --existing "path\old.vdi" "path\new.vdi"
3. Add the new hard drive to the virtual machine. 
           a. Select Storage
           b. Click the folder icon to the right of "Hard Drive:"
           c. Add your new hard drive
3. Release/Remove old hard drive on the same screen you added your new hard drive.
4. Make sure the new drive is set as the Primary Master (See step 3b).
5. Start Up your VM.

The additional space will not be recognized by default. Windows 7 and Server 2008 come with disk management software that will let you extend the original partition into the new partition. If you're guest operating system is not one of the above there are a number of free software products available. Look for partition software on download.com.

No comments:

Post a Comment