Syntax error: No operation specified when trying to resize Ubuntu VM 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 &lt;uuid&gt;|~/VirtualBox VMs/Ubuntu/Ubuntu.vdi --resize 20000


I get this output: 

Usage:

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


Syntax error: No operation specified


But I specified the operation though, so I'm a bit confused.
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 &lt;UUID&gt; --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).