7

This question already has an answer here:

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

marked as duplicate by karel, TheXed, Eric Carvalho, Kevin Bowen, David Foerster Oct 20 '16 at 11:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • virtual disk space, you mean ubuntu is running as a guest in virtual box? – Sam Nov 20 '12 at 18:04
  • yes.. only 1GB left, there's a window that pops up, giving a warning.. – jezureru Nov 20 '12 at 18:10
  • @suhaib, that is running on WinXP..mine is Ubuntu.. – jezureru Nov 20 '12 at 18:20
  • @Jane did you look at the 2nd solution. Which is the command line solution ? that one is used for any hardisk. whether it is Xp or Ubuntu – Suhaib Nov 20 '12 at 18:21
  • 1
    I already resolved it, but I can't upload a screenshot of what I did..need to earn more than 10 reputation.. – jezureru Nov 21 '12 at 17:44
10

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.

  • Hey, thanks for the mention. Fixed thread link. :) – Oxwivi Nov 25 '13 at 14:25
  • modifyhd has been deprecated for Oracle Virtualbox version: 6.06 the correct way of doing it is to do the following command: VBoxManage modifymedium disk "C:\Users\iin584\VirtualBox VMs\Ubuntu-19-HpL\Ubuntu-19-HpL.vdi" --resize 30720 (obviously replace the vdi URI with your own) – Beezer Jun 12 at 8:49
  • The issue however is that the guest Ubuntu does not recognize the addition of the above, even though Oracle Virtualbox succeeds in increasing the limit. I shutdown and restarted Virtualbox. If anyone has any clues it would be appreicated. – Beezer Jun 12 at 9:05
  • I am getting a permission error (windows 10 host, on an aadvark guest vdi file): " --resize 60999 VBoxManage.exe: error: Permission problem accessing the file for the medium 'C:\Users\Andy\VirtualBox VMs\ArtfulAadvark_17.10_fresh' (VERR_ACCESS_DENIED) VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium, callee IUnknown VBoxManage.exe: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 179 of file VBoxManageDisk.cpp – hello_there_andy Jun 28 at 16:59
1

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.