If you cannot find the operating system that you need in the console when you create an instance, you can create a custom image and import it to the console to create an instance. This topic describes how to create a custom image and import it to Alibaba Cloud.

Prerequisites

  • VirtualBox is installed. If not, click here to download VirtualBox.
  • The network connection is stable.
  • The ISO or binary file of the operating system is installed. Example: Red Hat Enterprise Linux.
  • ossbrowser is installed. For more information, see Quick start.

Procedure

  1. Create a new virtual machine (VM) on VirtualBox.
    1. Start VirtualBox and click New.
    2. Enter the name of the new VM and select the corresponding operating system and its version. For example, set Type to Microsoft Windows and set Version to Windows 7 (64-bit).
    3. Configure the memory size.
    4. Create a virtual hard disk.
    5. Select VHD (Virtual Hard Disk) as the file type of the hard disk.
      Alibaba Cloud supports the RAW, VHD, and qcow2 formats.
    6. Select Dynamically allocated as the storage type of the hard disk.
    7. Enter the name of the virtual hard disk and click Create.
    8. After the VHD file is created, double-click the new VM to start it.
  2. Run the following command to install KVM:
    yum install qemu-kvm qemu-img libvirt
  3. Run the following command to disable the firewall of the VM:
    service firewalld stop
  4. Upload the VHD file to Object Storage Service (OSS) and use ossbrowser to upload the file to the region where you want to create an instance.
    For more information, see Quick start.
  5. Import the custom image.
    1. Log on to the ECS console.
    2. In the left-side navigation pane, choose Instances & Images > Images.
    3. In the top navigation bar, select the region where the VHD file is uploaded and click Import Image.
      For information about how to allow ECS to access OSS resources, see Import custom images.
    4. Configure the parameters and click OK.
      Note You can log on to the OSS console to obtain the OSS object URL. For more information, see Download objects.
      After the custom image is imported, it is displayed in the image list.