Expanding the size of a Windows Guest VM hard drive on Mac-hosted Virtualbox

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
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/opt/Ghostscript/bin:/opt/ImageMagick/bin

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!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s