Step-by-step guide to learn how to create and optimize a new OS layer with Citrix App Layering.
More from the Lab!
- Building a Dual-Xeon Citrix Lab: Part 1 – Considerations
- Building a Dual-Xeon Citrix Lab: Part 2 – Hardware
- Building a Dual-Xeon Citrix Lab: Part 3 – Windows and Hyper-V installation
- Lab: Part 4 – Hyper-V Networking
- Lab: Part 5 – NetScaler 11 Architecture and Installation
- Lab: Part 6 – Configure NetScaler 11 High Availability (HA Pair)
- Lab: Part 7 – Upgrade NetScalers in HA
- Lab: Part 8 – Save, Backup and Restore NetScaler 11 configuration
- Lab: Part 9 – Install Microsoft SQL Server 2014 (Dedicated)
- Lab: Part 10 – Citrix Licensing demystified
- Lab: Part 11 – Install XenDesktop 7.6
- Lab: Part 12 – Setup NetScaler 11 Clustering (TriScale)
- Lab: Part 13 – Configure Published Applications with XenDesktop 7.6
- Lab: Part 14 – Citrix StoreFront 3.x
- Lab: Part 15 – Configure SSL in StoreFront
- Lab: Part 16 – StoreFront load balancing with NetScaler (Internal)
- Lab: Part 17 – Optimize and secure StoreFront load balancing with NetScaler (Internal)
- Lab: Part 18 – Secure LDAP (LDAPS) load balancing with Citrix NetScaler 11
- Lab: Part 19 – Configure Active Directory authentication(LDAP) with Citrix NetScaler 11
- Lab: Part 20 – RDP Proxy with NetScaler Unified Gateway 11
- Lab: Part 21 – Secure SSH Authentication with NetScaler (public-private key pair)
- Lab: Part 22 – Ultimate StoreFront 3 customization guide
- Lab: Part 23 – Securing Citrix StoreFront DMZ deployment
- Lab: Part 25 – Upgrade to Citrix StoreFront 3.7
- Lab: Part 26 – Install/Upgrade Citrix XenDesktop 7.11
- Lab: Part 27 – Getting started with Microsoft Azure
- Lab: Part 28 – Getting started with Citrix Cloud
- Lab: Part 29 – Configure XenDesktop And XenApp Service with Microsoft Azure and Citrix Cloud
- Lab: Part 30 – Configure Identity and Access Management in Citrix Cloud with Microsoft Azure AD
- Lab: Part 31 – Configure NetScaler Gateway Service for XenApp and XenDesktop Service in Citrix Cloud
- Lab: Part 32 – Configure MCS with XenDesktop and XenApp Service in Citrix Cloud
- Lab: Part 33 – Configure Azure Quick Deploy with XenDesktop and XenApp Service in Citrix Cloud
- Lab: Part 34 – Configure Site Aggregation for Citrix Workspace in Citrix Cloud with XenDesktop 7.x located on-premises
- Lab: Part 35 – Configure a Hybrid NetScaler MA Service environment in Citrix Cloud
- Lab: Part 36 – Configure ShareFile in Citrix Cloud with StorageZones on-premises
- Lab: Part 37 – Upgrade NetScaler HA pair with NetScaler MA Service in Citrix Cloud
- Lab: Part 38 – How to Configure Full VPN Setup with Citrix NetScaler in CLI
- Lab: Part 39 – Configure Multi-Factor Authentication with Azure MFA Service and Citrix Workspace
- Lab: Part 40 – Getting Started with Citrix App Layering
- Lab: Part 41 – Configure Citrix App Layering
- Lab: Part 42 – OS Layer with Citrix App Layering
- Lab: Part 43 – Platform Layer with Citrix App Layering
- Lab: Part 44 – Application Layers with Citrix App Layering
- Lab: Part 45 – Layered Image Deployment with Citrix App Layering
- Lab: Part 46 – Elastic deployment with Citrix App Layering
- Lab: Part 47 – User Layers with Citrix App Layering
- Lab: Part 48 – Windows 10 and PVS with Citrix App Layering
We discussed in the previous posts of this Citrix App Layering series how to install and configure the appliance. In this post, we will create our first OS Layer for Windows Server 2016 and optimize the layer with best practices.
More from this Citrix App Layering series
- Introduction to Citrix App Layering
- Lab: Part 40 – Getting Started with Citrix App Layering
- Lab: Part 41 – Configure Citrix App Layering
- Lab: Part 42 – OS Layer with Citrix App Layering
- Lab: Part 43 – Platform Layer with Citrix App Layering
- Lab: Part 44 – Application Layers with Citrix App Layering
- Lab: Part 45 – Layered Image Deployment with Citrix App Layering
- Lab: Part 46 – Elastic deployment with Citrix App Layering
- Lab: Part 47 – User Layers with Citrix App Layering
- Lab: Part 48 – Windows 10 and PVS with Citrix App Layering
- Best Practices for Citrix App Layering
Requirements
For this lab, you need the following:
- Citrix ELM installed and configured
- Windows operating system .ISO file (Ex: Windows Server 2016)
- App Layering package downloaded from Citrix website
- Citrix Optimizer
Best Practices for OS Layers in Citrix App Layering
- Have one OS layer per Operating System (Windows Server 2016, Windows 10 64-bit, etc)
- Check Citrix documentation about supported OS
- The Operating System layer is always the lowest priority layer. It is always at the bottom of the layer stack no matter what the version date and time is.
- Start with a fresh image of a supported Windows OS from your hypervisor. Create a new base image based on latest .ISO downloaded from Microsoft website that includes latest Windows updates (Ex: Windows Server 2016 ISO download)
- Legacy NIC for Hyper-V and VMXNET3 for VMware
- Generation 2 virtual machine type is not supported with Hyper-V. Only Generation 1.
- Configure DHCP to get an IP address in the template.
- Clean up any installers or temp directories.
- OS Layer must be as clean as possible. Only install required apps! And only install on C:\ drive.
- If needed, install RDSH and Remote Assistance. If 2012 (R2), also install Desktop Experience.
- Activate Windows
- Rename the machine and leave it in WORKGROUP
- Install pending Windows Updates and then stop and disable Windows Updates service and then REBOOT!
- Install Microsoft .NET Framework and Visual C++ libraries in the OS layer
- Install Microsoft .NET Core in the OS Layer
- Remove all Microsoft Store Apps and Disable related services
- Disable Windows Defender and Windows Firewall
Set-NetFirewallProfile -Profile Domain, Public, Private -Enabled False Set-Service MpsSvc -StartUpType Disabled Stop-Service MpsSvc -force
- Disable IPV6 (PVS only)
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\ Name: DisabledComponents Type: REG_DWORD Min Value: 0x00 Max Value: 0xFF (IPv6 disabled)
- Disable IE ESC
- Force High Performance Power Scheme
Powercfg /list Powercfg /s {UID}
- Configure Page File
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management Key: "PagingFiles" (reg_multi_sz) Value: "C:\pagefile.sys 4096 4096"
- Set Time to display list of OS to 5s
Bcdedit /timeout 5
- Adjust performance for programs
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\PriorityControl Key: "Win32PriortySeparation" (dword) Value: "26"
- Remove Legal notice
(Remove. Causing delay in launching published applications) HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System; Legalnoticecaption Legalnoticetext
- Run Citrix Optimizer with the appropriate template
- Disable OS Rearm (MCS Only)
Set-ProvServiceConfigurationData -Name ImageManagementPrep_Excluded_Steps -Value OsRearm
- Hypervisor tools of your main hypervisor should be installed into the Operating System layer (Ex: VMware Tools or Hyper-V Integration Services). If you plan to deploy that image on a different hypervisor, you will need to add the tools on the platform layer.
- Do not install applications (Antivirus, Monitoring agents, etc) in the OS Layer.
- Create new local users and local groups in this layer. Domain users and groups can be added by GPO.
- Always connect to the OS Layer with the same local account
- Check this link for more best practices.
- Run Preparation Script instead of Shutdown For Finalize (optional)
Create a new OS layer in Citrix App Layering
Build the master image
Create a new virtual machine from the .ISO downloaded on Microsoft Website (Ex: 4vCPU, 8GB ram and 60 GB).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
$VMname = "2016_MASTER" $SwitchName = "DMZ" $ISOLocation = "C:\en_windows_server_2016_x64_dvd_9718492.iso" $Param = @{ Name = $VMname MemoryStartUpBytes = 8GB Path = "I:\VM\Hyper-V" NewVHDPath = "I:\VM\2016_MASTER\2016_MASTER.vhdx" NewVHDSizeBytes = 60GB ErrorAction = 'Stop' Verbose = $True } $VM = New-VM @Param $Param = @{ ProcessorCount = 4 DynamicMemory = $true } $VM = $VM | Set-VM @Param Remove-VMNetworkAdapter -VMName $VMname -Name "Network Adapter" Add-VMNetworkAdapter -VMname $VMname -IsLegacy $true -Name "Legacy Network Adapter" -SwitchName $SwitchName Set-VMDvdDrive -VMName $VMname -Path $ISOLocation Start-VM -Name $VMname |
Install Windows Server 2016 by following the wizard. and apply all best practices & recommendations highlighted at the beginning of this article.
Browse to the Citrix App Layering package.
Double click on citrix_app_layering_os_machine_tools_xx.xx.x.exe.
This package will unzip in C:\Windows\Setup\scripts (by default).
If not started automatically, run SetKMSVersion.hta.
Run also RemoveStoreApp.cmd to remove all Microsoft Store applications from the image.
Then run setup_x64.exe to install Citrix App Layering Image Preparation Utility.
Select Next to install.
Select Next.
Then Finish to close the window.
Shutdown the virtual machine.
Create OS Layer in Citrix App Layering
Go to ELM console > Layers > OS Layers and select Create OS Layer.
Enter layer details:
Select the connector to be able to browse the virtual machines.
Select the virtual machine.
Confirm.
Assign an icon.
Create layer.
ELM will start to copy the vDisk in the repository.
You will find the new OS Layer in the ELM console when the creation has finished.
Update OS Layer
To update the OS layer, right click and Add Version.
Increment the version number and add a description.
Select the connector where ELM will deploy the virtual machine.
Enter the disk filename.
Confirm the creation.
ELM will prepare the OS Layer image.
You can see in the reposity (/mnt/repository/Unidesk/Packaging Disks/) that a new OS_2016_Boot.vhd is available.
After few minutes, ELM will start to create to deploy the virtual machines and its disks.
See below the virtual machine created in Hyper-V.
When everything is ready, ELM will automatically start the virtual machine.
The virtual machine is available. Logon and install updates.
Note: if a reboot is required during the updates, it is recommended to reboot a second time.
Then click on Shutdown For Finalize (the icon is available on the desktop by default).
The virtual machine will shutdown.
Go to the ELM console > Layers > OS Layers and right click on the OS_2016 layer.
Select Finalize.
ELM will copy the disk from the share to the repository.
Location: /mnt/repository/Unidesk/Finalize Disks/.
Then ELM will copy it to the layer disk.
Location: /mnt/repository/Unidesk/Layers/OS/.
The last step is remove the virtual machine in Hyper-V.
The new version of the layer has been deployed.
Export layer
You can export layers for backup or to transfer them to a different ELM infrastructure.
Select a network location and enter the proper credentials.
Select the item you want to export.
Select Finalize to export.
Take a look at the folder for the exported files.
Delete version of a OS layer
Right click on the OS layer and click on Delete Versions.
Select the version you want to delete. You can also delete the full layer with all its versions.
Click on Delete Versions to confirm.
Cancel a layer revision
Go to the layer task and click on Cancel to flush the current version of the layer.
ELM will flush everything for this version of the OS layer.
More from the Lab!
- Building a Dual-Xeon Citrix Lab: Part 1 – Considerations
- Building a Dual-Xeon Citrix Lab: Part 2 – Hardware
- Building a Dual-Xeon Citrix Lab: Part 3 – Windows and Hyper-V installation
- Lab: Part 4 – Hyper-V Networking
- Lab: Part 5 – NetScaler 11 Architecture and Installation
- Lab: Part 6 – Configure NetScaler 11 High Availability (HA Pair)
- Lab: Part 7 – Upgrade NetScalers in HA
- Lab: Part 8 – Save, Backup and Restore NetScaler 11 configuration
- Lab: Part 9 – Install Microsoft SQL Server 2014 (Dedicated)
- Lab: Part 10 – Citrix Licensing demystified
- Lab: Part 11 – Install XenDesktop 7.6
- Lab: Part 12 – Setup NetScaler 11 Clustering (TriScale)
- Lab: Part 13 – Configure Published Applications with XenDesktop 7.6
- Lab: Part 14 – Citrix StoreFront 3.x
- Lab: Part 15 – Configure SSL in StoreFront
- Lab: Part 16 – StoreFront load balancing with NetScaler (Internal)
- Lab: Part 17 – Optimize and secure StoreFront load balancing with NetScaler (Internal)
- Lab: Part 18 – Secure LDAP (LDAPS) load balancing with Citrix NetScaler 11
- Lab: Part 19 – Configure Active Directory authentication(LDAP) with Citrix NetScaler 11
- Lab: Part 20 – RDP Proxy with NetScaler Unified Gateway 11
- Lab: Part 21 – Secure SSH Authentication with NetScaler (public-private key pair)
- Lab: Part 22 – Ultimate StoreFront 3 customization guide
- Lab: Part 23 – Securing Citrix StoreFront DMZ deployment
- Lab: Part 25 – Upgrade to Citrix StoreFront 3.7
- Lab: Part 26 – Install/Upgrade Citrix XenDesktop 7.11
- Lab: Part 27 – Getting started with Microsoft Azure
- Lab: Part 28 – Getting started with Citrix Cloud
- Lab: Part 29 – Configure XenDesktop And XenApp Service with Microsoft Azure and Citrix Cloud
- Lab: Part 30 – Configure Identity and Access Management in Citrix Cloud with Microsoft Azure AD
- Lab: Part 31 – Configure NetScaler Gateway Service for XenApp and XenDesktop Service in Citrix Cloud
- Lab: Part 32 – Configure MCS with XenDesktop and XenApp Service in Citrix Cloud
- Lab: Part 33 – Configure Azure Quick Deploy with XenDesktop and XenApp Service in Citrix Cloud
- Lab: Part 34 – Configure Site Aggregation for Citrix Workspace in Citrix Cloud with XenDesktop 7.x located on-premises
- Lab: Part 35 – Configure a Hybrid NetScaler MA Service environment in Citrix Cloud
- Lab: Part 36 – Configure ShareFile in Citrix Cloud with StorageZones on-premises
- Lab: Part 37 – Upgrade NetScaler HA pair with NetScaler MA Service in Citrix Cloud
- Lab: Part 38 – How to Configure Full VPN Setup with Citrix NetScaler in CLI
- Lab: Part 39 – Configure Multi-Factor Authentication with Azure MFA Service and Citrix Workspace
- Lab: Part 40 – Getting Started with Citrix App Layering
- Lab: Part 41 – Configure Citrix App Layering
- Lab: Part 42 – OS Layer with Citrix App Layering
- Lab: Part 43 – Platform Layer with Citrix App Layering
- Lab: Part 44 – Application Layers with Citrix App Layering
- Lab: Part 45 – Layered Image Deployment with Citrix App Layering
- Lab: Part 46 – Elastic deployment with Citrix App Layering
- Lab: Part 47 – User Layers with Citrix App Layering
- Lab: Part 48 – Windows 10 and PVS with Citrix App Layering