In this article we will look at a connection problem for migrated virtual machines in Windows Server 2012/2012 R2 VDI.
The scenario is a new Windows Server 2012 R2 VDI deployment, where a a new collection is created for personal unmanaged Windows 7 virtual machines. These machines was migrated from an existing Windows Server 2008 R2 VDI deployment.
The problem occurred when launching the Remote Desktop shortcut for the VDI collection Remote Desktop Web Access. The progress bar stays on the “Loading the virtual machine” status for 1-2 minutes, and will eventually time out with the message “Your computer can’t connect to the remote computer because an error occurred on the remote computer that you want to connect to”. On the server side the message “Remote Desktop Services has taken too long to complete the client connection” is logged in the “Microsoft-Windows-TerminalServices-RemoteConnectionManager/Admin” event log:
A different VDI collection for new Windows 8.1 virtual machines was also setup, and they did not have this problem.
On the Hyper-V servers hosting the VDI virtual machines, the Remote Desktop Virtualization Host server role is installed in order to orchestrate and integrate with the Remote Desktop Connection broker. When installed the “Remote Desktop Virtualization Host Agent” service is present:
This service logs activity in the Microsoft-Windows-TerminalServices-TSV-VmHostAgent/Operational event log, and we could see the following message when the Windows 8.1 virtual machines was logged on to:
However, for the Windows 7 virtual machines we did not see any activity in this event log.
The Hyper-V Integration Services was upgraded to the Windows Server 2012 R2 version on the problematic virtual machines, and we could not see any problems in the Device Manager:
At this point, we found the following KB-article which led us to the solution:
The article states:
The problem occurs because Windows Server 2012 VDI virtual machines add a Remote Desktop Virtualization (RDV) device that does not exist in virtual machines that are not created by using Windows Server 2012. Without this device, the VDI RDP client cannot connect to the virtual machines, and the connections hangs.
To work around this problem, re-create the virtual machines in Windows Server 2012 and copy over the Virtual Hard Disk (VHD) instead of exporting and importing the virtual machines.
After re-creating one virtual machine for testing purposes, the following new device was found in the Device Manager:
The remote desktop connection to the virtual machine also worked without issues.
In summary: When migrating virtual machines from pre-Windows Server 2012 VDI environments, you should not import the virtual machines in the new environment. They should be re-created and attached to the virtual hard disks copied from the old environment. The Hyper-V Integration Services should also be upgraded to the latest version, if not the migrated virtual machines won`t have drivers for the new virtual devices such as the “Microsoft Hyper-V Remote Desktop Virtualization” device needed for VDI:
At the end, I would also like to mention two other articles which provides information about issues you might run into when configuring Windows Server 2012/2012 R2 VDI environments:
- Terminal Services client connection error 0xC000035B when you use LmCompatibility – you might run into this problem when using Remote Desktop Gateway
- VDI VMs deployed through RDS do not appear in the VMM 2012 console – you might run into this problem when using System Center Virtual Machine Manager to administer the Hyper-V hosts dedicated to VDI