To create a Platform Layer you:
When creating a Platform layer for Hyper-V using the Network File Share, be sure to be prepared with the following information:
If the operating system image you used to create your OS layer originated in Hyper-V, you do not need a Hyper-V Platform layer, because the Hyper-V settings are already included in your OS layer.
If the operating system image you used to create your OS layer originated on a different hypervisor, you should set the Hyper-V settings in the Platform layer. The purpose of these settings is to ensure that applications install and run flawlessly in Hyper-V.
If you are using KMS licensing, you need the KMS settings.
Select Layers > Platform Layers and select Create Platform Layer in the Action bar. This opens the Create Platform Layer wizard.
In the OS Layer tab, select the OS Layer you want to associate with this Platform Layer.
In the Connector tab, choose the Network File Share Connector Configuration.
In the Platform Types tab, select the radio button that describes the purpose of this Platform Layer: to publish Layered Images.
From the drop-down menus, select the Hyper-V hypervisor, and the provisioning service and/or connection broker you are using, if any.
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 tools, as described in the next two sections.
In the Icon Assignment tab, select an icon to assign to the layer. This icon represents the layer in the Layers Module.
In the Confirm and Complete tab, review the details of the Layer, enter a comment if required, and click Create Layer. Any comments you enter will appear in the Information view Audit History.
At the bottom of the UI, expand the Tasks bar and double-click the task to show the full task description.
Once the task is complete, the location of the Packaging Disk is included in the task description.
Next, you can deploy the Packaging Machine for your Layer. The Packaging Machine is a temporary virtual machine where you install the software to include in the Layer being created.
Locate the Packaging Disk in the following directory on the Network File Share:
Copy the Packaging Disk to your Hyper-V environment.
NOTE: Technically, if \Unidesk\Packaging Disks is in your hypervisor environment, you can continue working in the Packaging Disks folder instead of copying the disk to a separate location, but the directory will quickly become crowded with files generated by your hypervisor when you use the disk to create a new VM.
IMPORTANT: Do not copy the disk to the Finalize folder until it is ready to finalize. A disk in the Finalize folder cannot be attached to the new VM that you are going to create next.
In Hyper-V, create a virtual machine using the Packaging Disk as the boot disk. This is the Packaging Machine where you will install the software to include in the layer.
Whether you are creating a Platform Layer or adding a version to it:
Remote log in to the Packaging Machine. Be sure to log in using the User account you used to create the OS.
Install the platform software and tools, along with any drivers, boot-level applications, or files needed. Keep in mind that the state of the software before you finalize the layer is what the image will use.
Make sure the Packaging Machine is in the state you want it to be in for users:
If using PVS and your OS image was activated using KMS, rearm KMS just before you shut down
Verify the Rearm count on the OS by running slmgr /dlv from a command prompt. The Rearm count must not be zero.
Once the software is installed on the Packaging Machine, it is important 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, which appears as an icon on the Packaging Machine's desktop.
To use the Shutdown For Finalize tool:
If you are using KMS licensing, once any pending operations are complete, be sure to rearm KMS yet again just before you shutdown. First, enter this command to verify that the Rearm count is > 0:
Then, rearm KMS:
The Layer should be ready to finalize.
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 Microsoft NGen operation is in progress in the background.
If a Microsoft NGen operation is in progress, you may be able to expedite it, as described in the next section.
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.
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:
Open a command prompt as Administrator.
Go to the Microsoft .NET Framework directory for the version currently in use:
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!
Check the status of an NGen operation
Open a command prompt as Administrator.
Check status by running this command:
ngen queue status
When you receive the following status, the NGen is complete, and you can finalize the Layer.
The .NET Runtime Optimization Service is stopped
Now that the Layer has been verified and shut down, it is ready to finalize.
Copy the Packaging Disk from the folder containing the Packaging Machine files to the Finalize folder on the Network File Share:
Return to the Management Console.
Select Layers > Platform Layers.
Select Finalize in the Action bar.
Monitor the Task bar to verify that the action completes successfully and that the layer is deployable.