Resize Ubuntu 10.04 VirtualBox VM virtual disk [duplicate]

How do I resize my virtual disk space? I'm running Ubuntu 10.04 LTS with only 8GB (which is the default allocated size) but it's running low on disk space. Thanks.


Here's the screenshot. Thanks to @Suhaib for the +points in reputation.

How to Resize Virtual Disk Image


Solution 1:

The last 2 comments in this forum greatly helped me, which said:

Oxwivi

Do I do that on Windows? Because if I do that it says: 'vboxmanage' is not recognized as an internal or external command, operable program or batch file.

sean.dybob June 8th, 2011, 09:07 AM

vboxmanage is found inside the virtualbox installation directory, should be inside C:\Program Files\Oracle\VirtualBox\ directory.

These are the steps I did (Host OS is Windows):

1) File >> Virtual Media Manager >> Select VDI >> Release

2) Copy the location of the VDI inside the Properties box. In my case, it's:

C:\Users\Se7eN\VirtualBox VMs\LUCID_LYNX\JH.vdi

3) Go to Google.com and type your desired size in gigabyte to be converted to megabyte. For example: 10 GB = MB

The result would be 10240.

4) Open the command line and type/copy this:

cd C:\Program Files\Oracle\VirtualBox

This is the location of the VirtualBox software you installed in your computer.

Notice that you have two VirtualBox folders, 1) "VirtualBox VMs", which contains your virtual machines, and 2) "VirtualBox", which is the program.

5) Lastly, run:

VBoxManage modifyhd YOUR_VDI_LOCATION --resize SIZE_IN_MEGABYTES

VBoxManage modifyhd C:\Users\Se7eN\VirtualBox VMs\LUCID_LYNX\JH.vdi --resize 10240

I have screenshots for all of the above steps, but need to earn more than 10 reputation to upload the image. Hope this helps. Thanks.

Solution 2:

Thanks for sharing. The downside. It is not implemented for VMDK file type, yet.

PS C:\Program Files\Oracle\VirtualBox> .\VBoxManage.exe modifyhd "C:\Users\John\VirtualBox VMs\Ubuntu UZH DS\-disk2.vmdk" --resize 15360
VBoxManage.exe : 0%...
At line:1 char:17
+ .\VBoxManage.exe <<<<  modifyhd "C:\Users\John\VirtualBox VMs\Ubuntu UZH DS
\-disk2.vmdk" --resize 15360
    + CategoryInfo          : NotSpecified: (0%...:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

Progress state: VBOX_E_NOT_SUPPORTED

VBoxManage.exe: error: Resize hard disk operation for this format is not implem
ented yet!

However, you could first transform the VMDK to VDI and then resize the VDI container.

VBoxManage clonehd original.vmdk new.vdi --format VDI

Analog command applies for Linux.