User Profile Disks on Windows Server 2012 R2 / 2016 RDS

User Profile Disks (UPD) is a new feature of Remote Desktop Services in Windows Server 2012. User Profile Disks is an alternative to roaming profiles and folder redirection in the RDS scenarios. The point of UPD is that user and apps data (i. e., a user profile) are stored as a separate VHDX disk on dedicated file on the network shared folder. This virtual disk is mounted to the user session as soon as the user signs in to the RDS server, and unmounted when he logs out (all changes to the user profile are saved to the vhdx disk).

In this article, we’ll describe how to configure and use User Profile Disks on a server with Remote Desktop Services role running on Windows Server 2012 / 2012 R2 / 2016.

Configuring User Profile Disks on Windows Server RDS

First of all, it is necessary to create a shared folder on any corporate file server to store user profiles as VHDX disk (if you want to have high availability for UPD disks, you can place UPD files on a clustered file resource). In our example, the path to this folder looks like this: \\rdvh1\DemoLabOficeApp. Servers being a part of RDS collection have to be given full access permission to access this shared folder.

Tip. In a single RDS collection, there can exist only one VHDX profile file for one user. If a user connects to the resources from two different collections, a separate profile disk should be created for each of them.

User Profile Disks mode can be enabled and configured in the collection settings of Remote Desktop Services. This mode can be enabled when creating a new collection, or you can come back to it later.

In our example, the collection already exists, so in the Server Manager console, select this collection and in the upper left corner click Tasks -> Edit Properties.

Then in User Profile Disks section check Enable user profile disks, specify the path to the previously created shared folder (\\rdvh1\DemoLabOficeApps) and a maximum profile disk size (let it be 20 GB). Save the changes.

After you saved the changes, make sure that NTFS permissions for Profile Disks folder have been changed. In our case, the collection consists of one RDSH01 server, which is granted full control permission.

Full Control permissions has been granted to the RDSH01 server on the shared folder level.

When adding new RD Session Host servers to the RDS collection, the wizard automatically changes the folder permissions and gives access to the new servers. It is very convenient, since when scaling a terminal farm you don’t need to remember to set permissions for the profile folder.

UPD: User profile as VHDX file

Go to the network shared folder with user profiles. A UVHD-template.vhdx file is now being stored here.

This file is the user profile disk template. When a user logs on to the RDS server for the first time, this template is copied and renamed as a VHDX file, containing user SID in its name.

Tip. To match an UPD file name with the user name, you must use a separate script. For example, ShowUPDFolderDetails.ps1 or you can convert the SID to an account name by using the Get-ADUser cmdlet:

Get-ADUser -Identity S-1-5-21-32549751-3956249758-2943215497-23733695

Let’s see what a user profile disk contains. To do it, right-click the VHDX file and select Mount. The UPD disk can only be used in one session on one RDS host (exclusive access). You can’t mount an UPD VHDX disk if the user is currently using it on the RDS server.

As you can see, the VHDX disk contains a set of folders and files of a standard user profile. At logon, a user gets completely transparent access to the data stored in the profile.

On the side of RD Session Host server, a .vhdx user’s file is mounted to the C:\users\<username> and looks like this:

Note that the UPD drive is bound to the RDS server Windows OS version. You can’t transfer (use) an UPD user profile from an RDS server from one version of Windows Server to another.

Data is written to the vhdx file in real time. It means that when copying data to a user profile on an RDS server, the size of the vhdx file on the shared storage is incremented immediately.

If the user profile folder already exists in the system, the folder with an old profile is renamed to the <username>-BACKUP-<number>.

The VHDX disk is mounted when the user session starts on a VDI or RDS server. A list of connected UPD disks with profiles can be listed using the mountvol utility.

By default, a User Profile Disk contains all the user profile contents. However, you can exclude certain folders from the list of synchronized directories in the RDS collection settings, or specify that only certain folders should be saved. Thus, all the changes made during the user’s terminal session to the folders in the list of excluded directories are not saved into the VHDX disk on the shared folder.

The second option allows you to configure the saving only the specified directories in the UPD profile.

If necessary, the last option allows you to implement the scenarios for saving the settings of the Start Screen, which are stored in appsfolder.itemdata-ms file. In this example, we have only added the path to \AppData\Local\Microsoft\Windows folder as an additional path to be saved in the UPD.

Resizing User Profile Disks Using PowerShell

You can extend the virtual vhdx drive with the user’s UPD profile using the PowerShell cmdlet Resize-VirtualDisk from the Hyper-V module.

So, we have discussed the major peculiarities of User Profile Disks in RDS/VDI solutions running Windows Server 2016 and 2012 R2. UPD configuration is much easier than the configuration of roaming profiles or redirected folders. The disks are connected to the RDS collection and can’t be damaged when using the shared profile by several servers (unlike the standard profiles). The User Profile Disks can be stored in SMB shares, CSV, SOFS, SAN or on the local disks. Also, Microsoft notes that the speed of loading the user’s desktop environment in case of using UPD is reduced.

If you are planning to store UPD profiles on DFS servers, be aware that they must have Windows Server 2012 R2 installed. If you are using previous versions of Windows Server, you will get an error:

Unable to enable user disks on rVHDShare. Could not create template VHD. Error Message: The network location "\\woshub.com\namespace\UserProfileDisk" is not available.

Also it is desirable to use the version SMB 3.02 on the file server side (Windows Server 2012 R2) or higher.

Anyway, since User Profile Disks is a relatively new technology, prior to mass UPD implementations, it is recommended to test their work and possible problems in a test environment.

7 comments

Can we delete all VHDX files ? It is occupying arround 18 GB of space. please suggest. Thanks

Reply

SilverAugust 22, 2016 - 9:28 am

If these vhdx files are not used , of course you can delete them. If you are not sure – rename files and look at the operation of the system.

Reply

MarcSeptember 29, 2016 - 11:36 am

We are implementing VDI currently and we only have a couple of users on a pooled desktop using VDI with UPDs. Someone of these user will sometimes get logged in with a temporary profile. This is extremely problematic. I have searched everywhere and cannot figure out why this is happening. Even on the data server where the UPDs are stored, it shows them having a connected to the UPD and all folder redirects are working but the settings that they change that are saved in the UPD are not coming through. Any tips on how to solve this issue??

Reply

adminSeptember 30, 2016 - 5:04 am

Do you use Round Robin DNS with farm name on each host in RDS farm? This is wrong for server 2012. Try to create an A record with the farm name in DNS, which then refers to the broker address/ On the broker server create a registry entry: Path: HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\Cluster Settings Type: REG_SZ Value for desktop collection: TSV: // MS Terminal Services Plugin.1.Name Value For VDI: TSV: //VMResource.1.Name

Reply

MarcDecember 7, 2016 - 3:07 pm

No we do not use a Farm, these are Virtual Desktops.

We are using the RD Virtualization Host Method with a MasterImage to create each user their own VM. Not the RD session Host Method that you are referring to. So your fix for the Registry does not apply.

Reply

LukeJuly 19, 2018 - 8:54 am

Are UPS disks required? If we’re happy with pure folder redirection to their respective servers…?