Nexcess.com Servers.com LiquidWeb.com
Back

How to Prepare a Windows Image & Deploy it on a Cloud Server

You can deploy a cloud server from your own Windows image. This is useful when you need a preconfigured Windows environment with your own software, services, and system settings.

This guide covers how to prepare a Windows virtual machine (VM) image to run correctly in the Servers.com cloud, upload it to the customer portal, and deploy a cloud server from it.

You can use this guide in the following scenarios:

  • You already have a Windows VM and need to prepare it for the Servers.com cloud
  • You need to create a new Windows VM from an installation ISO and prepare it for the Servers.com cloud

Prerequisites

  • Customer portal account
  • Local machine (Windows, Linux, or macOS)
  • Installed virtualization software (we use QEMU in this guide)
  • Windows installation ISO (required when creating a new VM)

Image requirements

Ensure that your Windows VM meets the following requirements:

  • x64 OS architecture
  • Only BIOS boot firmware (UEFI is not supported)
  • Windows 11 is currently not supported
  • Local virtual disk in qcow2 format (recommended)
  • DHCP enabled (no static network configuration)
  • VirtIO drivers installed
  • Cloudbase-Init installed and configured
  • Image generalized using Sysprep

Prepare a Windows image

Create a VM and install Windows

Use this section only if you are creating a new VM. If you already have a configured Windows VM, skip this section.

Install QEMU

QEMU is a free and open-source cross-platform virtualization environment.

Windows
  1. Open PowerShell as an administrator
  2. Enable Windows Hypervisor Platform:
    Enable-WindowsOptionalFeature -FeatureName HypervisorPlatform -Online
  3. Install QEMU:
    • Execute the following command:
      winget install SoftwareFreedomConservancy.QEMU
    • Or use a ready-made installer for Windows
  4. Restart Windows
Ubuntu
sudo apt-get install qemu-system
Fedora
sudo dnf install qemu qemu-kvm
# or
sudo dnf install @virtualization
Red Hat/CentOS
sudo yum install qemu qemu-kvm
SUSE
sudo zypper install qemu
Arch Linux
sudo pacman -S qemu
macOS

From Homebrew:

brew install qemu

From MacPorts:

sudo port install qemu

Create a local virtual disk

When installing Windows from an ISO, you must first create a virtual disk on which you will install Windows. You can call it, for example, windows-virtual-disk.qcow2.

Specify a <disk-size> value that fits your OS installation requirements. QEMU uses standard size suffixes such as G for gigabytes (for example, 30G).

Note: Creating a virtual disk does not mount it anywhere. Later we will mount it to the VM with a -drive file=… option.
Windows

Navigate to the QEMU installation directory (%ProgramFiles%\qemu, by default) and run the following command:

.\qemu-img.exe create -f qcow2 C:\path-to\windows-virtual-disk.qcow2 <disk-size>
Linux / macOS
qemu-img create -f qcow2 windows-virtual-disk.qcow2 <disk-size>

Download VirtIO drivers

During installation, Windows does not detect VirtIO disks by default, so the driver must be loaded manually from the ISO.

VirtIO drivers are required for disk and network support in QEMU/KVM environments. You can use the prebuilt VirtIO drivers from the Fedora website. Use the drivers from the stable-virtio repository (for example, virtio-win.iso).

Launch the VM

Launch the virtual machine with your Windows OS image.

Using the -m and -smp parameters, set the VM's memory and vCPUs to match the configuration you plan to use on the cloud server.

Windows

Open PowerShell as an administrator, navigate to the QEMU installation directory (%ProgramFiles%\qemu, by default), and run:

.\qemu-system-x86_64.exe `
  -accel whpx `
  -m 4096 -smp 2 `
  -drive file=C:\path-to\windows-virtual-disk.qcow2,if=virtio,format=qcow2 `
  -drive file=C:\path-to-virtio-win.iso,media=cdrom `
  -cdrom C:\path-to-windowsOS.iso `
  -device virtio-net-pci,netdev=n1 `
  -netdev user,id=n1 `
  -boot order=d `
  -display default
Linux
qemu-system-x86_64 \
  -enable-kvm \
  -m 4096 -smp 2 \
  -drive file=windows-virtual-disk.qcow2,format=qcow2,if=virtio \
  -drive file=/path-to-virtio-win.iso,media=cdrom \
  -cdrom /path-to-windowsOS.iso \
  -device virtio-net-pci,netdev=n1 \
  -netdev user,id=n1 \
  -boot order=d \
  -display default
macOS
qemu-system-x86_64 \
  -accel tcg,thread=multi \
  -m 4096 -smp 2 \
  -drive file=windows-virtual-disk.qcow2,format=qcow2,if=virtio \
  -drive file=/path-to-virtio-win.iso,media=cdrom \
  -cdrom /path-to-windowsOS.iso \ 
  -device virtio-net-pci,netdev=n1 \
  -netdev user,id=n1 \
  -boot order=d \
  -display default

Install and configure Windows

This step applies if you are preparing a new image from a Windows installation ISO.

If you already have a preconfigured Windows system (for example, an existing VM), you can skip this step and proceed to the next section.

  1. Start the installation
    At the disk selection step, the list of available disks will be empty
Windows Setup disk selection screen with no available disks listed and the Load driver option shown
  1. Click Load driver
  2. Browse to the VirtIO ISO (for example, CD Drive (D:) virtio-win-0.1.285)
Windows Setup Browse for Folder dialog with the VirtIO ISO selected as CD Drive (D:)
  1. Browse to the VirtIO storage driver directory that matches your Windows version and architecture (for example, viostor\w10\amd64)
  2. Select the detected VirtIO SCSI controller driver, then click Next
Windows Setup shows the detected Red Hat VirtIO SCSI controller driver selected for installation
  • You will return to the disk selection screen. The disk should now be available
Windows Setup disk selection screen showing Drive 0 Unallocated Space after the VirtIO storage driver is loaded
  1. Continue installation

    Use the built-in Administrator account to ensure compatibility with Cloudbase-Init and standard Windows behavior.
  2. After the reboot, wait for the installation to finish.

  3. At the final installation step, click I don't have Internet.
    Networking is not available yet because the VirtIO network driver is not installed.

  4. Click Continue with limited setup

Configure the Windows VM

Install and configure any applications, services, and system settings required for your environment before preparing the image.

Install VirtIO drivers

  1. Download VirtIO drivers
  2. Open/mount the VirtIO driver ISO
  3. From the root of the ISO, run virtio-win-guest-tools.exe
  4. Verify that the network is available and that there are no unknown devices in Device Manager

Install Cloudbase-Init

  1. Download the installer from cloudbase.it
  2. During installation:
    • Enable Use metadata password
    • Enable Run Cloudbase-Init service as LocalSystem
Cloudbase-Init Setup configuration options screen with Run Cloudbase-Init service as LocalSystem selected

When creating an instance in the customer portal, choose the password authentication method. After the instance is created, a temporary, auto-generated password is sent to the email addresses of account contacts with a Primary or Technical role. See About account management.

Configure Cloudbase-Init

  1. Open the configuration file:
    %ProgramFiles%\Cloudbase Solutions\Cloudbase-Init\conf\cloudbase-init.conf
  2. Add the following line at the end:
    metadata_services=cloudbaseinit.metadata.services.configdrive.ConfigDriveService,cloudbaseinit.metadata.services.httpservice.HttpService

To avoid typing that line manually, you can use a text-sharing service to copy it into the configuration file.

Cloudbase-Init retrieves instance metadata from OpenStack during the first boot and uses it to initialize the instance, including applying system and network configuration.

Validate configuration and clean up

  • Remove temporary files (you can use the cleanmgr utility)
  • Ensure DHCP is enabled
  • Ensure no static IP configuration is present

Run Sysprep

  1. Open PowerShell as an administrator, navigate to the Sysprep directory (%SystemRoot%\System32\Sysprep), and run:
    .\sysprep.exe
  2. Select:
    • Enter System Out-of-Box Experience (OOBE)
    • Generalize
    • Shutdown

The VM will power off. Do not start the VM again after Sysprep. Otherwise, the image may be corrupted.

OOBE is required for the deployment flow described in this guide. Fully unattended Windows deployments can use different Sysprep and Cloudbase-Init configurations and typically do not require enabling OOBE.

The image is ready.

Upload the image and create an instance

You can now upload the qcow2 image to our infrastructure and use it to deploy a cloud server instance. See How to upload your own image and follow Option 2: Upload by cURL or Option 3: Via the OpenStack API.

When you first connect to the provisioned cloud server, the Windows OOBE setup starts. Follow the on-screen prompts to finish the system initialization.

Nothing found. Please try another keyword.