Just a note to myself again, this time on how to resize a virtual hard disk in VirtualBox. Stupid as I was I never changed from the really small 8GB disk VirtualBox suggested per default and had to pay up quickly after I started fiddling around in my virtual Ubuntu installation.
Here are the steps:
- Run cmd.exe and cd C:\Program Files\Oracle\VirtualBox
- VBoxManage.exe modifyhd “<full path to the vhd/vdi>” –resize <new size in MB>
(Note: there are two dashes before resize) - Boot up the virtual machine from i.e. a Ubuntu live-cd .iso
- Start gparted (if not installed run sudo apt-get install gparted and when it’s done sudo gparted)
- Delete the swap-partition within the extended partition, move the extended to the end of the unallocated space
- Recreate the swap within the extended partition
- Resize the primary / partition to include all the unallocated space left over
- Shutdown the virtual and remove the iso-image
- Try starting up the virtual and check disk space available with df -ah in the Terminal