How to Set Up Virtual Desktop Infrastructure (VDI) on Windows Server 2012 R2

Virtual Desktop Infrastructure (VDI) provides each user with their own dedicated virtual machine desktop, as opposed to session-based desktops where multiple users share the same server OS instance. Windows Server 2012 R2 RDS supports two VDI models: Pooled Virtual Desktops (users get a desktop from a shared pool that resets to a clean state after logoff) and Personal Virtual Desktops (each user is permanently assigned their own VM and changes persist). This guide covers the installation and configuration of RDS VDI using Hyper-V as the virtualisation platform.

VDI Architecture Overview

A Windows Server 2012 R2 VDI deployment consists of:

  • RD Virtualisation Host: Hyper-V hosts that run the virtual desktop VMs
  • RD Connection Broker: Assigns VMs to users, tracks assignments, and manages the VM pool
  • RD Web Access: Provides the web portal for users to access their desktops
  • Virtual Desktop VMs: Windows 7/8.1 or Windows Server 2012 R2 VMs running on the RD Virtualisation Hosts
  • Master Image Template: A sysprepped parent VM from which pooled desktops are created

Prerequisites

  • Windows Server 2012 R2 servers with the Hyper-V role for RD Virtualisation Hosts
  • RD Connection Broker deployed and functional
  • Shared storage (SAN, iSCSI, or SMB 3.0) for VM storage in pool deployments
  • A licensed guest OS image for the virtual desktops (Windows 7 Enterprise, Windows 8.1 Enterprise, or Windows Server 2012 R2)
  • RDS VDA (Virtual Desktop Access) licensing if using Windows 7/8.1 as guest OS

Step 1 — Install the RD Virtualisation Host Role

The RD Virtualisation Host role is essentially the Hyper-V role with RDS integration. Install it on all servers that will host virtual desktop VMs:

Install-WindowsFeature -Name RDS-Virtualization -IncludeManagementTools -Restart

Add the RD Virtualisation Host to the RDS deployment:

Add-RDServer -Server "rdvh01.domain.com" -Role "RDS-Virtualization" -ConnectionBroker "rdcb.domain.com"

Step 2 — Create the Master VM Template

Create a base VM that will serve as the template for pooled desktops. This VM must be prepared with Sysprep before being used as a template:

# Create the template VM on the RD Virtualisation Host:
New-VM -ComputerName "rdvh01.domain.com" -Name "VDI-Template" -Generation 1 -MemoryStartupBytes 2GB -SwitchName "VMSwitch" -NewVHDPath "D:VDITemplatesVDI-Template.vhdx" -NewVHDSizeBytes 40GB -Path "D:VDITemplatesVDI-Template"

Install the guest OS (Windows 7 or 8.1), install applications, configure settings, install RDS Client (included in Windows), then run Sysprep:

# Run inside the template VM as administrator:
C:WindowsSystem32Sysprepsysprep.exe /generalize /oobe /shutdown

After Sysprep completes, the VM shuts down. Do NOT start the template VM again — it is now a generalized image ready to be cloned.

Step 3 — Create a VDI Collection (Pooled)

A Pooled Virtual Desktop Collection creates a set of VMs from the template. Each user gets a VM from the pool, and when they log off, the VM is automatically reverted to its clean state:

New-RDVirtualDesktopCollection -CollectionName "Pooled Desktops" -VirtualDesktopTemplateName "VDI-Template" -VirtualDesktopTemplateHostServer "rdvh01.domain.com" -VirtualDesktopAllocation @{"rdvh01.domain.com" = 20} -ConnectionBroker "rdcb.domain.com" -StorageType LocalStorage -VirtualDesktopPasswordAge 0

This creates 20 virtual desktop VMs on rdvh01.domain.com from the template. The Connection Broker manages the pool and assigns available VMs to users on demand.

Step 4 — Create a VDI Collection (Personal)

Personal Virtual Desktop Collections permanently assign each user to a specific VM. Changes persist between logons:

New-RDVirtualDesktopCollection -CollectionName "Personal Desktops" -PersonalUnmanaged -VirtualDesktopName "VDI-Personal" -ConnectionBroker "rdcb.domain.com"

After creating a personal collection, add individual VMs and assign them to users:

# Add existing VMs to the collection:
Add-RDVirtualDesktopToCollection -CollectionName "Personal Desktops" -VirtualDesktopName "PersonalVM-01" -VirtualDesktopHostServer "rdvh01.domain.com" -ConnectionBroker "rdcb.domain.com"

# Assign a VM to a specific user:
Set-RDPersonalVirtualDesktopAssignment -CollectionName "Personal Desktops" -VirtualDesktopName "PersonalVM-01" -UserUpn "[email protected]" -ConnectionBroker "rdcb.domain.com"

Step 5 — Configure User Profile Disks for VDI

For pooled desktops, User Profile Disks (UPDs) persist user profile data between sessions even though the VM resets. This provides a stateless VM with a stateful user experience:

Set-RDVirtualDesktopCollectionConfiguration -CollectionName "Pooled Desktops" -ConnectionBroker "rdcb.domain.com" -EnableUserProfileDisk $true -MaxUserProfileDiskSizeGB 10 -DiskPath "\fileserverUPD-Pooled"

Step 6 — Configure Patch Management for Pooled VMs

For pooled desktops, all VMs are clones of the template. To patch the pool:

  1. Update and patch the master template VM (requires re-running Sysprep)
  2. Update the collection to use the new template version
  3. Roll out the new template to the pool during an off-hours maintenance window
# Update the template for a pooled collection:
Update-RDVirtualDesktopCollection -CollectionName "Pooled Desktops" -ConnectionBroker "rdcb.domain.com"

Step 7 — Monitor VDI Collection Status

# View all virtual desktops in a collection:
Get-RDVirtualDesktop -CollectionName "Pooled Desktops" -ConnectionBroker "rdcb.domain.com" | Select-Object VirtualDesktopName, HostName, AssignedUserName, State | Format-Table -AutoSize

# Check user assignments for personal desktops:
Get-RDPersonalVirtualDesktopAssignment -CollectionName "Personal Desktops" -ConnectionBroker "rdcb.domain.com"

Step 8 — Configure User Access to VDI Collections

Set-RDVirtualDesktopCollectionConfiguration -CollectionName "Pooled Desktops" -ConnectionBroker "rdcb.domain.com" -UserGroup "DOMAINVDI-Users"

Summary

VDI on Windows Server 2012 R2 using RDS and Hyper-V provides a comprehensive platform for delivering personalised virtual desktops to users. Pooled desktops maximise server utilisation by reusing VMs while User Profile Disks maintain user personalisation. Personal desktops offer full OS-level persistence for power users with specialised application configurations. The integration between RD Connection Broker, RD Virtualisation Host, and Hyper-V makes VDI deployment and management accessible through standard Windows Server tools, without requiring additional third-party virtualisation management software.