Archive for the ‘Linux’ category

How to increase size of VirtualBox VM disk

October 6th, 2009

VirtualBox256I needed more space in my WinXP VM, and here’s how I increased it’s disk size.

Currently (VirtualBox 3.0.6) there is no feature to resize .vdi images. But there is a workaround for that. You can increase the space available for your VM using these steps:

  1. Create a new temporary virtual disk (with the size of your data on VM) and attach it to the VM
  2. Boot to your VM and install a disk-cloning software (e.g. for Windows there is Acronis True Image or Norton Ghost), use it to create a backup/clone image file on the attached temporary disk.
  3. Create a third virtual disk with the size you would like to have for your VM
  4. Detach your original virtual disk from your VM, attach the new bigger disk and the temporary disk (that has the backup/clone image) to your VM
  5. Use Recovery disk (of the disk-cloning software you used in step 2) to boot to your VM (actually, you can mount it’s image) and use restore function to restore your files to the new larger disk.
  6. Detach temporary disk and unmount the recovery disk.

You should have your VM with the larger disk now. Check if everything is working OK, and delete the temporary and old disk images.
This is just an example which worked perfectly for me, I believe you can achieve this using other clone/backup tools and maybe even w/o using the temporary virtual disk. Have fun!

How to reduce your VirtualBox disk image size

October 4th, 2009

VirtualBox256I use VirtualBox on my Mac when I need to test/use/check something on Windows or Linux. This is very useful application from Sun (and it’s completely free!).

If you use VirtualBox, you’ve probably already seen that the size of the “.vdi” image file can be a lot bigger than disk space actually used in your Virtual Machine. And it grows with time as you use your VM.

There is a solution to that. You can shrink your vdi images to the size that files actually are using inside of them in 3 quick steps:

  1. Launch your VM and defragment the disk.
  2. Zero free space (use sdelete.exe -c on Windows VM, there are tools for other OS’es too)
  3. Compact the vdi file, e.g., on Mac I run such command in Terminal:
    $ VBoxManage modifyhd WindowsXP.vdi –compact