Assume that you are using OSX as your “host” OS and Windows 7 as your “guest” OS. You accidentally create a virtual disk that is too small in Windows. Now you’ve run out of space and you need to expand the size of the disk. Virtualbox to the rescue! It allows you to do this, but only from the command line. There is an excellent tutorial on this over here: http://hajuria.blogspot.com/2013/12/how-to-increase-virtualbox-disk-size-in.html .
The only thing that I would add to it is a reminder with regard to paths in OS X. Generally speaking, the default path at the terminal command prompt is very limited. Mine has been expanded slightly, but it looks like this:
$ echo $PATH
This means that the instructions given in Hajuria’s blog won’t work out of the box. You’ll need something like this (from within the Terminal.app):
$ cd /Applications/VirtualBox.app/Contents/MacOS
$ ./VBoxManage modifyhd /Users/YOURUSERNAME/VirtualBox\ VMs/Windows\ 7\ Clone/Windows\ 7\ Clone.vdi --resize 40000
Thanks to Hajuria for a very useful blog post!