Specify a Virtual Hard Disk

There are many ways in which can provide hard disk space to a VM, see .

The most common way is to use a virtual hard disk. This is a large image file on your physical hard disk, whose contents presents to your VM as if it were a complete hard disk. You can copy this file to another host, and use it with another VM.

To prevent your physical hard disk on the host OS from filling up, limits the size of the image file. But the image file must be large enough to hold the contents of the guest OS and the applications you want to install. For a Windows or Linux guest, you will probably need several gigabytes for any serious use. The size limit of the image file can be changed later, see .

If you choose Do Not Add a Virtual Hard Disk at this stage you will need to attach a hard disk using VirtualBox Manager or VBoxManage commands before you can install a guest operating system.

Create a Virtual Hard Disk

Follow these steps to create a virtual hard disk to use with this VM. To prevent your physical hard disk on the host OS from filling up, limits the size of the image file. But the image file must be large enough to hold the contents of the guest OS and the applications you want to install. For a Windows or Linux guest, you will probably need several gigabytes for any serious use. The limit of the image file size can be changed later, see .

  1. Select Create a Virtual Hard Disk Now. This creates a new empty virtual hard disk image, located in the VM's machine folder.

  2. Enter the following settings:

    • Disk Size. Use the slider to select a maximum size for the hard disk in the new VM.

    • Pre-Allocate Full Size. This setting determines the type of image file used for the disk image. Select this setting to use a fixed-size file for the disk image. Otherwise, will use a dynamically allocated file for the disk image.

      The different types of image file behave as follows:

      • Dynamically allocated file. This type of image file only grows in size when the guest actually stores data on its virtual hard disk. Therefore, this file is small initially. As the drive is filled with data, the file grows to the specified size.

      • Fixed-size file. This type of image file immediately occupies the file specified, even if only a fraction of that virtual hard disk space is actually in use. While occupying much more space, a fixed-size file incurs less overhead and is therefore slightly faster than a dynamically allocated file.

      For more details about the differences, see .

Use an Existing Virtual Hard Disk

Follow these steps to use a virtual hard disk that already exists on the host. Ensure the image file is in a suitable location (usually the machine folder) and not in use by other VMs.

  1. Select Use an Existing Virtual Hard Disk File

  2. Select the image file to use with the new VM, and then click Add.