![VDI-LAB-2018 – Part 11 – Create a Windows 10 Golden Image VDI-LAB-2018 – Part 11 – Create a Windows 10 Golden Image](https://mulcas.com/wp-content/uploads/2018/05/mulcas_VDI-lab-2018.png)
Summary:
It is time to create and optimize the golden image that we will use to deploy all our desktops. The primary purpose of this golden image is to run a basic test with the Login VSI benchmark tool, so I will optimize a Windows 10 VM to get the best performance (low latency) and user experience (low applications response times). Only some basic applications and MS office 2016 will be installed. Nevertheless, it could be used as an essential guide for any deployments with Horizon View.
Note for Login VSI testers: To date, I can guarantee that if you follow all the steps in this guide (part), you’ll have no issues when testing any worker with Login VSI 4.1.
Note: This is a massive post (the most extensive post of this series), I want to keep my step-by-step format as much as I can, even though many images are not necessary for an average (IT) user.
Note: This guide will also work with vSphere 6.7, some configurations aren’t needed.
This is part 11 out of 12 of the VDI LAB series. Check out the introduction first.
The ultimate VDI deployment guide (from scratch) with VMware vSphere 6.5 and Horizon View 7.3 – 2018. 😉
1. Prerequisites
- Windows Server 2016. Domain Controller server previously created in Part 5 of this series
- Download Windows 10 64-bits and MS office 2016 ISO file and upload it to an accessible datastore.
- Create/upload an ISO with all the programs you will install or, make sure you can obtain them after connecting the VM to the internet.
2. VM configuration
First off is to create and configure this new VM to be used as a template.
@vSphere Client
Note: This is the vSphere Client set in part 7 of this series, due to our desktop infrastructure will be deployed here. If you are interested in only the tune-up of the golden image and you are not following the whole VDI-LAB series, don’t mind this, any ESXi host will do.
- Right-click on your host and select New Virtual Machine
- Select: Create a New virtual machine.
![Part11 Image01 New Virtual Machine](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image01-300x174.png)
- Name your VM. A recommendation is to use an easy VM pattern.
![Part11 Image02 New Virtual Machine](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image02-300x174.png)
- Select your host (or cluster).
![Part11 Image03 New Virtual Machine](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image03-300x174.png)
- Select your datastore.
![Part11 Image04 New Virtual Machine](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image04-300x174.png)
- Leave by default or select ESXi 6.5 and later.
![Part11 Image05 New Virtual Machine](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image05-300x175.png)
- Select Windows as OS family and Microsoft Windows 10 (64-bit) as the OS version.
![Part11 Image06 New Virtual Machine](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image06-300x174.png)
- From Virtual Hardware, change:
- CPU to 2
- Memory to 4096 MB
- Check Reserve all guest memory (All locked).
- Note: This is recommended to avoid performance issues in large environments, but this depends on the available resources and isn’t a must for a lab.
- New Hard disk to 50 GB
- Make sure you have the network available and is connected.
![Part11 Image07 New Virtual Machine](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image07-300x175.png)
- Still on Virtual Hardware…
- Expand the network and change the Adapter Type to VMXNET 3
- Select Datastore ISO File under New CD/DVD Drive, then select your Windows 10 image and make sure that Connect At Power On is checked.
- Remove Floppy Drive
![Part11 Image08 New Virtual Machine](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image08-300x174.png)
- Still on Virtual Hardware…
- Go to Video card, and change Number of displays to 4 and Total video memory to 64 MB.
- Note: Total video memory is usually configured up to 128 MB, but for my scenario, I do think is not necessary. Also, Number of displays can be set to only 2.
- Do not check Enable 3D Support unless you have Graphics Card support on your ESXi hosts.
![Part11 Image09 New Virtual Machine](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image09-300x175.png)
- Move to VM Options tab
- From Boot Option, check Force BIOS setup – The next time the virtual machine boots…
![Part11 Image10 New Virtual Machine](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image10-300x175.png)
- Still on VM Options…
- Go to Advance, and from Settings uncheck Enable logging
- Then go to Edit Configuration…
![Part11 Image11 New Virtual Machine](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image11-300x174.png)
Note: Steps 13 to 16 are not needed on vSphere 6.7.
- On the new window, Configuration Parameters, add a new parameter:
- Name: devices.hotplug
- Value: false
- Click Add, OK and then Next.
![Part11 Image12 New Virtual Machine](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image12-300x105.png)
- Finally, review your configuration and click Finish.
![Part11 Image13 New Virtual Machine](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image13-300x174.png)
- Now power on the VM and open the VM remote console. Wait to get to the BIOS and from the Advanced tab, go to I/O Device Configuration and disable the Floppy drive, also the Serial, Parallel, and Floppy Controllers.
![Part11 Image14 New Virtual Machine Bios](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image14-300x225.png)
- Now to Exit tab and click Exit Saving Changes (or hit F10 ) to save the settings and reboot.
![Part11 Image15 New Virtual Machine bios](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image15-300x225.png)
3. OS installation
After the VM is rebooted, you will reach the first screen of the Windows installer.
- Press Shift-F10 to open a command prompt to create a partition for reserved space compatible with VDI.
![Part11 Image16 Windows 10 Install Golden Image](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image16-300x220.png)
- Type and hit Enter in the following order:
- diskpart
- Select Disk 0
- Create Partition Primary
- Exit
- Exit
![Part11 Image17 Windows 10 Install Golden Image](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image17-300x221.png)
- You will be returned to the previous screen of windows installer, leave everything by default, we can change this later.
![Part11 Image18 Windows 10 Install Golden Image](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image18-300x220.png)
- Click on Install now.
![Part11 Image19 Windows 10 Install Golden Image](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image19-300x223.png)
- Select Windows 10 pro, or the available version according to your region/image and click Next.
![Part11 Image20 Windows 10 Install Golden Image](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image20-300x225.png)
- Check to accept license terms and Next.
![Part11 Image21 Windows 10 Install Golden Image](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image21-300x225.png)
- Select Custom: Install Windows only.
![Part11 Image22 Windows 10 Install Golden Image](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image22-300x225.png)
- Select the available partition and Next.
![Part11 Image23 Windows 10 Install Golden Image](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image23-300x225.png)
- Wait few minutes for the Windows installation files.
![Part11 Image24 Windows 10 Install Golden Image](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image24-300x225.png)
- Wait for windows to start.
![Part11 Image25 Windows 10 Install Golden Image](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image25-300x225.png)
- Select your region and click Yes.
![Part11 Image26 Windows 10 Install Golden Image](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image26-300x225.png)
- Select a keyboard layout and click Yes.
![Part11 Image27 Windows 10 Install Golden Image](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image27-300x225.png)
- Skip adding a second keyboard layout.
![Part11 Image28 Windows 10 Install Golden Image](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image28-300x225.png)
- Skip Connect to a network.
![Part11 Image29 Windows 10 Install Golden Image](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image29-300x225.png)
- This is an important step, let’s create a “user” to use for the initial configuration, later this user will be deleted. I created an user named “user” (Original…)
![Part11 Image30 Windows 10 Install Golden Image](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image30-300x225.png)
- Create and confirm a password and add a hint.
![Part11 Image31 Windows 10 Install Golden Image](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image31-300x224.png)
![Part11 Image32 Windows 10 Install Golden Image](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image32-300x224.png)
![Part11 Image33 Windows 10 Install Golden Image](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image33-300x225.png)
- Turn off all “privacy setting for your device.”
![Part11 Image34 Windows 10 Install Golden Image](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image34-300x225.png)
- Wait to windows gets ready.
![Part11 Image35 Windows 10 Install Golden Image](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image35-300x225.png)
- Finally, we will get to the Windows 10 desktop.
![Part11 Image36 Windows 10 Install Golden Image](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image36-300x225.png)
4. OS customization
It is time to do all necessary tweaks and tunings to boost the performance of this precious golden image.
4.1 Install VMware tools.
- Mount the ISO from VMware Web Client.
![Part11 Image37 VMware tools](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image37-300x130.png)
- Double-click Drive DVD (D:) VMware Tools
![Part11 Image38 Vmware tools](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image38-300x226.png)
- Follow the installation wizard, select Typical setup, click install and finish, then reboot the OS.
![Part11 Image39 Vmware tools](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image39-300x234.png)
4.2 Enable the Administrator account
- Log in to the desktop using the created “user” and password.
- Enable a local administrator account. Right-click on the start button and go to Computer Management.
- Go to: Local User and Groups / User, Right-click on Administrator / Properties.
![Part11 Image40 Enable the Administrator account](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image40-300x106.png)
- Uncheck Account is disabled. Make sure Password never expires is checked. Click OK. (No password need to be set)
![Part11 Image41 Enable the Administrator account](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image41-266x300.png)
- Sign out the desktop and sign on using the administrator account.
![Part11 Image42 Enable the Administrator account](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image42-300x225.png)
4.3 Delete the “user” profile and account
- Go to: Control Panel – System and Security – System
- Then go to Advanced system settings / Advanced, from User Profiles, select Settings… Select “user” profile – Delete – OK
![Part11 Image43 Delete the user profile and account](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image43-300x174.png)
- Right Click on Start / Computer Management / Local Users and Groups / Users
- Right Click on “user” and choose Delete
- Click OK to the warning messages.
![Part11 Image44 Delete the user profile and account](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image44-300x154.png)
4.4 Change computer name
- Go to Control Panel / System and Security / System
- Then go to Remote settings / Computer Name / Change / Input new computer name (keep it simple) / OK.
- Restart the computer. We will add the machine to the domain later.
![Part11 Image45 Change computer name](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image45-300x194.png)
- Also, change/adjust date and right (proper) time zone.
4.5 Install .NET Framework 3.5
- Go to: Control Panel – Programs – Programs and Features – Turn Windows Features on or off
- Check .NET Framework 3.5 and click OK
- Download and install the files
![Part11 Image46 Install .NET Framework 3.5](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image46-300x218.png)
4.6 Run Windows update, install all the latest patches
- Click on the Start button – Settings – Update & Security – Check for Updates.
- Install all available Windows updates.
- Reboot the VM and repeat this process until all Windows updates have been installed.
4.7 Run cleanup manager:
- Click Start, and then click Run.
- Type cleanmgr to open Disk Cleanup for (C:)
![Part11 Image47 Run cleanup manager](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image47-300x164.png)
- Check all items you want to delete
- Click OK
![Part11 Image48 Run cleanup manager](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image48-248x300.png)
4.8 Set Power Options to high
- GO to: Control Panel – Hardware and Sound – Power Options.
- Click Show Additional Power Plans, Choose High Performance, and Click Create a Power Plan.
![Part11 Image49 Set Power Options to high](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image49-300x153.png)
- Choose “High Performance,” for a plan name type “VDI” or whatever name you want. Click Next.
![Part11 Image50 Set Power Options to high](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image50-300x166.png)
- Select Never to: Turn off the display and Put the computer to sleep. Click Create.
![Part11 Image51 Set Power Options to high](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image51-300x114.png)
4.9 Install and run VMware OS Optimization tool.
- Install and run the VMware OS Optimization tool. As mentioned before, I am optimizing for Login VSI test with Windows 10, so I am using a template provided by them.
- Download VMware OS optimization tool: https://labs.vmware.com/flings/vmware-os-optimization-tool
- Get the template by Login VSI. This is optional. There are pre-configured templates provided by VMware that could be used.
- Run VMware OSOT and open the My Templates tab
- Click Import Template at the right bottom of the window
- Browse to the VDILIKEAPRO / Login VSI tuning template xml file
- Open the Analyze tab and select the My Templates\Windows 10 – Login VSI – VDILIKEAPRO template
- Click analyze to compare your system to the tuning template
- Apply tuning where needed
4.10 Improve login time for floating desktops on Horizon View
- Click on the Start button – type Run.
- Type regedit
- Delete a registry key named StubPath from these directories:
HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{2C7339CF-2B09-4501-B3F3-F3508C9228ED}
HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{2D46B6DC-2207-486B-B523-A557E6D54B47}
HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{44BBA840-CC51-11CF-AAFA-00AA00B6015C}
HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{6BF52A52-394A-11d3-B153-00C04F79FAA6}
HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{89820200-ECBD-11cf-8B85-00AA005B4340}
HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{89820200-ECBD-11cf-8B85-00AA005B4383}
HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{89B4C1CD-B018-4511-B0A1-5476DBF70820}
HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{22d6f312-b0f6-11d0-94ab-0080c74c7e95}
- In my case, just 4 out of these 8 keys are present, just delete the ones you have
![Part11 Image52 regedit](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image52-300x194.png)
4.11 Join the machine to the domain.
- Follow the same steps as number 7 but now join the machine a domain and restart the VM
Note: This could be done in the corresponding previous step, I consider is better to wait to avoid some permissions issues (Depends on your domain configuration).
![Part11 Image53 Join the machine to the domain](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image53-300x226.png)
4.12 Configure PageFile.
- This varies depending on your configuration and purpose. Visit these links for more information:
- Go to: Control Panel / System and Security / System
- Then go to Advanced system settings / Advanced, and from Performance, select Settings…
![Part11 Image54 Configure PageFile](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image54-300x263.png)
- Go to Advanced Tab / Change… Uncheck the first option and check “Custom size“
- Initial size (MB): 2048
- Maximum size (MB): 4096
- Click Set and then OK until all windows are closed.
- Restart the VM
![Part11 Image55 Configure PageFile](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image55-300x220.png)
5. Install MS office 2016 and essential apps
5.1 Install Horizon View 7 agent.
- Mount ISO files or download latest version of Horizon View. The version I am using for this series is 7.3.2.
- From the installation wizard, I am leaving as default everything.
- Reboot the VM after installation.
![Part11 Image56 Install Horizon View 7 agent](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image56-300x227.png)
5.2 Install MS office 2016
- Mount MS office 2016 ISO.
- Download office deployment tool for MS office 2016 from this link: https://www.microsoft.com/en-us/download/details.aspx?id=49117
![Part11 Image57 Install MS office 2016 silent installation](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image57-300x166.png)
- Open the installer and accept the Microsoft license to continue. Install the files on your desktop.
- Three files will be created: Configuration, EULA, and setup.
- Change the name of the folder to a shorter/easy one, like only “office” and copy this folder to the desktop.
- Right click on Configuration / Open with / Notepad
Note: Depends on what you want to install this must be changed, I will keep a basic configuration without all necessary MS office application that I won’t need for testing.
- For this test, I want to install Office 32-bits with Word, Excel, Powerpoint, and Outlook. Make sure the right source path is selected.
- Replace/Edit the configuration file as following and save it:
<Configuration>
<Add SourcePath=”D:\” OfficeClientEdition=”32″ >
<Product ID=”ProPlusRetail”>
<Language ID=”en-us” />
<ExcludeApp ID=”OneDrive” />
<ExcludeApp ID=”OneNote” />
<ExcludeApp ID=”Groove” />
<ExcludeApp ID=”Lync” />
<ExcludeApp ID=”Access” />
<ExcludeApp ID=”Publisher” />
</Product>
</Add>
<Display Level=”None” AcceptEULA=”TRUE” />
<Property Name=”AUTOACTIVATE” Value=”1″ />
<Updates Enabled=”TRUE” Channel=”Monthly” />
</Configuration>
- Open command prompt as administrator.
- Run:
- cd desktop/office
- setup /configure configuration.xml
- MS Office will start the installation.
![Part11 Image58 Install MS office 2016 silent installation](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image58-300x157.png)
- Wait until the installation is completed.
![Part11 Image59 Install MS office 2016 silent installation](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image59-300x193.png)
- Click Close to finish the installation.
![Part11 Image60 Install MS office 2016 silent installation](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image60-300x192.png)
5.3 Tune up the MS office 2016 installation
Important: To avoid “First-thing-first” and other unwanted messages after cloning this image, copy the following Reg paths in notepad, save it as .bat and the run it.
- Notice that this is configured for Office 2016 32-bits.
- For office 2013 or 365. Use the number 15 instead of 16.
- For office 64-bits versions, delete the “Wow6432Node” path.
reg add “HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\16.0\Registration” /v AcceptAllEulas /t REG_DWORD /d 1 /f >nul
reg add “HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\16.0\User Settings\MyCustomUserSettings” /v Count /t REG_DWORD /d 1 /f >nul
reg add “HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\16.0\User Settings\MyCustomUserSettings\Create\Software\Microsoft\Office\16.0\FirstRun” /v BootedRTM /t REG_DWORD /d 1 /f >nul
reg add “HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\16.0\User Settings\MyCustomUserSettings\Create\Software\Microsoft\Office\16.0\FirstRun” /v disablemovie /t REG_DWORD /d 1 /f >nul
reg add “HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\16.0\User Settings\MyCustomUserSettings\Create\Software\Microsoft\Office\16.0\Registration” /v AcceptAllEulas /t REG_DWORD /d 1 /f >nul
reg add “HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\16.0\User Settings\MyCustomUserSettings\Create\Software\Microsoft\Office\16.0\Common\General” /v shownfirstrunoptin /t REG_DWORD /d 1 /f >nul
reg add “HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\16.0\User Settings\MyCustomUserSettings\Create\Software\Microsoft\Office\16.0\Common\General” /v ShownFileFmtPrompt /t REG_DWORD /d 1 /f >nul
reg add “HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\16.0\User Settings\MyCustomUserSettings\Create\Software\Microsoft\Office\16.0\Common\PTWatson” /v PTWOptIn /t REG_DWORD /d 1 /f >nul
reg add “HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\16.0\User Settings\MyCustomUserSettings\Create\Software\Microsoft\Office\16.0\Common” /v qmenable /t REG_DWORD /d 1 /f >nul
- Test office and check that no welcome message is present at start it.
- After setting above paths, there is no reason to set group policies for this, but for domain joined machines, is better to use it as well, so we can avoid any issue after cloning.
- Download, Install and configure Office 2016 Administrative Template files.
![Part11 Image61 office 2016 first thing first](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image61-300x154.png)
- Open the installer and accept Microsoft license to continue. Install the files on your desktop.
- Go to: C: / Windows / PolicyDefinition
- Two folders and one Excel file will be created: the “admx” folder is the one we need.
- Copy all the files (not folders) from this folder to the PolicyDefinition folder
- Also, copy all the files (not folders) from en-us (or current system language) folder and copy them to the PolicyDefinition\en-US folder
![Part11 Image62 office 2016 first thing first](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image62-300x191.png)
- Click Start, and then click Run, type gpedit.msc, and then click OK.
- @Local Group Policy Editor: User Configuration / Administrative Templates / Microsoft Office 2106 / First Run and enable “Disable First Run Movie”
![Part11 Image63 office 2016 first thing first](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image63-300x155.png)
Note: Go back to step 4 of this section and do the same configuration in your domain controller!
5.4 Install additional programs
For Login VSI test purpose, I will install their required apps. You could use these, add or ignore as needed:
- Doro PDF
- Adobe Reader XI
- Adobe Flash
- Java
5.5 Set Adobe PDF as a default app
Note: Windows 10, uses MS Edge as default PDF viewer, we need to force to use Adobe Reader XI. I tried Adobe Reader DC, but it will create some extra initial messages that are difficult to handle when testing with Login VSI, so I decided to move back to Adobe Reader XI
- First off, set the current files as a default from windows setting.
- Go to: Windows Settings / Apps / Default apps / Set defaults by app.
![Part11 Image64 Set Adobe PDF as a default app](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image64-300x193.png)
- Go to: Windows Settings / Apps / Default apps / Set defaults by app.
- Click Adobe Reader XI and then click Manage.
- Find and click on the .pdf association file and select Adobe Reader.
![Part11 Image65 Set Adobe PDF as a default app](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image65-300x225.png)
- Choose: Switch anyway
- Change all the desired file association. It would look like the image below.
![Part11 Image66 Set Adobe PDF as a default app](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image66-237x300.png)
- Now, open the command prompt as administrator. Make sure your system is updated, or you might have issues with these commands.
- Run:
- Dism.exe /online /export-defaultappassociations:C:\CustomFileAssoc.xml
- Dism.exe /online /import-defaultappassociations:C:\CustomFileAssoc.xml
![Part11 Image67 Set Adobe PDF as a default app](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image67-300x151.png)
- Go to: C: / Windows / System32 and search for OEMDefaultAssociations
- Right-click and select to open with Notepad
- From a fresh windows installation, it will look something like this:
![Part11 Image68 Set Adobe PDF as a default app](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image68-300x111.png)
<?xml version=”1.0″ encoding=”UTF-8″?>
<DefaultAssociations>
<Association Identifier=”.acrobatsecuritysettings” ProgId=”Applications\AcroRd32.exe” ApplicationName=”Adobe Reader” />
<Association Identifier=”.epub” ProgId=”AppXvepbp3z66accmsd0x877zbbxjctkpr6t” ApplicationName=”Microsoft Edge” />
<Association Identifier=”.htm” ProgId=”htmlfile” ApplicationName=”Internet Explorer” />
<Association Identifier=”.html” ProgId=”htmlfile” ApplicationName=”Internet Explorer” />
<Association Identifier=”.pdf” ProgId=”AcroExch.Document.11″ ApplicationName=”Adobe Reader” />
<Association Identifier=”.pdfxml” ProgId=”Applications\AcroRd32.exe” ApplicationName=”Adobe Reader” />
<Association Identifier=”.tif” ProgId=”PhotoViewer.FileAssoc.Tiff” ApplicationName=”Windows Photo Viewer” />
<Association Identifier=”.tiff” ProgId=”PhotoViewer.FileAssoc.Tiff” ApplicationName=”Windows Photo Viewer” />
<Association Identifier=”.txt” ProgId=”txtfile” ApplicationName=”Notepad” />
<Association Identifier=”.url” ProgId=”IE.AssocFile.URL” ApplicationName=”Internet Browser” />
<Association Identifier=”.website” ProgId=”IE.AssocFile.WEBSITE” ApplicationName=”Internet Explorer” />
<Association Identifier=”bingmaps” ProgId=”AppXp9gkwccvk6fa6yyfq3tmsk8ws2nprk1p” ApplicationName=”Maps” />
<Association Identifier=”http” ProgId=”IE.HTTP” ApplicationName=”Internet Explorer” />
<Association Identifier=”https” ProgId=”IE.HTTPS” ApplicationName=”Internet Explorer” />
<Association Identifier=”mailto” ProgId=”Outlook.URL.mailto.15″ ApplicationName=”Outlook 2016″ />
</DefaultAssociations>
- Reboot the VM and make sure that there is not “An app default was reset” message like the image below:
![Part11 Image69.png Set Adobe PDF as a default app](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image69.png-300x228.png)
- If you follow previous steps in the proper order, you still may have the PDF issue.
- Now, to ignore Windows Security Service notification, go to Windows Settings / System / Notifications & actions
- Turn off all notification.
![Part11 Image70 Set Adobe PDF as a default app](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image70-300x213.png)
6. Final tweaks
6.1 Run VDI clean-up script
- Run a VDI clean-up script after all updates and configurations.
Note: Credits to https://www.plonius.com/single-post/2017/07/20/VDI-cleanup-script—the-decisive-factor
- Copy this into a Notepad and save it as .bat and run it. This will take about 10 minutes.
REM *********************
REM Force .net Runtime Optimization Service
REM *********************
%windir%\microsoft.net\framework64\v4.0.30319\ngen.exe update /force
REM *********************
REM Delete update tasks Google
REM *********************
SchTasks /Delete /TN “GoogleUpdateTaskMachineCore” /F
SchTasks /Delete /TN “GoogleUpdateTaskMachineUA” /F
REM *********************
REM Stop and disable Windows update service
sc stop wuauserv
sc config wuauserv start= disabled
REM *********************
REM Stop and disable Google update service
REM *********************
sc stop gupdate
sc config gupdate start= disabled
sc stop gupdatem
sc config gupdatem start= disabled
REM *********************
REM Stop and disable Windows Telemetry service
REM *********************
sc stop DiagTrack
sc config DiagTrack start= disabled
sc stop dmwappushservice
sc config dmwappushservice start= disabled
REM *********************
REM Delete any existing shadow copies
REM *********************
vssadmin delete shadows /All /Quiet
REM *********************
REM delete files in c:\Windows\SoftwareDistribution\Download\
REM *********************
del c:\Windows\SoftwareDistribution\Download\*.* /f /s /q
REM *********************
REM delete hidden install files
REM *********************
del %windir%\$NT* /f /s /q /a:h
REM *********************
REM delete prefetch files
REM *********************
del c:\Windows\Prefetch\*.* /f /s /q
REM *********************
REM Run Disk Cleanup to remove temp files, empty recycle bin
REM and remove other unneeded files
REM Note: Makes sure to run c:\windows\system32\cleanmgr /sageset:1 command
REM on your initially created parent image and check all the boxes
REM of items you want to delete
REM *********************
c:\windows\system32\cleanmgr /sagerun:1
REM ********************
REM Defragment the VM disk
REM ********************
sc config defragsvc start= auto
net start defragsvc
defrag c: /U /V
net stop defragsvc
sc config defragsvc start = disabled
REM *********************
REM Clear all event logs
REM *********************
wevtutil el 1>cleaneventlog.txt
for /f %%x in (cleaneventlog.txt) do wevtutil cl %%x
del cleaneventlog.txt
REM *********************
REM release IP address
REM *********************
ipconfig /release
REM *********************
REM Flush DNS
REM *********************
ipconfig /flushdns
REM *********************
REM Shutdown VM
REM *********************
shutdown /s /f /t 0
- The VM will shut down after this (as you can see in the last lines)
- Run this .bat every time the Windows is updated.
6.2 Remove “vmware-viewcomposer-ga” entry
- For Windows 10 Build 1709, creating a desktop pool will get stuck in customizing state. At the moment of writing this post, this hasn’t been solved by Horizon/Window. To solve this, follow the steps below.
- Removed the entry “vmware-viewcomposer-ga” from the value: DependOnService:
- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BFE
- Deleted Subkey Security:
- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BFE\Security
![Part11 Image71 vmware-viewcomposer-ga](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image71-300x136.png)
- After deleting it, should look like the image below.
![Part11 Image72 vmware-viewcomposer-ga](https://mulcas.com/wp-content/uploads/2018/07/Part11_Image72-300x204.png)
6.3 Take the snapshot
Note: I want to create linked-clone VMs, if full clones are desired, convert this machine to a template instead of taking the snapshot.
- Make sure the machine is on the domain with a dynamic IP address.
- Make sure you don’t have any ISO file attached to the VM. Change CD/DVD to Client Device or disconnect/remove the device.
- Powered off the VM.
- Finally, take your precious snapshot!
Thanks, it is quite informative
You are welcome!
Thanks for the terrific guide
This is actually helpful, thanks.
I like the article
I spent a lot of time to find something similar to this
Thanks for the great manual
Will this work for Win 10 1809?
Hi dave, I don’t have the resources to test 1809 at the moment but it should work. I usually see issues on the new version related to the Reg Paths, and Horizon and View Composer during cloning.
Hiya – will this procedure work for Windows 10 1809?
Hi Juan, we managed to get it working on Windows 10 1809. However, we had to make sure we were using agent 7.5.2 and had to hack the connection servers to get around a ‘getting stuck in customizing’ issue. There is a VMware article explaining how to do it. https://kb.vmware.com/s/article/67175
I generally run your clean up script at the end of any customising of the golden image – but 9 times out of ten, disk clean up gets stuck on temporary internet files. Instead, I use Storage Sense which is far quicker, but as of yet, this can’t be ran from the command line.
Hi Dave,
Thanks for sharing this valuable piece of information; readers working on new versions will appreciate it.
Cheers!
Awesome article!
Do you know if the issue in 6.2 has been updated or is there a location where additional information can be found on this issue. We are currently working on upgrading our VDI infrastructure from Windows 7 Pro to Windows 10 (1903)
Hi, sorry I couldn’t tell about the issue since I haven’t tested new versions of VMware and Windows 10.
Couple questions:
1) Do you leave the master image connected to the domain before taking the snapshot or do you remove it?
2) Curious why the ‘Administrator’ account has to be enabled and the ‘User’ account deleted. Could you not just leave the ‘User’ account?
BC
Valid questions.
1) Actually, is a good practice from VMware not joining the master image to the domain. This is certain in multi-domain environments. But I usually have issues with Horizon while deploying the desktop pool, so I leave the image joined.
2) The “user” account is just used to enable the “administrator” one. Better to have the administrator rights for the following steps, and is faster and safer than applying these rights to the “user”. This is not a must, but my point of view.
Do you use mandatory default profiles?
Hi, since it is a lab I use default profiles. For a production environment, it is a different thing. Several tools are available to handle profiles.
Thank you for putting everything in one place. Very useful guide. I also would like to know how to get mandatory profiles working, if anyone has a solution.