How to create a custom Windows image

Modified: 28 Apr 2022 01:26 UTC

Create a Windows image for use in Triton.

Windows requires a special configuration file and tool to be run in order to be able to build re-deployable images. This tool is called "sysprep", and the default configuration is included on the SDC Guest Tools ISO image in the smartdc/sysprep directory. To edit this configuration you will need the Windows Automatic Installation Toolkit or WAIK. The WAIK can be downloaded from Microsoft free of charge. The configuration of sysprep is out of scope for this article. To learn more about sysprep, see Microsoft TechNet.

Install OS

When you connect to the instance with VNC, you will see the installation instructions for the operating system you're installing. Follow the instructions to install the OS, but keep the following things in mind.

drivers at install time

Because we are using VirtIO drivers for both Networking and Disk access, these drivers must be loaded at Install time. When you come to the screen asking about "disks" you can take the opportunity to also load the Networking driver. This is a workaround and ensures that networking drivers do not need to be loaded manually post-installation.

When the installation says you have no disks, you can click on Load Driver button, and browse to the driver ISO in the drivers/virtio folder. This folder contains both the Network and Disk drivers. Browse to the NET directory first, and load the networking driver. This will copy the network driver to the installation. You will then need to also load the Disk driver. Browse to the driver location for Storage and load the storage driver. You will then see your disk on screen. If you used the previous instructions for your instance, you will have a single 40GB disk. This will be your OS disk.

Install additional software

Windows will automatically reboot, however the ISO images should still be installed, unless you have turned the instance off using vmadm. You can browse to the smartdc-tools ISO drive, and goto smartdc and run the install.bat script. This script will copy over all the necessary files to c:\\smartdc.

Install or remove software that you want to be present in every instance made from this image. sysprep will create minimal system images so any programs installed using MSI Installers will likely need special consideration. See Microsoft Technet for more information. Compliance with licensing is the customers responsbility.

Delete temporary files

Some examples of what you might want to clean up:

sysprep will run against an XML "unattend" file which will contain all of the instructions needed to create an "out of box experience" with Windows 2008R2 as well as Windows 2012. It will also contain the product key. To understand more about licensing please see Microsoft Technet.

In the c:\smartdc\sysprep folder you will see a sysprep batch script. This script contains the correct syntax for running the sysprep command. Double-click it to run or, run it in a command window

c:\smartdc\sysprep\sysprep.bat

After sysprep is complete, it will shutdown your instance. 

Next steps

You can now continue with the how to create a KVM image guide.