Updated on 2025-04-18 GMT+08:00

Creating a VM and Installing an OS

Prerequisites

VirtualBox has been installed.

Creating an Empty VM

  1. Open VirtualBox and click New. In the displayed Create Virtual Machine dialog box, enter a VM name, select an OS type and version, and click Next.

    Take Windows 2008 64-bit as an example. The OS type must be Microsoft Windows.

    Ensure that the selected version is the same as that of the OS you want to install on the VM.

    Figure 1 Creating a VM
  2. In the Memory size dialog box, set a value and click Next.

    You can reference the VM specifications or official OS requirements. For example, set the memory size to 2,048 MB.

    Figure 2 Setting the memory size
  3. In the Hard disk dialog box, select Create a virtual hard disk now and click Create.
    Figure 3 Creating a virtual hard disk
  4. In the Hard disk file type dialog box, select VHD and click Next.
    Figure 4 Setting the hard disk file type
  5. In the Storage on physical hard disk dialog box, select Dynamically allocated and click Next.
    Figure 5 Selecting the disk allocation mode
  6. In the File location and size dialog box, set the disk size and storage location.

    For example, you can set the disk size to 25 GB.

    Figure 6 Setting the disk location and size
  7. Click Create.

Installing Windows on the VM

The procedure varies depending on the image file you use. This section uses Windows Server 2008 R2 as an example.

After the OS is installed, you need to activate it.

Use an ISO file to install Windows for the empty VM. Assume that the ISO image file is Windows_server_2008_r2.iso.

  1. In VirtualBox Manager, select the new VM and click Settings.
    Figure 7 Setting the VM
  2. Choose Storage > Empty, click in the Attributes area, and select the ISO image file Windows_server_2008_r2.iso.
    Figure 8 Selecting the ISO file to be mounted
    Figure 9 Mounted ISO file
  3. In VirtualBox Manager, select the new VM and click Start.
    Figure 10 Starting the VM
  4. Install the OS as prompted.