When a user logs into Windows for the first time, a lot of things need to happen. The computer checks GPO’s for the current user, HKCU is created, folder redirection is applied, and settings are initialized. When using VDI, this whole process is a waste because as soon as the user logs out, everything is wiped from that virtual machine anyway (unless persistent disk is enabled). I was looking to cut down on my initial logon time for users, and did the following things.
First, I removed any GPO’s that had to do with software installation. Instead of using GPO’s for software installations, I just installed the required software into my golden master image. This greatly reduces GPO processing time and frees up CPU cycles on the VM.
Next, I decided that using folder redirection isn’t needed in a VDI environment since it takes a long time to process each logon when new files need to be written to a VM over and over at each logon event. To get rid of this, I needed to make a “master profile” in windows, and make sure that it’s applied to every user that logs into this computer/VM. The main drawback of doing this, is that whenever a change needs to be made, like a new desktop icon, or new favorite for IE, etc, you have to go through this whole process again. For me, these changes don’t happen too often, and it won’t be a huge deal.
Here’s what I had to do:
- Create two local users. One will be an “Admin” user, and the other will be the “Template” user that we want to replicate to everyone. Log in with the Template user.
- Make any changes that you want everyone to see when they login as that user. It will be like a cached user profile. Examples: Place desktop icons, add favorites to IE, change windows settings, etc.
- Once your changes are made, reboot the VM. You need to reboot in order for the Template hive to be fully unloaded.
- Log on with the Admin account.
- Open the registry editor and change the following value to match your Template users profile:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\DefaultChange %SystemDrive%\Users\Default to %SystemDrive%\Users\Template.
- Open Computer Advanced Properties, and navigate to User Profiles.
- Select the Default profile, and choose “Copy to”. Select %SystemDrive%\Users\Default as the destination and select “Everyone” as the permitted user to the profile.
- Change the registry value back to %SystemDrive%\Users\Default
- Shut down the machine and create a snapshot.
At this point, you can login with a domain account and test the speed. I was able to get my initial logon time down to around 10-12 seconds.