Omnissa Horizon Client prefs.txt
There’s not a lot of official information about the prefs.txt
file that the Omnissa Horizon client (formerly the VMware Horizon client) creates and uses.
I’ve figured out that the prefs.txt
text file is in XML format and is generated by the Horizon client, usually once the user changes a setting in the Horizon client. It seems that prefs.txt
is used to store all the user settings that the user has configured within the Horizon client.
Here’s an example of the contents of a prefs.txt
file.
<?xml version="1.0" encoding="utf-8"?>
<Root>
<RecentServer serverName="horizon.company.com" isSyncShortcutsEnabled="false">
<SecondaryServerList />
<ShortCuts />
<FileRedirection>
<AppExtensionInfo AppId="cn=microsoft_edge,ou=applications,dc=vdi,dc=vmware,dc=int" AppName="Microsoft Edge">
<Extension Name="htm" Display-name="Microsoft Edge HTML Document" />
<Extension Name="html" Display-name="Microsoft Edge HTML Document" />
<Extension Name="mht" Display-name="Microsoft Edge MHT Document" />
<Extension Name="mhtml" Display-name="Microsoft Edge MHT Document" />
<Extension Name="pdf" Display-name="Microsoft Edge PDF Document" />
<Extension Name="shtml" Display-name="Microsoft Edge HTML Document" />
<Extension Name="svg" Display-name="Microsoft Edge HTML Document" />
<Extension Name="webp" Display-name="Microsoft Edge HTML Document" />
<Extension Name="xht" Display-name="Microsoft Edge HTML Document" />
<Extension Name="xhtml" Display-name="Microsoft Edge HTML Document" />
<Extension Name="xml" Display-name="Microsoft Edge HTML Document" />
</AppExtensionInfo>
</FileRedirection>
<RecentDesktop desktopID="cn=vdis,ou=applications,dc=vdi,dc=vmware,dc=int" autoSyncToggleKeysMode="7">
<LastDisplaySize displaySize="Fullscreen" height="0" width="0">
<SelectedMonitors />
</LastDisplaySize>
</RecentDesktop>
</RecentServer>
<DataSharingSettings Allowed="1" />
<BlastSettings allowClientH264YUV444="true" allowClientHEVCYUV444="true" allowClientHDR="true" DisableDisplayNetworkState="false" DisableDisplayNetworkStateManually="true" />
<BrokerJumpList>
<BrokerJump BrokerName="horizon.company.com" BrokerArguments="horizon-client://horizon.company.com/" />
</BrokerJumpList>
<AutoCheckForUpdate autoCheckForUpdate="false" />
<sharingList allowAccessRemovable="true" shareHomeDirectory="true">
<sharingItem from="C:\Users\daniel" />
<sharingItem from="T:\" />
</sharingList>
<GeolocationSharingSettings GeoSharingAllowed="true" />
<WebrtcSettings WebrtcScreenSharePerm="1" enableWebRTCRedirection="true" WebrtcSuppressScreenSharePrompt="true" />
</Root>
Code language: HTML, XML (xml)
The prefs.txt
file is stored in the user’s AppData Roaming folder.
The file will be in the following locations depending on which version of the Horizon client you use.
- For Horizon clients version 2412 or newer, it is stored in
%AppData%\Omnissa\Omnissa Horizon Client
- For Horizon clients older than version 2412, it is stored in
%AppData%\VMware\VMware Horizon View Client
Horizon-Prefs Script
Because the contents of the prefs.txt
file are predictable, I created a script called Horizon-Prefs. You can find the script on my GitHub https://github.com/thedxt/Omnissa#horizon-prefsps1. The Horizon-Prefs script can place the prefs.txt
file in the correct location for all users, just a single user, or both.
I’ve used my script to deploy the prefs.txt
file to systems to configure some Horizon client settings that don’t have GPO options. I’ve also used it to configure Horizon client settings on systems that aren’t joined to a domain.
To use the script, you need to create the prefs.txt
file using a source system. Once you have the settings the way you want, you encode the prefs.txt
to Base64 (my blog post, Base64 covers how to do this).
For example, if you wanted to preload a horizon connection server, you would have a prefs.txt
file that looks like this
<?xml version="1.0" encoding="utf-8"?>
<Root>
<RecentServer serverName="horizon.company.com"></RecentServer>
</Root>
Code language: HTML, XML (xml)
When you Base64 encode that, you end up with the following string
PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPFJvb3Q+CiAgPFJlY2VudFNlcnZlciBzZXJ2ZXJOYW1lPSJob3Jpem9uLmNvbXBhbnkuY29tIj48L1JlY2VudFNlcnZlcj4KPC9Sb290Pg==
Code language: plaintext (plaintext)
Here’s a link to a CyberChef recipe that will decode the Base64 above.
Using a Base64 string you can deploy the prefs.txt
file to all users on a system by using the function called Set-Horizon-prefs-AllUsers
You also need to define the output location of the prefs.txt
file.
- For Horizon clients version 2412 or newer, the location is
\AppData\Roaming\Omnissa\Omnissa Horizon Client
- For Horizon clients older than version 2412, the location is
\AppData\Roaming\VMware\VMware Horizon View Client
The Set-Horizon-prefs-AllUsers
function will enumerate all users found in C:\Users
. The script ignores the Administrator, Public, and Default users. From the list of users, the script will then check if the output location for the Horizon prefs.txt
file exists. If it does not exist, the script will create the necessary folders and place the prefs.txt
file. If the folders already exist, the script will put the prefs.txt
file in the folder.
To output the prefs.txt
file, the script uses another function called Put-Base64
. This function takes a Base64 encoded string and outputs it as a file. In this case, it is outputted as the prefs.txt
file.
Another function in the script is called Set-Horizon-prefs-SingleUser
. This function is great for deploying the prefs.txt
file for just one user. I use this function to put the prefs.txt
in the default user profile so all new user logins to that system also get the prefs.txt
file. For more information about the default user profile, my blog post, Windows Default User Profile, goes into more detail.
When you run the script, you’ll get an output similar to the image below.
If a user’s profile already has an existing prefs.txt
file, the script will replace it.
The only documentation I found is that the prefs.txt
file is briefly mentioned in the Configuration File Locations documentation about Securing the Horizon client. You can read that here.
Leave a comment