Excel Out of Disk or Memory when using Remote Desktop

I’ve been doing a lot of working lately with running Remote Desktop Service (RDS) in Azure and have been fairly frequent errors relating to Excel, one of the applications we are publishing. This error would manifest as an error when launching Excel which seemed to indicate that Excel had run out of memory or disk space.

After investigating memory and disk usage to no avail, all looked fine, I stumbled upon the answer, user profile disks.

We are using a feature of RDS called user profile disks which allows you to store the users profile in a VHD so that it moves around with them as they change session hosts, without the need to implement roaming profiles etc. What we discovered was that there were some underlying issues with the file server that meant that sometimes the UPDs would get disconnected from the users session, this in turn would mean the users app data folder would not be available, and when Excel tried to write to that it would fail and get this error.

The error that led us to discover this was on the session host servers in the “TerminalService-RemoteConnectionManager” event log, which is under “Application and Service Logs\Microsoft\Windows”. We were seeing errors similar to the below:

Remote Desktop Services could not attach a user profile disk for a user account with a SID of . The error code is 0x21.135

Remote Desktop Services could not detach a user profile disk for a user account with a SID of . The error code is 0x21.135

Once we dealt with the issue with the stability of the file server, these went away and we didn’t see a repeat of the file server error.