I have figured out how to increase the size of the Freesurfer Virtualbox disk. This turned out to be non-trivial and was greatly facilitated by the CloneVDI tool.

I tried a number of methods before using this tool but they did not result in a bootable virtual disk for reasons that remain unclear to me. Those methods include creating a new larger virtual disk, then using gparted to copy the old disk contents to the new disk contents and then expanding the disk to fill the new larger space. I also tried using the unix dd utility to copy the old to new disk and using the VBoxManage command line program to try to clone the disk.

The instructions below require some familiarity with using unix tools such as gparted to setup the disk. If you have no experience with this find someone who does.

I should probably add that your virtual box should be shutdown before you do any of this and you should have made a backup copy in case you select the wrong virtual disk in this process and mess it up. (The usual disclaimer applies- i.e., if you mess up your freesurfer virtual disk with all your data, and don't have a backup, it's your problem.)

The CloneVDI tool, (get it here: http://forums.virtualbox.org/viewtopic.php?f=6&t=22422) works like a charm. Start the tool and you will see a GUI for cloning your freesurfer vdi disk. You just select your current freesurfer vdi file as the source, and then a new destination vdi file. I generated a new UUID for the new disk and increased the virtual drive size to 25 GB (but you can choose whatever size you want). Then click proceed.

Once the new disk is generated you will need to fix it up a bit with gparted. The overview is that when you examine the disk in gparted you will notice that the old filesystem occupies only a portion of the disk (the first partition). This is followed by an extended partition that contains a linux swap partition. In order to expand the size of the freesurfer installation you will need to delete the linux swap and the extended partition, enlarge the primary partition and then recreate the extended partition and the linux swap. The steps are as follows:

Download the gparted-live iso (http://sourceforge.net/projects/gparted/files/gparted-live-stable/).

Start virtualbox, open the virtual media manager and add the gparted-live iso under CD/DVD images.

Also add the new cloned hard disk. 

Now open the virtual box settings. Under storage you will need to add the new virtual hard disk and change it to be the primary master. (You will have to change the old freesurfer virtual disk to be the secondary slave and then you can select the new disk as the primary master. Also make sure the gparted-live disk (iso) is selected as the CD/DVD device.

Now boot the virtualbox and immediately press F12 which allows you to select the boot device. Choose the gparted-live CD.

Once gparted starts it should recognize your visual disks and show them in the GUI. Make sure you have selected your new visual disk and NOT the old one. If you have properly designated the new virtual disk as the primary master it should be identified as /dev/sda.

You should notice that there is a primary partition (/dev/sda1) which is your freesurfer installation. There will also be an extended partition (/dev/sda2) that contains the swap partition (/dev/sda5).

Delete the swap partition and then the extended partition.

Now expand the primary partition consistent with your new disk size BUT remember to leave room for the swap partition. (You must have a swap partition on linux or the installation definitely won't work properly.) The old swap was 400 MB but if you increase the RAM on your virtual disk you may want the swap to be 2 GB. So for a 25 GB disk your primary partition will be about 23 GB and swap will be 2 GB.

After expanding the primary partition, recreate the extended partition as /dev/sda2 and then within that recreate the linux-swap partition- it will be /dev/sda5.

Apply the changes, and then shutdown gparted.

Now unmount the gparted-disk and you can also unmount your old freesurfer installation.

Reboot and voila (if everything worked correctly) you will have the your freesurfer installation and oodles (or GB) of additional disk space.

Happy freesurfing,
Darren

P.S: I don't monitor the freesurfer  list so email both the list and me (d DOT gitelman AT gmail DOT com) if there are questions about this. I will try to answer, but no promises as to when.