Windows and UForge

Within UForge Windows is treated differently from other Linux/UNIX operating systems. In fact, Windows is not bundled with packages. Consequently, it is not possible to create standard (package based) OS Profile as for all the other supported distributions.

Instead, UForge uses a Golden Image as a profile. A Golden Image is an image that has been generated by UShareSoft or by the customer (see Creating a Golden Image) that contains the basic installation of the Windows version and some extra files. You can generate Golden Images at any time.

A Golden Image can be between 5 to 10 Gb, depending on the selected version.

This chapter describes how to create your own Windows Golden Images. Windows Golden Images need to be created in order to create Windows templates. If you want to incorporate a Windows update, then you need to create and install a new set of Golden Images. UShareSoft has a tool called the Golden Creator and can provide Golden Images. This chapter assumes you want to create the Golden Image yourself.

Note

A good knowledge of Windows is required.

Supported Windows Versions

UForge supports Windows Server 2008 R2 (this distribution is only 64 bits), 2012 and 2012R2. Microsoft delivers 4 versions:

  • DataCenter
  • Standard
  • WebServer
  • Enterprise

For each version, there is a Full release and a Core release (without a Desktop).

These versions are available in French, English and Japanese. Unfortunately, one version of Windows can NOT support multiple languages.

Restrictions

The following UForge features are not supported with Windows Appliances:

  • Package selection at the OS level (however, users can add software via MySoftware or Projects. See the UForge User Guide.)
  • UForge Studio
  • Windows migration possible as blackbox only
  • Windows ISO format not supported

Workflow for Windows Golden Image

The following graphic illustrates the workflow to obtain and install Windows Golden Images.

First Installation of Windows

To install Windows, follow the instructions below. This example is for Windows Server 2008R2. If you wish to install for Windows Server 2012 or Windows Server 2012 R2, replace the string Server2008R2 with the version you want to install in all commands below.

  1. First population of Windows:

    org os add --name Windows --arch x86_64 --version Server2008R2
    
  2. Activate Windows Server2008R2 inside the UForge organization:

    org os enable --name Windows --arch x86_64 --version Server2008R2
    

3. Activate Windows Server2008R2 for root user (and potentially other preexisting users) user os enable –name Windows –arch x86_64 –version Server2008R2 –account root user os enable –name Windows –arch x86_64 –version Server2008R2 –account <OTHER_USER_NAME>

  1. Populate the packages for WindowsServer2008R2 (variable WIN_VERS must be changed accordingly for other versions of Windows).
. /etc/UShareSoft/uforge/uforge.conf
ARCHS=x86_64 DEBUG=y WIN_VERS=Server2008R2 /opt/UShareSoft/uforge/bin/exec_uploads.sh -w UssPkgs -U "$UFORGE_WEBSVC_LOGIN" -P "$UFORGE_WEBSVC_PASSWORD" -s "$UFORGE_DEFAULT_ORG_NAME" /tmp/DISTROS/USS/usspkgs

Note

UForge does not manage Windows updates as it does for Linux (crawling updates every night and populating the database). Instead, each time you want to have the updates for Windows, you will need to a new set of Golden Images.

Listing Existing Golden Images

In order to view a list of existing golden images installed on your UForge run:

org golden list --name Windows --arch x86_64 --version Server2008R2

Creating a Golden Image

To create a Golden Image UShareSoft has a tool called the Golden Image Creator. This tool can run only on top of a physical machine or as a KVM virtual machine.

Generating all the profiles available (in one language) takes roughly 4 to 7 hours depending on the machine/network performance. You can regenerate Golden Images as often as you like, based on your individual needs. However, it is recommended that you regenerate only for specific updates—these updates will be in the Golden Image and you will not need to run package updates. When you generate a Golden Image the updates are the ones at the moment at which the Golden Image is generated.

Within UForge, the Golden Image used when you create appliances will be the last Golden Image created. In future releases, the different Golden Images will appear as Milestones.

Once the Golden Image is created, you will need to save it to the proper location and follow the steps described Storing Golden Images on the NAS. To store the golden images (all profiles in one language) you will need about 40Gb of disk space on the UForge NAS.

To create a new Golden Image, you will need to:

  1. Ensure the following two partitions exist. These partitions are created by default during a standard Windows installation. There must be no other partitions.

    • System partition. This one is hidden, created automatically during installation of Windows Server.
    • Drive C:
  2. The following Windows features must be installed as Administrator:

    • ServerCore-WOW64
    • NetFx2-ServerCore
    • NetFx2-ServerCore-WOW64
    • NetFx3ServerFeatures
    • NetFx3

    To install these features, you can either go to the Control Panel under Programs and Features or open a command prompt window as Administrator and run the following Windows commands:

    start /w dism /online /enable-feature /all /featurename:ServerCore-WOW64
    start /w dism /online /enable-feature /all /featurename:NetFx2-ServerCore
    start /w dism /online /enable-feature /all /featurename:NetFx2-ServerCore-WOW64
    start /w dism /online /enable-feature /all /featurename:NetFx3ServerFeatures
    start /w dism /online /enable-feature /all /featurename:NetFx3
    
  3. Install gtk-sharp-2.12.10.win32.msi.

  4. We recommend that you run Windows Update to ensure that the latest updates are pre-installed in the Golden Image.

  5. Optionally, you can also add the following customizations:

    • Modify the registry
    • Extra software installation
    • User creation
  6. Optionally, you can free several gigabytes of space by cleaning up windows updates installers.

    Warning

    After this optimization you may not be able to uninstall some of the Windows updates.

dism /online /Cleanup-Image /StartComponentCleanup /ResetBase
  1. If you have Service Packs installed, you can free up some space by executing the following command, which will merge the Service Pack installer to the operating system.

    Warning

    After this optimization, you will not be able to uninstall the Service Pack.

dism /online /Cleanup-Image /SPSuperseded
  1. You can optionally perform optimizations in size for the compressed raw virtual disk image. To do so, you must:

    1. Before the sysprep step, use the Microsoft Sysinternals tool called sdelete.exe (or sdelete64.exe) with option -z in a command line for all partitions, example:
    sdelete -z C:
    
    1. After finishing the golden image (after sysprep at the last step), but before compressing the .raw with gzip or lrzip, perform the following command to the .raw virtual disk image:
    cp --sparse=always image.raw newimage.raw
    

This will copy the image file but skip the zeros, so the .raw image will be as sparse as possible, also helping the compression program.

mv -f newimage.raw image.raw
  1. Open a command prompt window as an administrator and go to the %WINDIR%\system32sysprep directory. Then run:

    sysprep.exe /generalize /oobe /shutdown
    

Note

This will shutdown the machine. Do not boot the machine again!

  1. You can now compress the golden images by running:
gzip image.raw

Installing Updated Golden Images

Each time you have a new Golden Image, you need to put them in the right NAS location as described above. Note that the parameters set when running org golden create should correspond to the path on the NAS, that is: {Language}/{Edition}/{Type}/{generation date}(YYYY-MM-DD)/goldenImagePathCompressedInGz

For example to install the golden image saved to the following path: Windows/releases/Server2008R2/x86_64/English/Standard/Full/2012-10-19/Windows_2008R2_Standard_Full_2012-10-19.raw.gz, you need to run:

org golden create --name Windows --arch x86_64 --version Server2008R2 --language English --edition Standard --type Full --goldenDate 2012-10-19 --goldenName Windows_2008R2_Standard_Full_2012-10-19.raw.gz

Storing Golden Images on the NAS

To store the golden images (all profiles in one language) you will need about 40Gb of disk space on the UForge NAS.

The Golden Images should be stored in:

Base dir = Windows/releases/Server2008R2/x86_64/

The path is:

{Language}/{Edition}/{Type}/{generation date}(YYYY-MM-DD)/goldenImagePathCompressedInGz

For instance, below is a sample hierarchy:

Windows/ Windows/releases Windows/releases/Server2008R2 Windows/releases/Server2008R2/x86_64 Windows/releases/Server2008R2/x86_64/English Windows/releases/Server2008R2/x86_64/English/Standard Windows/releases/Server2008R2/x86_64/English/Standard/Core Windows/releases/Server2008R2/x86_64/English/Standard/Core/2012-10-19 Windows/releases/Server2008R2/x86_64/English/Standard/Core/2012-10-19/Windows_2008R2_Standard_Core_2012-10-19.raw.gz Windows/releases/Server2008R2/x86_64/English/Standard/Full Windows/releases/Server2008R2/x86_64/English/Standard/Full/2012-10-19 Windows/releases/Server2008R2/x86_64/English/Standard/Full/2012-10-19/Windows_2008R2_Standard_Full_2012-10-19.raw.gz Windows/releases/Server2008R2/x86_64/English/WebServer Windows/releases/Server2008R2/x86_64/English/WebServer/Core Windows/releases/Server2008R2/x86_64/English/WebServer/Core/2012-10-19 Windows/releases/Server2008R2/x86_64/English/WebServer/Core/2012-10-19/Windows_2008R2_WebServer_Core_2012-10-19.raw.gz Windows/releases/Server2008R2/x86_64/English/WebServer/Full Windows/releases/Server2008R2/x86_64/English/WebServer/Full/2012-10-19 Windows/releases/Server2008R2/x86_64/English/WebServer/Full/2012-10-19/Windows_2008R2_WebServer_Full_2012-10-19.raw.gz Windows/releases/Server2008R2/x86_64/English/Enterprise Windows/releases/Server2008R2/x86_64/English/Enterprise/Core Windows/releases/Server2008R2/x86_64/English/Enterprise/Core/2012-10-19 Windows/releases/Server2008R2/x86_64/English/Enterprise/Core/2012-10-19/Windows_2008R2_Enterprise_Core_2012-10-19.raw.gz Windows/releases/Server2008R2/x86_64/English/Enterprise/Full Windows/releases/Server2008R2/x86_64/English/Enterprise/Full/2012-10-19 Windows/releases/Server2008R2/x86_64/English/Enterprise/Full/2012-10-19/Windows_2008R2_Enterprise_Full_2012-10-19.raw.gz Windows/releases/Server2008R2/x86_64/English/Datacenter Windows/releases/Server2008R2/x86_64/English/Datacenter/Core Windows/releases/Server2008R2/x86_64/English/Datacenter/Core/2012-10-19 Windows/releases/Server2008R2/x86_64/English/Datacenter/Core/2012-10-19/Windows_2008R2_Datacenter_Core_2012-10-19.raw.gz Windows/releases/Server2008R2/x86_64/English/Datacenter/Full Windows/releases/Server2008R2/x86_64/English/Datacenter/Full/2012-10-19 Windows/releases/Server2008R2/x86_64/English/Datacenter/Full/2012-10-19/Windows_2008R2_Datacenter_Full_2012-10-19.raw.gz

Adding a Golden Image to UForge

Once you have your Golden Image, you need to add it to your Uforge platform in order to be able to use the Windows version to create appliance templates. Your golden image must be in one of the following formats:

  • raw.gz
  • raw.zip
  • raw.bz2
  • raw.lrz
  • vdi
  • vhd
  • vmdk

To add your Golden Image to UForge:

  1. Copy the image to:

    /tmp/DISTROS/Windows/releases/<windows os version>/x86_64/<language>/<my custom profile name>/<Core|Full>/<YYYY-MM-DD>/golden.xxx
    

For example: /tmp/DISTROS/Windows/releases/Server2008R2/x86_64/English/MyProfile/Core/2014- 04-28/Windows_2008R2_English_Datacenter_Core_2014-04-28.raw.gz

Note:

  • File and directory ownership should be glassfish:glassfish.
  • Permissions should be readable for all users
  • Disk name must be unique in the /tmp/DISTORS/Windows file tree
  1. You must ensure that the Windows distribution exists on your UForge platform. If it does not, run:

    uforge org os add --name Windows --arch x86_64 --version Server2008R2
    
  2. In order to add the new golden image to the distribution, run:

    uforge org golden create --name Windows --arch x86_64 --version Server2008R2 --edition Standard --goldenDate 2014-04-28 --language French --type Full --goldenName Windows_2008R2_English_Standard_Full_2014-04-28.raw.gz
    

Note

The parameters set when running org golden create should correspond to the path on the NAS, that is: {Language}/{Edition}/{Type}/{generation date}(YYYY-MM-DD)/goldenImagePathCompressedInGz