Openstack Create Windows Server (2016/2019/2022) Image(raw) — Part II

Roy Tan
5 min readNov 9, 2019

Continue: create a win2019.raw template with virt-manager

Preparation

Window Server iso https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2019
VirtIO drivers : https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso
Virtual Machine Manager : https://virt-manager.org/download/

Create VM with Virtual Machine Manager

  1. Create New Virtual Machine

2. Choose your downloaded Windows Server 2019 iso, or you can get it from my previous story : https://medium.com/@yooniks9/openstack-create-windows-server-2016-2019-image-iso-29d9ec877a3b

3. Configure your VM

4. Create a disk with raw format with 15G size

5. Check Customize configuration before

Customize VM

  1. [Disk] Change the Disk bus using virtIO

2. [Disk] Create another Disk using scsi (for driver attachment)

3. [CDROM] Make sure CDROM is loaded with Windows Server 2019 iso

4. [CDROM] Create another CDROM and loaded with virtIO driver disk (Optional, if you are using the iso from Part I )

5. [Network] Change the network interface using virtio

6. All done, Let begin installation

Windows Server Installation

  1. Select Custom: Install Windows only (advanced)

2. Load Network Driver, Choose your CDROM look for Drivers\NetKVM\

3. Then, VirtIO disk driver

4. The VirtIO disk is shown

5. Install Scsi Disk Driver (to make sure scsi drive is supported as well)

6. Disk Sumary

7. Let’s start the Windows installation on Drive 0, continue Windows installation step by step until finish

Repack with Cloudinit

  1. Start PowerShell to open the firewall for RDP:
Enable-NetFirewallRule -name RemoteDesktop-UserMode-In-TCP
  • Click on Start > Settings, and search for remote desktop, now choose allow remote desktop access to your computer.
  • In the popup choose for Allow remote connections to this computer, Click OK to close the popup.
  • If you are using an unofficial- or older RDP client, remove the checkbox below.
  • Click on Apply and press OK.

2. To be able to use Cloud-Init (we need this to, for example, be able to set an admin passphrase when deploying) we have to configure this:

Set-ExecutionPolicy Unrestricted

3. Install Drivers

5. Install qemu-guest-agent

6. (Windows 10 & Windows Server 2022)delete recovery partition

  • Run powershell as administrator
  • Use diskpart to fix the partition
  • Result

7. Download Cloudbase-init installer & run the setup :
https://cloudbase.it/downloads/CloudbaseInitSetup_Stable_x64.msi

  • Click Next
  • To continue, you will have to read and accept the license terms
  • Click Next
  • The default settings will be fine, again click Next
  • Check everything be except for the Serial port for logging, set that to COM1
  • In my case, the username has set to Admin , Openstack password retriever(private key) will work on this account
  • The default account Administrator require setting a new password before using it, you must use the horizon compute console to change the password
  • Next…
  • Install

When the installation is finished, select both run Sysprep and Shutdown when Sysprep terminates.

If you click Finish the Windows installation will be prepared for use as an image and the VM will be closed.

Now you have a Windows image that is switched off, based upon a raw file which we can upload to OpenStack.

You may download the builded vmdk from the link below:
https://docs.bigstack.co/docs/1.3/downloads/cloud_image/

Related Topic:

https://medium.com/@yooniks9/openstack-create-windows-server-2016-2019-image-iso-29d9ec877a3b
https://medium.com/@yooniks9/openstack-install-windows-server-2016-2019-with-image-iso-d8c17c8cfc36

--

--