RSS
 

How-to: Resize hard disk in VirtualBox

07 Dec

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:

  1. Run cmd.exe and cd C:\Program Files\Oracle\VirtualBox
  2. VBoxManage.exe modifyhd “<full path to the vhd/vdi>” –resize <new size in MB>
    (Note: there are two dashes before resize)
  3. Boot up the virtual machine from i.e. a Ubuntu live-cd .iso
  4. Start gparted (if not installed run sudo apt-get install gparted and when it’s done sudo gparted)
  5. Delete the swap-partition within the extended partition, move the extended to the end of the unallocated space
  6. Recreate the swap within the extended partition
  7. Resize the primary / partition to include all the unallocated space left over
  8. Shutdown the virtual and remove the iso-image
  9. Try starting up the virtual and check disk space available with df -ah in the Terminal
 
No Comments

Posted in Tech

 

Tags: , , , ,

Leave a Reply