Posts Tagged ‘VDI’

Create VHD Images Using VirtualBox

Yesterday, I wrote a post offering some VHD image files of various sizes for download. However, if you’re a bit more intrepid, you might want to create some of your own.

Despite the fact that (as far as I’m aware) you can’t create VHD image files using the GUI version of Oracle’s VirtualBox software, it is possible to create them using the command line tool ‘VBoxManage’.

Here’s how:

$ VBoxManage createhd --filename 40GB_VHD.vhd --size 40000 --format VHD --variant Standard

This command is fairly self-explanatory. Options as follows:

  • createhd (create a virtual disk image)
  • –filename [filename.vhd]
  • –size [size in MB]
  • –format [specify the new file as a VHD image]
  • –variant [‘Standard’ equates to self-expanding]

VBoxManage and other VBox command line tools are installed when you load the full version of VirtualBox (available here), so there’s nothing extra you need to load on. This command works on PC, Mac and Linux. Enjoy!