Growing your VirtualBox Virtual Disk

Don't you just hate it when this happens:

Out of disk space

Fortunately, if you're running inside VirtualBox, you can resize your virtual disk and magically make your guest have a bigger disk very easily. There are 2 steps to doing this...

1. Resize the virtual disk

Use the VBoxManage command line tool to extend the size of the Virtual Disk, specifying the path to the disk and the size in MB:

VBoxManage modifyhd <uuid>|<filename> [--resize <megabytes>|--resizebyte <bytes>]
 

If you booted up your guest at this point, the extra space is seen as an unformatted area on the disk, like this:

So we now need to tell the guest about the extra space available.

2. Extend the guest's partition to use the extra space

How you do this step depends on your guest OS type and the tools you have available.

Linux guests often include the excellent gparted partition editor, whereas Windows 7 and 8 provide the Computer Management tool which can resize partitions.

Unfortunately, with Windows XP the Computer Management tool couldn't do this. But I do have a couple of other options:

Most Linux installable .isos include the aforementioned gparted tool, so I could simply attach, say, an Ubuntu install iso as a Virtual CD/DVD in my Windows XP vm and boot off that. (NB don't install Ubuntu, just run it from the CD). Then use gparted to extend the Windows XP partition, before finally rebooting.

But I took another route and plugged my resized virtual disk to a Windows Server 2012 vm I had lying around. Then I used the Computer Management tool in Windows Server 2012 to extend the partition of the Windows XP disk, before shutting down, unplugging the disk and reattaching to my Windows XP vm. (Note that if your vm's use different disk controllers, Windows will check the disks on booting, don't worry).

When I finally boot up my Windows XP guest I see the available disk space and all is well.

Free Space

At least until the next time ;-)

- FB 

Comments:

Can You do this online, I mean when guest is working ?
Regards
GregG

Posted by guest on December 15, 2012 at 09:31 AM GMT #

GregG,

No, you need to shutdown your guests to do this.

-FB

Posted by FatBloke on December 15, 2012 at 11:03 AM GMT #

You can do that with dell tool -> http://ftp.us.dell.com/App/ExtPart.exe

Posted by thiagomz on December 16, 2012 at 08:02 PM GMT #

I wish this worked. It didn't for me with vbox on macos X and winxp client

Posted by guest on February 08, 2013 at 10:22 PM GMT #

Post a Comment:
Comments are closed for this entry.
About

Fat Bloke

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today