How to Create a Windows Image for Cloud VPS: An OpenStack-Based Guide
This article explains how to create and prepare a Windows image for use in a Cloud VPS environment that utilizes OpenStack. As an example, I will use a Windows 11 image and the Cloud Standard service. Overall, using this system requires a service with substantial resources, as it is quite demanding. You can also use other images, such as Windows 10, 7, and server versions.
You may also be interested in the article on how to create your own Linux image for Cloud VPS (OpenStack).
Before starting to create a Windows 11 image for the OpenStack-based cloud environment, make sure you have all the necessary tools and resources. Here is a list of the main requirements:
Device Requirements:
- Operating System: The tools only work on Windows systems, such as Windows 10/11, as they utilize built-in Windows features, particularly Hyper-V and PowerShell.
- Processor (CPU): 2-4 cores with virtualization support (Intel VT-x or AMD-V).
- RAM: A minimum of 8 GB to work with virtual machines and tools. It is recommended to have 16 GB or more for comfortable work with Windows images, especially when using multiple virtual machines.
- Disk Space: At least 50 GB of free disk space to store Windows images and temporary files. It is recommended to use SSD for faster file processing and image creation.
"You may also find our Dedicated Servers suitable."
Operating System Requirements for Creating a Windows Image for Cloud VPS
- Hyper-V: Check if virtualization is enabled.
- PowerShell: Use PowerShell ≥ v4.
- Windows ADK: Ensure that ADK is installed to work with images.
- Windows 11 ISO: Download the Windows ISO image.
- Virtio Drivers: Download and prepare drivers for compatibility with virtual devices.
- Windows Imaging Tools: Scripts for automatic image creation.
1. Checking and Installing Required Software:
1.1. Windows with Hyper-V virtualization enabled:
- Note that Windows 11 Home does not support Hyper-V, but this feature is available on Windows 11 Pro. To enable this component, click Start and type Control Panel in the search, or press Win + R, type
control
, and press Enter. - In the Control Panel, select Programs (or Programs and Features, depending on your view).
- Click Turn Windows features on or off in the Programs and Features section.
- In the Windows Features window, find the Hyper-V option.
- Expand the list and ensure that the following subcomponents are enabled:
- Hyper-V Management Tools.
- Hyper-V Platform.
- Check the boxes next to both items if they are not already enabled.
- Click OK, after which the system will install the necessary components.
The system will then prompt for a restart, which you should agree to.
1.2. PowerShell ≥ v4 support:
- To check the PowerShell version, open PowerShell and run the command: $PSVersionTable.PSVersion or get-host
PS C:\Windows\system32> $PSVersionTable.PSVersion
Major Minor Build Revision
----- ----- ----- --------
5 1 22000 2538
1.3. Windows Assessment and Deployment Kit (ADK):
- To check if ADK is installed, go to Control Panel → Programs → Programs and Features and look for Windows Assessment and Deployment Kit.
- If ADK is not installed, download it from the official Windows ADK website and install it. During installation, select all components.
1.4. Ensure you have downloaded the Windows 11 ISO file:
- If you do not have the ISO image yet, download it from the official Windows 11 download site.
1.5. Ensure you have downloaded the Virtio drivers:
- Virtio drivers are necessary for working with virtual machines on the OpenStack or KVM platform. If you do not have them, download the Virtio drivers.
1.6. Download Cloudbase Windows Imaging Tools:
- Download the tools for creating Windows images from the GitHub link: Download Windows Imaging Tools
2. After enabling Hyper-V, you need to create an External Virtual Switch to work with virtual machines in Hyper-V
This process will allow your virtual machines to connect to the network through a physical network adapter, just like regular devices.
2.1. Opening Hyper-V Manager
- Click Start and type "Hyper-V Manager", then open the program.
- Or press Win + R, type
virtmgmt.msc
, and press Enter.
2.2. Navigating to Virtual Switch Settings
- In the left menu, select your host server (your computer's name).
- In the right menu, find the "Virtual Switch Manager" option and click on it.
2.3. Creating an External Virtual Switch
- In the Virtual Switch Manager window, select the "New virtual network switch" option in the left menu and choose "External".
- Click the Create Virtual Switch button.
2.4. Configuring Switch Settings
In the "Name" field, enter the name of the switch — in your case, it will be "external" (to match the setting
external_switch=external
for the futureconfig.ini
).- Select External Network and choose the physical network adapter through which your virtual machines will connect to the external network (for example, the Ethernet or Wi-Fi adapter of your computer).
- Check the box "Allow management operating system to share this network adapter" if you want to allow your main system to also use this adapter.
2.5. Saving Changes
- Click OK to save the settings and create the virtual switch.
- If your network interface is currently in use, Hyper-V may interrupt the network connection for a few seconds during the setup.
A new adapter associated with your external switch external should now appear in the list of network adapters. You can use this switch to connect your virtual machines to the external network.
3. Preparing Windows Imaging Tools Configuration and Creating a Windows Image:
3.1. After downloading Windows Imaging Tools, extract the archive to the root folder of your drive "C:". This should create a folder:
C:\windows-imaging-tools
- Go to the C:\windows-imaging-tools folder.
3.2. Creating Folders for ISO and OS
In this directory, create two folders named "ISO" and "OS".
The "ISO" folder will be used to store Windows ISO files and Virtio drivers. Therefore, move your images from items 1.4. and 1.5. into this folder.
The "OS" folder will be used to create the necessary system image.
3.3. Mounting the Windows 11 ISO Image
Next, go to the ISO folder and mount the image from the official Windows 11 download site.
- Right-click on the ISO file.
- In the context menu, select "Mount".
- The ISO file will be mounted as a virtual disk, and it will appear in Windows Explorer as a new disk with a letter (for example, Z:\ or E:\).
Steps to Mount an ISO File Using UltraISO:
- Download and install UltraISO from the official website.
- After installation, open UltraISO. In the UltraISO menu, go to "Tools" → select "Mount to Virtual Drive".
- In the new window, click the "..." button (file browse) and find your file, for example
Win11_24H2_International_x64.iso
. - Click "Mount".
After this, you will be able to browse the contents of the ISO file, install programs, or copy files to the virtual disk (for example, Z:\ or E:\).
3.4. Opening PowerShell as Administrator
To do this:
- Click Start, type PowerShell in the search.
- Right-click on Windows PowerShell and select Run as administrator.
Then navigate to the tools folder using the PowerShell command:
cd C:\windows-imaging-tools
3.5. Importing Scripts for Automating Image Creation
This folder contains important scripts that will help automate the Windows image creation process. First, you need to import the modules to use them for further actions. Execute the following commands:
Import-Module .\WinImageBuilder.psm1
Import-Module .\Config.psm1
Import-Module .\UnattendResources\ini.psm1
3.6. Creating the Configuration File config.ini
Now let's create the configuration file config.ini
, which will set the parameters needed for creating the Windows image. Use the following command to create a new file:
$ConfigFilePath = ".\config.ini"
New-WindowsImageConfig -ConfigFilePath $ConfigFilePath
3.7. Configuring Parameters in the config.ini
File
After executing the command New-WindowsImageConfig -ConfigFilePath $ConfigFilePath, a file config.ini
will appear in your folder, which will contain basic settings for creating the image. Open the file in a convenient text editor and make important changes to adapt the image creation process to your needs. For example, I changed the following parameters:
# Path to the WIM file with the Windows installation image (mounted from the official Microsoft site).
wim_file_path=E:\sources\install.wim
# Name of the Windows image to be created. Use the PowerShell command to view available options:
# Type: Get-WimFileImagesInfo and look for the "Name" property.
image_name=Windows 11 Pro
# Path to save the created system image (QCOW2 format).
image_path=C:\windows-imaging-tools\OS\Windows_11_CloudVPS.qcow2
# Virtual disk format.
virtual_disk_format=QCOW2
# Type of image.
image_type=KVM
# QCOW2 compression for optimizing image size.
compress_qcow2=True
# Enable ping request support.
enable_ping_requests=True
# Number of CPU cores for the virtual machine (VM) creating this image.
cpu_count=4
# Size of RAM (in bytes) for the VM.
ram_size=4294967296 # 4 GB
# Disk space size (in bytes) for the VM's boot disk.
disk_size=19327352832 # 18 GB (not exceeding the disk space of the CloudVPS plan).
# Path to the ISO file with VirtIO drivers.
virtio_iso_path="C:\windows-imaging-tools\ISO\virtio-win-0.1.262.iso"
# Installing the QEMU agent. Requires VirtIO drivers in the image.
install_qemu_ga=True
3.8. Starting the Windows Image Creation Process
Once all settings are completed, you can start the Windows image creation process. To do this, in PowerShell, execute the following command:
New-WindowsOnlineImage -ConfigFilePath $ConfigFilePath
This command will initiate the Windows image creation process based on the settings in the config.ini
file. Once completed, you will have a ready Windows virtual disk that can be used to deploy virtual machines in the Cloud VPS environment based on OpenStack. The path to the finished image is C:\windows-imaging-tools\OS\Windows_11_CloudVPS.qcow2
, as specified in the config.ini
configuration file.
4. Creating a Direct Link to the Virtual Disk Windows_11_CloudVPS.qcow2
This is necessary for further uploading to the platform via the link: https://cp.zomro.com/services/cloud_vps/images. You can do this using a subdomain and the "Cloud VPS" service. Follow these steps:
4.1. Ordering a Virtual Server
If you do not have a virtual server yet, go to the link: https://cp.zomro.com/services/cloud_vps and order the service you are interested in for installing your personal image. For example, I will order the "Cloud Standard" service with Ubuntu 22.04. After activation, you will find instructions and connection data for the server in your personal account at the link: https://cp.zomro.com/services/cloud_vps. Find your service and click on the "gear" menu to get the instructions.
4.2. Creating an Environment for Hosting the Image
Once the server is activated, you can start creating an environment for hosting your disk Windows_11_CloudVPS.qcow2
. Log in to the server via SSH (more details in the instructions at the link: https://zomro.com/rus/blog/faq/218-kak-vojti-na-linux-server-po-ssh).
4.3. Installing the Hestia Control Panel
Install the Hestia control panel. Instructions can be found at the link: https://zomro.com/rus/blog/faq/245-kak-ustanovit-hestiacp.
4.4. Adding a Domain
After installing the control panel, add a domain. Instructions for adding a domain to the server in the Hestia panel can be found here: https://zomro.com/rus/blog/faq/247-kak-sozdat-polzovatelja-i-dobavit-domen-v-panel-hestiacp.
4.5. Uploading the Virtual Disk
After creating the domain, upload the virtual disk to make it available for download. To connect to the server via FTP and SSH, use the user data "root", specifying port "22". Instructions for connecting to the server are available at the link: https://zomro.com/rus/blog/faq/144-kak-podkljuchitsja-k-serveru-po-ftp-sftp-i-scp. After connecting, upload the file Windows_11_CloudVPS.qcow2
to the following path: /home/your_user/web/your_domain/public_html/Windows_11_CloudVPS.qcow2
.
4.6. Pointing the Domain to the Server
The next step is to point the domain to your server so that all requests are forwarded to it. First, change the NS in the "personal account" of the registrar where you ordered the domain. To do this, go to your "personal account" - Domains section (https://cp.zomro.com/services/domains) - select the required domain - NS. Enter our NS in the corresponding fields:
ns1.zomro.net.
ns2.zomro.ru.
ns3.zomro.com.
ns4.zomro.su.
4.7. Order a Free DNS Hosting Service (50 domains for free) in your personal account if you have not used this option before. To do this, go to the "Products/Services" section → "DNS Hosting" (https://cp.zomro.com/services/dns) and click "Order" under the "DNS hosting for 50 domains" item.
4.8. Configuring the Domain in the Control Panel
Go to the "Services" → "DNS Hosting" → click on the "gear" → "go to panel". In the control panel, select "Domain Names" and create a new domain by selecting the "Wizard" type. Specify your domain and the server's IP address. After this, the image "Windows_11_CloudVPS.qcow2"
will become available for download via the browser at the link: http://your_domain/Windows_11_CloudVPS.qcow2.
5. Creating an Image on the "Images" Platform
5.1. Open the Image Creation Page
Go to the link: https://cp.zomro.com/services/cloud_vps/images and create a new image. An example of the process is shown in the screenshot below (any other image is created according to the instructions provided on the right).
5.2. Creating the Image
Click "Create image" and wait for the image creation to complete on the platform https://cp.zomro.com/services/cloud_vps/images. After the process is completed, the image will have the status "SAVING", which means it is being saved.
5.3. Image Readiness Status
When the image is ready, its status will change to "ACTIVE", as shown in the screenshot below.
5.4. Installing the Image on the Server
After the image is activated, you can install it on your server. To do this, go to the link: https://cp.zomro.com/services/cloud_vps, click on the "gear" of the selected server, then click the "Reinstall OS" button. Select "My Images", find your created image, and click the "Confirm" button (details in the screenshot below).
After this, a request to reinstall the system from the image will be sent. The old system may remain accessible for a while (1-5 minutes), after which the image installation process will begin.
You can check the operation of your virtual server through a VNC connection. To do this, go to the link: https://cp.zomro.com/services/cloud_vps, select your service, and click on the "gear" icon → "Console" to connect via VNC.
Here is a screenshot of the already transferred and installed system on the "Cloud Standard" service.
We observe that the disk "Disk 0" occupies 15 GB, meaning not all available disk space of the "Cloud Standard" service is used. Now let's proceed to expand it.
6. Opening Disk Management:
- Right-click on the "Start" button and select "Disk Management".
- In the Disk Management window, find the disk that needs to be resized and ensure there is unallocated space next to it.
Expanding the Disk:
- Right-click on the disk (partition) and select "Extend Volume".
- The Extend Volume Wizard will open. Click "Next".
- Select the amount of space you want to add to the disk and click "Next".
- Confirm the operation by clicking "Finish".
6.1. After completing the previous steps, all space should become available, and the system will be ready for further actions.
Conclusion
Creating a Windows image for Cloud VPS is an important step in ensuring the stable operation of your virtual environment. In this article, we reviewed the key hardware and software requirements necessary for working with virtual machines, as well as the steps for configuring and optimizing Windows. Enabling components such as Hyper-V, PowerShell, Windows ADK, and Virtio drivers will ensure maximum compatibility in the cloud environment. Follow these recommendations for the successful deployment of your Cloud VPS.