Running Windows Server 2022 on OpenStack (Complete Steps)

Setup Pre-requisites

Ensure that KVM is installed in your Linux system, refer to the following article for a complete how-to guide:

# Debian based systems
sudo apt update
sudo apt install cockpit
sudo systemctl start cockpit
sudo systemctl enable cockpit

# RHEL based systems
sudo dnf update
sudo dnf install cockpit
sudo systemctl start cockpit
sudo systemctl enable cockpit

Step 2: Create Windows Server VM

virt-install \
 --name win2022_template \
 --ram 4096 \
 --vcpus sockets=1,cores=2 \
 --cpu host \
 --os-variant win2k22 \
 --disk path=/var/lib/libvirt/images/win2022_template.qcow2,size=15,bus=virtio,format=qcow2 \
 --cdrom /var/lib/libvirt/images/en-us_windows_server_2022.iso \
 --disk path=/var/lib/libvirt/images/virtio-win.iso,device=cdrom \
 --network bridge=virbr0 \
 --virt-type kvm \
 --boot uefi \
 --machine q35 \

For Open vSwitch:

--network=bridge:br-ex,model=virtio,virtualport_type=openvswitch \
WARNING  Graphics requested but DISPLAY is not set. Not running virt-viewer.
WARNING  No console to launch for the guest, defaulting to --wait -1

Starting install...
Allocating 'win2022_template.qcow2'                                                                                                                                                |  15 GB  00:00:00
Creating domain...                                                                                                                                                                 |         00:00:00

Domain is still running. Installation may be in progress.
Waiting for the installation to complete.

Step 3: Windows Server Installation

Step 4: Enable Remote Desktop

Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" -Value "0" 
Set-NetFirewallRule -Name "RemoteDesktop-In-TCP-WS" -Enabled True
Get-NetFirewallRule | Where-Object Name -like 'RemoteDesktop*' | Set-NetFirewallRule -Enabled True 

Step 5: Cloud-Init and QEMU guest agent configurations

Set-ExecutionPolicy Unrestricted

Install VirtIO-Win Drivers

Install qemu-guest-agent

Step 6: Delete Recovery Partition

Step 7: Install Cloudbase-Init

openstack image create "imagename" --disk-format qcow2 --min-ram 4096 --min-disk 20 --file /path/to/image/imagename.qcow2
[root@osp01 ~(keystone_admin)]# openstack image create "Windows-server-2022" --disk-format qcow2 --min-ram 4096 --min-disk 20 --file /var/lib/nova/kvm/win2022_template.qcow2
+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field            | Value                                                                                                                                                   |
+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| container_format | bare                                                                                                                                                    |
| created_at       | 2024-10-07T14:05:52Z                                                                                                                                    |
| disk_format      | qcow2                                                                                                                                                   |
| file             | /v2/images/f483321f-8470-43f2-9e6f-9ece12291997/file                                                                                                    |
| id               | f483321f-8470-43f2-9e6f-9ece12291997                                                                                                                    |
| min_disk         | 20                                                                                                                                                      |
| min_ram          | 4096                                                                                                                                                    |
| name             | Windows-server-2022                                                                                                                                     |
| owner            | 600d8c3bab4542989b55b051baf1bcb4                                                                                                                        |
| properties       | os_hidden='False', owner_specified.openstack.md5='', owner_specified.openstack.object='images/Windows-server-2022', owner_specified.openstack.sha256='' |
| protected        | False                                                                                                                                                   |
| schema           | /v2/schemas/image                                                                                                                                       |
| status           | queued                                                                                                                                                  |
| tags             |                                                                                                                                                         |
| updated_at       | 2024-10-07T14:05:52Z                                                                                                                                    |
| visibility       | shared                                                                                                                                                  |
+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
[root@osp01 ~(keystone_admin)]# openstack image list
+--------------------------------------+---------------------+--------+
| ID                                   | Name                | Status |
+--------------------------------------+---------------------+--------+
| 7dbabbc7-0e54-4a3a-8936-d844ab1e151b | Cirros              | active |
| 9940658f-3ba2-4830-8355-7fa95116aca5 | Debian-12           | active |
| 0b3cec63-2549-4834-8be1-902a8260991c | Ubuntu-24.04        | active |
| f483321f-8470-43f2-9e6f-9ece12291997 | Windows-server-2022 | active |
+--------------------------------------+---------------------+--------+

You don’t need to perform these operations on your own, CloudSpinx Engineers are available to help you out. Drop us a message and we will respond ASAP.

Join our Linux and open source community. Subscribe to our newsletter for tips, tricks, and collaboration opportunities!

Recent Post

Unlock the Right Solutions with Confidence

At CloudSpinx, we don’t just offer services - we deliver clarity, direction, and results. Whether you're navigating cloud adoption, scaling infrastructure, or solving DevOps challenges, our seasoned experts help you make smart, strategic decisions with total confidence. Let us turn complexity into opportunity and bring your vision to life.

Leave a Comment

Your email address will not be published. Required fields are marked *

Related Post

VPN stands for Virtual Private Network. It is a service that protects your online activities like surfing, shopping, and banking […]

The OpenStack Block Storage service Cinder is used to supply volumes to containers, Ironic bare metal hosts, Nova virtual machines, […]

This article is created to help you install Rocky Linux on Hetzner Dedicated Server, whether you’re setting up a personal […]

Let's Connect

Unleash the full potential of your business with CloudSpinx. Our expert solutions specialists are standing by to answer your questions and tailor a plan that perfectly aligns with your unique needs.
You will get a response from our solutions specialist within 12 hours
We understand emergencies can be stressful. For immediate assistance, chat with us now

Contact CloudSpinx today!

Download CloudSpinx Profile

Discover the full spectrum of our expertise and services by downloading our detailed Company Profile. Simply enter your first name, last name, and email address.