All Products
Search
Document Center

Elastic Compute Service:Create a virtual machine and install the Windows operating system

Last Updated:Jun 21, 2026

ECS does not support importing ISO images directly. You must use VirtualBox to create a virtual machine, install an operating system, and then export the image in VMDK or VHD format, which ECS supports.

Procedure

Follow these steps if you have already installed the VirtualBox tool and prepared an ISO image file.

This example uses VirtualBox version 7.1.0 to install Windows Server 2022 Datacenter Evaluation with a graphical interface.

Step 1: Create a virtual machine

  1. Configure the environment.

    1. Open Oracle VirtualBox. Click Global Settings and switch to the Expert tab.

    2. Customize the Default Machine Folder, then click OK.

      Virtual machine files take up significant disk space. Store them on a data disk if possible.
  2. Create a virtual machine.

    1. Click New. In the Name and operating system section, set the following parameters.

      • Name: Enter a custom name for the virtual machine.

      • ISO Image File: Select the prepared ISO image file.

      • Skip Unattended Installation: Check Skip Unattended Installation.

    2. In the Hard disk section, select Create a virtual hard disk now.

      Hard disk file type: Choose VHD or VMDK format to ensure the image can be imported into ECS without additional conversion.

    3. Click Complete to create a virtual machine.

Step 2: Install the operating system

  • BIOS: A traditional firmware interface used to initialize hardware and load the operating system. It is mainly used for compatibility with older operating systems (such as Windows XP and earlier versions).

  • UEFI: A modern replacement for BIOS that supports Secure Boot and offers faster startup times.

Important

The instance type and the image boot mode must match. If they do not match, the instance might fail to start. For details, see Boot mode rules.

BIOS

  1. Set the virtual machine boot mode to BIOS.

    1. Select the new virtual machine and click Settings in the menu bar.

    2. Under System, make sure Enable EFI (special OSes only) is not checked.

  2. Install the operating system.

    1. Click Start in the menu bar.

    2. Follow the on-screen prompts to select your preferred language and other options. Click Next, then click Install now.

    3. Select the operating system to install and click Next.

    4. Accept the Microsoft Software License Terms and click Next.

    5. Click Custom: Install Only Microsoft Server Operating System.

    6. Repartition the disk.

      Automatic installation creates a recovery partition at the end of the system disk, which blocks later expansion of the primary partition. Repartition manually instead.
      1. On the Operating System Installation Location interface, hover over Hotkeys in the menu bar, click Hotkeys > On-Screen Keyboard, and press the Shift and F10 keys to open the command line window.

      2. Run the diskpart command to open the partitioning tool.

      3. Clean the target disk.

        # Select target disk 0.
        select disk 0
        
        # Clean all partitions.
        clean
      4. Create partitions.

        # (Optional) Create a boot partition for boot files. This example uses 200 MB; keep it under 300 MB.
        create partition primary size=200
        active # Mark the partition as active.
        
        # Create the primary partition for the operating system.
        create partition primary
        
        # List partitions. Two main partitions indicate success.
        list partition
      5. Type exit twice and press Enter each time to close the command prompt.

    7. On the Where do you want to install Windows? screen, click Refresh to load the new partition information.

    8. Select the primary partition and click Next. Wait for the operating system installation to complete.

  3. Log on to the operating system.

    1. After installation, the system starts automatically. Follow the prompts to set a password.

    2. Hover your cursor over Hotkeys in the menu bar, and click Hotkeys > Send Ctrl-Alt-Del to unlock the screen.

    3. Enter your custom password to log on.

    4. Confirm successful BIOS-mode boot.

      1. Right-click the image.png icon and open Disk Management. Verify that Disk 0 shows the system partition as Healthy.

      2. Right-click the image.png icon, select Run, type msinfo32, and press Enter to open System Information. Check that BIOS Mode shows Legacy. This confirms successful BIOS-mode boot.

UEFI

  1. Set the virtual machine boot mode to UEFI.

    1. Select the new virtual machine and click Settings in the menu bar.

    2. Under System, check Enable EFI (special OSes only) and click OK.

  2. Create an operating system.

    1. Select the new virtual machine and click Start in the menu bar.

    2. When the message press any key to boot from CD or DVD appears, press any key to load the installer.

    3. Follow the on-screen prompts to select your preferred language and other options. Click Next, then click Install now.

    4. Select the operating system to install and click Next.

    5. Accept the Microsoft Software License Terms and click Next.

    6. Click Custom: Install Only Microsoft Server Operating System.

    7. Repartition the disk.

      Automatic installation creates a recovery partition at the end of the system disk, which blocks later expansion of the primary partition. Repartition manually instead.
      1. On the Installation Location Of The Operating System interface, hover over Hotkeys in the menu bar, click Hotkeys > On-Screen Keyboard, and press Shift and F10 to open the command-line window.

      2. Run the diskpart command to open the partitioning tool.

      3. Clean the target disk.

        # Select target disk 0
        select disk 0
        
        # Clean all partitions
        clean
      4. Convert the disk to GPT format for UEFI boot.

        convert gpt
      5. Create partitions.

        # UEFI requires an EFI system partition for boot files. This example uses 200 MB; keep it under 300 MB.
        create partition efi size=200
        
        # Create the primary partition for the operating system.
        create partition primary
        
        # List partitions. Two partitions (EFI system and primary) indicate success.
        list partition
      6. Type exit twice to close the command prompt.

    8. On the Where do you want to install Windows? screen, click Refresh to load the new partition information.

    9. Select the primary partition and click Next. Wait for the operating system installation to complete.

  3. Log on to the operating system.

    1. After installation, the system starts automatically. Follow the prompts to set a password.

    2. Hover your cursor over Hotkeys in the menu bar, and click Hotkeys > Send Ctrl+Alt+Del to unlock the screen.

    3. Enter your custom password to log on.

    4. Confirm successful UEFI-mode boot.

      1. Right-click the image.png icon and open Disk Management. Verify that Disk 0 shows the EFI system partition as Healthy.

      2. Right-click the image.png icon, select Run, type msinfo32, and press Enter to open System Information. Check that BIOS Mode shows UEFI. This confirms successful UEFI-mode boot.

Step 3: System configuration

  1. Enable Remote Desktop connections to Windows.

    1. Click the image.png icon and open Control Panel.

    2. In Control Panel, select System and Security.

    3. Under System, click Allow remote access.

    4. On the Remote tab, confirm that Allow remote connections to this computer is checked.

  2. Disable the built-in Windows firewall.

    1. In Control Panel, under System and Security, click Check firewall status under Windows Defender Firewall.

    2. In the navigation pane on the left, select Turn Windows Defender Firewall on or off.

    3. On the Customize settings for each network location page, set both Private network settings and Public network settings to Turn off Windows Defender Firewall.

What to do next

  1. Install Vminit to ensure the ECS instance running the image completes initialization successfully.

  2. Install virtio drivers. Before importing the image, verify and install virtio drivers to prevent the ECS instance from failing to start.