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.

Your IT Journey Starts Here!

Ready to level up your IT skills? Our new eLearning platform is coming soon to help you master the latest technologies.

Be the first to know when we launch! Join our waitlist now.

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

Recent Post

Leave a Comment

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

Related Post

GlassFish is an open-source application server project started by Sun Microsystems for the Java EE platform, then sponsored by Oracle […]

This article will cover how to install Wine 8.x on Rocky Linux 8 / AlmaLinux 8. Wine is an application […]

Java is a high-level object-oriented programming language and computing platform intended to let application developers write once and run everywhere. […]

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.