Updated on 2024-05-17 GMT+08:00

Introduction

VirtualBox

VirtualBox is free, open-source virtualization software. It was first offered by InnoTek GmbH from Germany and re-branded as Oracle VM VirtualBox when InnoTek was acquired by Oracle Corporation.

For more information about VirtualBox, visit the Oracle official website. Click here to see the guest OSs that can work with VirtualBox.

Scenarios

You can use a 32-bit or 64-bit Windows guest OS provided by VirtualBox to create an image file in VHD format.

Advantages

You can customize Windows image files.

Tools and Costs

Table 1 Tools and costs

Tool

Description

Costs

VirtualBox

VirtualBox is free, open-source virtualization software.

Download it from: https://www.virtualbox.org/wiki/Downloads

Free

VirtIO drivers

Before using an ECS or external image file to create a private image, ensure that VirtIO drivers have been installed in the OS so that new ECSs created from this image can support KVM virtualization and the network performance can be improved.

Download the driver package from:

https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/

Free

ISO image file

It is used to install an OS on an empty VM. You need to prepare it.

Document name: Windows_server_2008_r2.iso

-

(Optional) Cloudbase-Init

To ensure that you can inject initial custom information into ECSs created from the image, for example, setting the login password, you are advised to install Cloudbase-Init on the VM which is used as the image source. If you do not install it, you can log in to the ECSs only with the password specified in the image.

Download it from: http://www.cloudbase.it/cloud-init-for-windows-instances/

Free

(Optional) One-click password reset plug-in

To ensure that you can reset the password of each ECS created from the image with a few clicks, you are advised to install the one-click password reset plug-in (CloudResetPwdAgent) on the VM which is used as the image source.

https://ap-southeast-1-cloud-reset-pwd.obs.ap-southeast-1.myhuaweicloud.com/windows/reset_pwd_agent/CloudResetPwdAgent.zip

Free

Image Creation Process

The following figure shows how to use VirtualBox to create an image from an ISO file.

Figure 1 Image creation process
  1. Install VirtualBox: Prepare a host (64-bit Windows is recommended) and install VirtualBox on the host. For details, see Installing VirtualBox.
  2. Create a VM: Use VirtualBox to create an empty VM from which an image will be created. For details, see Creating an Empty VM.
  3. Install an OS on the VM: Mount an ISO file to install an OS for the VM. The ISO file determines the OS of the image you want to create. For details, see Installing Windows on the VM.
  4. Install software and plug-ins on the VM: To ensure that ECSs created from this image can run properly, install the required software and plug-ins on the VM, including VirtIO drivers, Cloudbase-Init, and one-click password reset plug-in. For details, see Configuring the VM.
  5. Obtain the image file: Export an image file in VHD format from VirtualBox. For details, see Obtaining the Image File.
  6. Register a private image: Upload the exported VHD image file to an OBS bucket and register it as a private image. Then, you can use the private image to create ECSs. For details, see Registering the Image File as a Private Image.