Está en la página 1de 15

How to increase Virtualbox disk size in 9 easy

steps
I work mostly on a Mac, but from time to time I get projects for Windows OS. I have Windows 8
virtual machine that I run under Virtualbox whenever I need to work on Windows.
Today, I needed to install Visual Studio in Windows 8 and it warned me that I would need 9 GB
free disk space in order to do the installation. I opened the windows explorer and checked the
amount of free disk space I have -

As you can see, I only had 8.94 GB free. I needed to somehow increase the disk size. So, I went
to Google. I found many blogs on this subject and all have the same suggestion - delete all the
snapshots and then issue the following command from the directory where your VDI file is
located VBoxManage modifyhd YOUR_HARD_DISK.vdi --resize SIZE_IN_MB

So, if you have no snapshots or you don't mind deleting all the snapshots, that's all you need to
do!
But, I don't want to delete the snapshots. I take snapshots often, and can't risk loosing any of my
work. If you are in similar situation, keep reading.
STEP 1 - Open Virtualbox
Open Virtualbox and select the machine that needs the disk size to be increased -

STEP 2 - Select "Clone..." option


Select "Clone..." option from "Machine" menu and give it a new name. You can also leave it to
default and change it later, then click "Continue" -

STEP 3 - Select Clone type


Select Clone type to "Full clone", then click "Continue" -

STEP 4 - Select Snapshots


Select Snapshots to "Current machine state", then click "Clone" -

Wait for the clone process to finish -

Once the clone process finishes, you will see the new virtual machine listed under Virtualbox -

STEP 5 - Increase the disk size for the new cloned machine
Issue the VBoxManage command I mentioned above, from the directory where your VDI file is
located $ cd "Virtualbox VMs/Windows 8 (64 bit) Clone"
$ VBoxManage modifyhd "Windows 8 (64 bit) Clone.vdi" --resize 40000

I wanted the disk size to be increased to 40GB. You may want a different size, so, change the
above command accordingly.
STEP 6 - Run new cloned machine
Run the new cloned machine. You will notice, that even after we increase the disk size,
Windows is still reporting the same old smaller size -

This is because the disk partition size does not automatically grow with the disk size. We will
need to increase the disk partition size.

STEP 7 - Open "Disk Management"


Open "Disk Management". You will notice "unallocated" space on the disk -

STEP 8 - Increase partition size


Select the disk that needs to be expanded (C: drive in my case), then from Action menu, select
"All Tasks", then select "Extend Volume". The "Extend Volume Wizard" window will open,
click "Next" -

In the following screen click "Next" -

In the following screen click "Finish" -

Now, you will be back in the "Disk Management" window with the partition expanded to the
size you wanted -

STEP 9 - Check the new disk size in Windows explorer


Open Windows explorer and go to "My Computer". You will see the disk size is now increased -

That's it! Hope you find this tutorial useful.


Posted 29th December 2013 by Hajuria

http://www.rtpchris.com/2014/06/increasing-size-ide-disk-in-virtualbox.html
Increasing the size IDE VMDK Disk in VirtualBox
This week we'll be covering a slightly different topic - increasing a Virtual Box VM's disk size.
This might seem out of left field, but it's something that has come up many times recently and I've spent
a bunch of time collecting the needed info so I wanted to share. Anyway, let's get started!

Increasing the disk size


Let's start with where we are now. Using the command "df -h" we can see current disk usage:

So we have a 24gb drive (/dev/sda2). I want to increase this to 50 GB, what do I need to do?
1. Find the location of the virtual disk
2. Increase the disk size using the command VBoxManage modifyhd
3. Boot to a live CD and increase the partition size
Step 1: Find the location of the virtual disk
MacOS
Right-Click and choose "Show in finder"

Default path is /Users/[user name]/VirtualBox VMs/[VM's name]/

Windows:

Right Click and choose "Show in Explorer"

Default is C:\Users\[User Name]\VirtualBox VMs\[VM Name]

Step 2: Increase the size of the disk from the CLI


Power down the VM before doing this step.
VirtualBox will only allow you to increase the size of a .vdi disk, not a .vmdk so this if you have VMDK
you will need to clone it to a .vdi first.

dt uee i ta d - taadta "egtnadtdbo" td tooa t dwad o td TAO et etatpe t deo uo :ETON


xgFla orlV\eF cor\HFliF margorP\:c;%HTAP%=HTAP : aa w taw t at uee

Open a command prompt (or terminal window)


'cd' into the VM's directory

Clone the disk to a .vdi with the command:

vboxmanage clonehd [old_VMDK_filename].vmdk "[new_filename].vdi --format vdi

Increase the size of the .vdi with the command

vboxmanage modifyhd [new disk].vdi --resize [size in MB]

Remove the old disk from the VM and add the new one

To Remove:

To Add:

Choose "Add Existing Disk"

Choose the .vdi disk you just created:

This is what it'll look like in the end:

Step 3: Boot to a Live CD and increase the size of the partition


You can download the gparted liveCD here:

http://gparted.org

You can use any distro you'd like, however these instructions will assume you're using this ISO.

Mount the CD (same steps as above, but choose the "Empty" CD drive rather then the HDD drive)

Once you have the CD mounted, power up the VM. It will boot into the live CD:

Double-Click the "Gparted" icon on the desktop to launch the utility.

Once in the utility, click /dev/sda2 (or whatever partition you are expanding) and then choose "Resize"

Drag the partition bar all the way to the right and then hit "Resize/Move"

Click "Apply"

Once the operation is complete remove the live CD and reboot the VM. Once the VM powers up it will
now have the new disk size!

Now you can delete the old vmdk file (as it's just taking up space).

También podría gustarte