0

I'm trying to expand the hard drive of my Ubuntu VM in VirtualBox from my Macbook Air terminal. But when I type in

VBoxManage modifyhd <uuid>|~/VirtualBox VMs/Ubuntu/Ubuntu.vdi --resize 20000

I get this output:

Usage:

VBoxManage modifyhd         <uuid|filename>
                            [--type normal|writethrough|immutable|shareable|
                                    readonly|multiattach]
                            [--autoreset on|off]
                            [--property <name=[value]>]
                            [--compact]
                            [--resize <megabytes>|--resizebyte <bytes>]


Syntax error: No operation specified

But I specified the operation though, so I'm a bit confused.

1

The | in such context always means use "either|or|else".

So use either:

VBoxManage modifyhd "/Users/user/VirtualBox VMs/Ubuntu/Ubuntu.vdi" --resize 20000  

You have to use the absolute path to the file or the relative path starting from the current directory.

or:

VBoxManage modifyhd <UUID> --resize 20000

The UUID of the medium has to be registered. Registered images can be listed by VBoxManage list hdds (see Section 8.4 of the VirtualBox manual, “VBoxManage list”)

Sidenotes:

Resizing does not work if the guest has snapshots (prior to version 4.3.*) nor will it work on 'fixed' drives. When doing anything that could prove as destructive as this should you make a mistake, backup the *.vdi file before you start.

After resizing the disk you have to extend the contained partition!

Download the Gparted live cd or what ever partition manager program you wish and mount it to the guests virtual CD and boot the guest. From here you can expand the primary partition to use the new space.

You can download the Gparted Live CD from here. If you have issues where Gparted fails, try with Parted Magic here. Parted Magic is no longer free to download (at least from the source).

  • I tried both suggestions but neither worked. For the second one, I got this error: VBoxManage: error: Could not find file for the medium '/Users/deannarobertazzi/8a9adf99-44ac-43323-9a32-486ff23dd4c2' (VERR_FILE_NOT_FOUND) VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component Medium, interface IMedium, callee nsISupports VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 178 of file VBoxManageDisk.cpp' but I don't even know what that means. – brown1001 Feb 26 '15 at 16:54
  • Oh sorry forgot to "" the path – klanomath Feb 26 '15 at 16:54
  • Where would I add ""? – brown1001 Feb 26 '15 at 16:55
  • i already edited my answer – klanomath Feb 26 '15 at 16:56
  • Nope, I got the same error even after adding the quotation marks. – brown1001 Feb 26 '15 at 16:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .