ECS does not support importing ISO images directly. Instead, use VirtualBox to create a virtual machine, install an operating system (OS), and export it as an image in the ECS-supported VMDK or VHD format.
Procedure
Follow these steps after you install VirtualBox and prepare an ISO image file.
This topic uses the installation of Windows Server 2022 Datacenter Evaluation with a graphical user interface (GUI) in VirtualBox 7.1.0 as an example.
Step 1: Create a virtual machine
Configure the environment.
Open
Oracle VirtualBox, click Preferences, then click the Expert tab.Specify a custom location for the Default Machine Folder, then click OK.
Virtual machine files can be large. We recommend storing them on a data disk.
Create the virtual machine.
Click New. In the Name and Operating System section, configure the following parameters.
Name: Enter a custom name for the virtual machine.
ISO Image: Select the ISO image file you prepared.
Skip Unattended Installation: Select this checkbox.
In the Hard Disk section, select Create a Virtual Hard Disk Now.
Hard Disk File Type and Variant: Select VHD or VMDK. This ensures you can directly import the image into ECS without conversion.

Click Finish to create the virtual machine.
Step 2: Install the OS
BIOS: A traditional firmware interface used to initialize hardware and load an OS. It is primarily used for compatibility with older OS such as Windows XP and earlier versions.
UEFI: A modern replacement for BIOS that supports Secure Boot and offers faster startup times.
An image's boot mode must be compatible with the target instance type. An instance may fail to start if its boot mode and instance type do not match. For more information, see Instance boot mode.
BIOS
Set the virtual machine's boot mode to BIOS.
Select the newly created virtual machine and click Settings in the menu bar.
On the System tab, clear the Enable EFI (special OSes only) checkbox.
Install the OS.
Click Start on the menu bar.
Follow the on-screen instructions to select the installation language and other preferences. Click Next, then click Install Now.
On the Select The Operating System To Install page, click Next.
Select the checkbox to accept the Microsoft Software License Terms, then click Next.
Click Custom: Install Microsoft Server Operating System Only.
Re-partition the disk.
The default Windows installation process creates a recovery partition at the end of the system disk, which prevents you from resizing the primary partition later. Therefore, you must partition the disk manually.
To open a command-line interface, on the Where Do You Want To Install The Operating System? screen, hover over Hotkeys in the menu bar, and then click . Press the
ShiftandF10keys to open the command-line window.Run the
diskpartcommand to open the partitioning tool.Clear the target disk.
# Select the destination disk 0. select disk 0 # Clean all partitions. cleanCreate partitions.
# (Optional) Create a boot partition for the boot loader. This example uses a size of 200 MB. The recommended size is less than 300 MB. create partition primary size=200 active # Set the partition as the boot partition. # Create a primary partition to install the OS. create partition primary # View the partition result. If two primary partitions are in the output, the partitions are created. list partitionTo close the command-line interface, enter
exittwice and press Enter each time.
On the Where Do You Want To Install The Operating System? screen, click Refresh to load the new partition information.
Select the Primary partition and click Next. Wait for the OS installation to complete.
Log on to the OS.
After the installation is complete, the system restarts automatically. Follow the on-screen prompts to set the system password.
To unlock the screen, hover over Input in the menu bar and click .
Enter the password that you set and log on to the OS.
Verify that the system started successfully in BIOS mode.
Right-click the
icon and open Disk Management. Confirm that the system partition of Disk 0 is Healthy.Right-click the
icon, select Run, and enter msinfo32to open the System Information window. Check that BIOS Mode is set to Legacy. This confirms that the system started in BIOS mode.
UEFI
Set the virtual machine's boot mode to UEFI.
Select the newly created virtual machine and click Settings in the menu bar.
On the System tab, select Enable EFI (for specific operating systems only) and click OK.
Install the OS.
Select the newly created virtual machine and click Start in the menu bar.
When the message press any key to boot from CD or DVD appears, press any key to load the system.
Follow the on-screen instructions. Enter the installation language and other options. Click Next, and then click Install Now.
On the Select The Operating System To Install page, click Next.
Select the checkbox to accept the Microsoft Software License Terms, then click Next.
Click Custom: Install Microsoft Server Operating System Only.
Re-partition the disk.
The default Windows installation process creates a recovery partition at the end of the system disk, which prevents you from resizing the primary partition later. Therefore, you must partition the disk manually.
To open a command-line interface, on the Where Do You Want To Install The Operating System? screen, in the menu bar, hover over Hotkeys, click , and press the
ShiftandF10keys to open a command-line window.Run the
diskpartcommand to open the disk partition tool.Clear the target disk.
# Select the destination disk 0. select disk 0 # Clean all partitions. cleanTo use UEFI boot mode, convert the disk partition style to GPT.
convert gptCreate partitions.
# In UEFI mode, you must create an EFI partition to store the boot loader. This example uses a size of 200 MB. The recommended size is less than 300 MB. create partition efi size=200 # Create a primary partition to install the OS. create partition primary # View the partition result. If two partitions (System and Primary) are in the output, the partitions are created. list partitionType
exitand press Enter. Repeat to close the command-line interface.
On the Installation Destination screen, click Refresh to load the new partition information.
Select the Primary partition and click Next. Wait for the OS installation to complete.
Log on to the OS.
After the installation is complete, the system restarts automatically. Follow the on-screen prompts to set the system password.
To unlock the screen, hover over Input in the menu bar and click .
Enter the password that you set and log on to the OS.
Verify that the system started successfully in UEFI mode.
Right-click the
icon and open Disk Management. Confirm that the EFI System Partition of Disk 0 is Healthy.Right-click the
icon, select Run, and enter msinfo32to open the System Information window. Verify that BIOS Mode is set to UEFI.
Step 3: Configure the system
Allow Remote Desktop connections to the Windows system.
Click the
icon to open Control Panel.In Control Panel, select System and Security.
In the System section, click Allow remote access.
On the Remote tab, confirm that Allow remote connections to this computer is selected.
Turn off the Windows Defender Firewall.
In Control Panel, navigate to System and Security. Under Windows Defender Firewall, click Check firewall status.
In the left navigation pane, select Turn Windows Defender Firewall on or off.
On the Customize settings for each type of network page, for Private network settings and Public network settings, select Turn off Windows Defender Firewall (not recommended).
What to do next
Install Vminit to ensure that ECS instances created from the image initialize correctly.
Install the virtio driver. To prevent startup failures in ECS instances created from the image, install the virtio driver before you import the image.