Product Documentation

Update OS layer

Jan 11, 2018

The Operating System (OS) Layer contains the Windows Operating System that is assigned to any Layered Images you create using that OS Layer. Once created, you can use the OS Layer to build as many Layered Images as you want.

The OS Layer includes a virtual machine in your infrastructure running the Unidesk-supported Windows Operating System that you want to use for your Layered Images.

Add a version of an OS layer

  1. In the Citrix App Layering Management Console, select Layers > OS Layers.
  2. Select an OS Layer icon and click Add Version. This opens the Create OS Version Wizard.
  3. In the Version Details tab:
    1. For Base Version, select the version to use as the base for the new layer version. The default is the latest version. 
    2. Enter a name for the New Version. This can be the OS version or other identifying information.
  4. In the Connector tab, select a Connector configuration for the platform where you'll be publishing your Layered Images. You can also modify an existing configuration by selecting it and clicking Edit. If you have not yet created a Connector Configuration or if the configuration you need is not present, click New to create a new Connector Configuration and select it from this list.
  5. In the Platform Layer tab, select a Platform Layer that contains the tools and hardware settings that you need to install and package the OS when adding a Layer Version. Once created, the new Layer Version can be used in Layered Images published to any platform.
  6. In the Packaging Disk tab, enter a file name for the Packaging Disk, and select the disk format. This disk will be used for the Packaging Machine (the VM) where you will install the application, as described in the next two sections.
  7. Confirm and Complete tab - Verify your settings and click Create Version. The appliance runs the task of creating a new OS version. When the task completes, it shows a status of Action Required. When you double-click the task to expand it, the task contains the following text (refer to the image in the next section):
    "The Packaging Disk has been published. The virtual machine '<...>' can be found in folder '<...>' in datacenter '<...>'. Power on this virtual machine to install your application. When the installation is complete, power off the virtual machine before clicking Finalize on the Action bar."

Next, you can deploy a Packaging Machine for this OS Layer version.

Deploy a Packaging Machine to Hyper-V

A packaging machine is a virtual machine where you install any updates or applications you want to include in the OS Layer. It is strongly recommended that you use a unique packaging machine for each Layer. The packaging machine is a temporary VM that will be deleted once the OS Layer has been finalized.

The Task Description (example shown in the last step above) contains directions to navigate to the location in Hyper-V where the packaging machine for this layer has been created.

  1. To create your packaging machine in Hyper-V, begin with the expanded Packaging Disk task shown in step 2 below.
  2. Log into your Hyper-V web client.
  3. Back in the management console, use the instructions in the expanded Packaging Disk Task (example shown below) to navigate to the packaging machine.

Install the OS update

  1. Remote log into the packaging machine in Hyper-V Be sure to log in with the User account you used to create the OS in Hyper-V.
  2. Install any updates or applications you want to include in the new OS Layer version, such as Windows Updates or anti-virus applications.
  3. If an application installation requires a system restart, restart it manually. The packaging machine may not restart automatically.
  4. Make sure the packaging machine is in the state you want it to be for the user:
    1. If the applications you install require any post-installation setup or application registration, complete those steps now.
    2. Remove any settings, configurations, files, mapped drives, or applications that you do not want to include on the packaging machine.

Next, you shut down the packaging machine and verify that the layer is ready to finalize.

Verify the Layer and shut down the Packaging Machine

Once the application is installed on the Packaging Machine, the next step is to verify that the Layer is ready to be finalized. To be ready for finalization, any required post-installation processing needs to be completed. For example, a reboot may be required, or a Microsoft NGen process may need to complete.

To verify that any outstanding processes are complete, you can run the Shutdown For Finalize tool (icon below), which appears on the Packaging Machine's desktop.

To use the Shutdown For Finalize tool:

  1. If you are not logged into the Packaging Machine, remote log in as the user who created the machine.
  2. Double-click the Shutdown For Finalize icon. A command line window displays messages detailing the layer verification process.
  3. If there is an outstanding operation that must be completed before the Layer can be finalized, you are prompted to complete the process. For example, if a Microsoft NGen operation needs to complete, you may be able to expedite the NGen operation, as detailed below.
  4. Once any pending operations are complete, double-click the Shutdown For Finalize icon again. This shuts down the Packaging Machine.

The Layer is now ready to finalize.

Layer integrity messages

Layer integrity messages let you know what queued tasks must be completed before a Layer is finalized.

The new Layer or Version can only be finalized when the following conditions have been addressed:

  • A reboot is pending to update drivers on the boot disk - please check and reboot the Packaging Machine.
  • A post-installation reboot is pending - please check and reboot the Packaging Machine.
  • An MSI install operation is in progress - please check the Packaging Machine.
  • A Microsoft NGen operation is in progress in the background.

Note: If a Microsoft NGen operation is in progress, you may be able to expedite it, as described in the next section.

Expediting a Microsoft NGen operation

NGen is the Microsoft Native Image Generator. It is part of the .NET system, and basically re-compiles .NET byte code into native images and constructs the registry entries to manage them. Windows will decide when to run NGen, based on what is being installed and what Windows detects in the configuration. When NGen is running, you must let it complete. An interrupted NGen operation can leave you with non-functioning .NET assemblies or other problems in the .NET system.

You have the choice of waiting for the NGen to complete in the background, or you can force the NGen to the foreground. You can also check the status of the NGen operation, as described below. However, every time you check the queue status, you are creating foreground activity, which might cause the background processing to temporarily pause.

Forcing the NGen to the foreground will allow you to view the progress and once the output has completed, you should be able to finalize the layer.

  1. Force an NGen operation to the foreground.
    Normally, NGen is a background operation and will pause if there is foreground activity. Bringing the task into the foreground can help the task to complete as quickly as possible. To do this
    1. Open a command prompt as Administrator.
    2. Go to the Microsoft .NET Framework directory for the version currently in use:
      cd C:\Windows\Microsoft.NET\FrameworkNN\vX.X.XXXXX
    3. Enter the NGen command to execute the queued items:
      ngen update /force
      This brings the NGen task to the foreground in the command prompt, and lists the assemblies being compiled.
      Note: It’s okay if you see several compilation failed messages!
    4. Look in the Task Manager to see if an instance of MSCORSVW.EXE is running. If it is, you must allow it to complete, or re-run ngen update /force. Do not reboot to stop the task. You must allow it to complete.
  2. Check the status of an NGen operation
    1. Open a command prompt as Administrator.
    2. Check status by running this command:
      ngen queue status
    3. When you receive the following status, the NGen is complete, and you can finalize the Layer.
      The .NET Runtime Optimization Service is stopped

Finalize the OS layer

Once the Packaging Machine is created and any apps or updates installed, you'll need to finalize the layer.

Note: When you finalize a new version of an OS Layer, Unidesk deletes the Packaging Machine so as not to incur more costs.

When a layer is ready to finalize:

  1. Return to the Unidesk Management Console.
  2. In the Layers module, select the Layer.
  3. Select Finalize in the Action bar.
  4. Monitor the Task bar to verify that the action completes successfully and that the layer is deployable.

Reference: Create OS Version Wizard values

Version - (Required) This can be the version of the OS Layer or a version you assign to the Layer. This value is displayed in the Details view of the Layer.

Version Description - (Optional) Enter a description of the version.

Max Layer Size - (Optional) Maximum layer size in gigabytes. Layers are thin provisioned, and will grow as needed, up to the maximum size. The default Max Layer Size is 100 gigabytes. If the version you are creating could requires more space, change this to a realistic value.

Select a Platform Connector configuration - (Required) Specify a Unidesk Platform Connector for the platform where you'll be publishing your Layered Images. For example, if you're publishing to Azure RD Session Host, select the Azure RDSH connector with the credentials required to access the account. If the configuration you need is not listed, add a New one and select it from this list. If you want to change the settings of a Platform Connector configuration, select it and click Edit.

Packaging Disk Filename - (Required) The name of the Packaging Machine you created in Azure.