Saturday, 4 February 2012

How-to: Create New Virtual Disks in VirtualBox

The whole process of creating virtual Hard drives in VirtualBox is much simpler than it used to be, aided by a step-through Wizard.

The only thing  novice might want to know is the pro's and con's of some of the options.

Let's say I want to create a new virtual disk for my Mint-12 virtual machine.


Starting with version 4.0 of VirtualBox, to create new disk images, use the “Storage” page in a virtual machine’s settings dialog; disk images are now by default stored in each machine’s own folder unless you choose to keep them in anothe location. Remember you need to ensure there's enough space on your host (physical) disk to hold all the virtual disks at their full size. Unless you like to live dangerously.
  • In the main VirtualBox Window, highlight the machine in the inventory then select Settings.
  • In the Settings windows, select Storage.
  • In the Storage tree, you will have IDE or SATA disk controllers defined. It's up to you, IDE still works but SATA is a newer standard with additional performance and reliability built in.
  • Under the chosen controller, select the Add icon for hard disks (the cylinder not the CD.
  • VirtualBox gives you a confirmation box; select Create New Disk (otherwise you can go off to attach an existing virtual disk to this machine).
Now we're into the Virtual Disk Creation Wizard.
  • The first choice is the type of disk to create.
  • VDI is native to VirtualBox. It's my default to use as I don't currently use any other virtualisation software, so I don't need to share disks across packages.
  • VMDK and VHD are compatible with VM-Ware and some other virtualisation software, so choose these if you expect to move disks and data around (if you're creating virtual appliances, you know this stuff better than I do).
  • HDD is limited to the Parallels software.
Virtual Disk Storage details is where you determine the allocation type;
  • You can use the dynamically expanding storage, which only expands to fill space on your host disk as the guest machine needs it. 
  • It's a virtual disk, so while the parameters are set in advance, VirtualBox doesn't need to nab all the space at the outset. 
  • A fixed size disk might be another route if you want to ensure consistent performance and/or allocate the necessary space up front. There's no danger of running out of space on your host disk
Virtual Disk Size and Location
  • You can call your new disk anything you like and place it anywhere you like. 
  • By default VirtualBox will place it in the folder with the Virtual machine, but you can have it anywhere on any physical host disk partition on your host machine. 
  • Network attached drives need a high-performance, high-reliability network, else you get time-outs and data read-write errors.
  • Create your new hard disk with the desired size; you can specify anything from a few MB through the GB range up to 2 Terrabytes.
You get a Summary confirmation box before the final commit.

Review your settings, if you need to you can step forward and back through the Wizard changing settings until you are happy.

At the end, select the Create button and wait a couple of minutes or less for your brand new virtual disk to become available. RC