Deploying Windows 8 Virtual Desktop Infrastructure on Windows Server 2012
Several months ago, fellow blogger Kees Baggerman covered RDS: Windows 8 Scenario-based RDS deployment which included a 10 minute YouTube video on RDS Session Virtualization (aka terminal services). In this article, I am going to cover the other element of RDS scenario-based installation, Virtual Desktop Infrastructure. Microsoft VDI technologies have been around for several iterations of Hyper-V and Server 2008. With 2008 R2 SP1 Microsoft introduced RemoteFX, a promising technology for virtual desktop GPU acceleration. However, in the past there have been several challenges with deploying Microsoft VDI, namely the initial desktop provisioning and stateless pooling. With Server 2012, these two components have several promising enhancements.
First, Server 2012 now has a built-in provisioning mechanism whereby a powered down and SysPrep’d Hyper-V virtual machine can be used as a master desktop to provision collections of virtual desktops. This means that System Center Virtual Machine Manager is no longer a requirement or nicety for the initial provisioning of the systems. Additionally, this built-in provisioning mechanism uses VHD differencing disks, similar to the VMware linked clone and Citrix MCS disk chaining technologies. Second, Server 2012 now has a stateless pooling and reverting mechanism whereby changes to the virtual desktops are reverted upon logoff. This means pooled VDI desktops are no longer tainted by previously logged in users. To demonstrate these capabilities, let’s start by deploying a simple VDI infrastructure including three servers: a Connection Broker (CB01), a Web Access server (WA01), and a Virtualization Host (HV01). Each of these three systems consists of typical installations of Server 2012, joined to a single domain.
Nearly all Server Manager tasks will be done from the Connection Broker, so we will start by adding the additional servers from All Servers -> Manage -> Add Servers:
Search for the applicable servers, select them and click the arrow to add them to the selected list. Click OK to proceed:
Select Manage -> Add Roles and Features:
Click Next to the welcome screen:
Select Remote Desktop Services installation and click next:
Select Standard deployment and click next:
Select Virtual machine-based desktop deployment and click next:
Review the deployment overview and click next:
Select the connection broker (CB01). Click the arrow to move it to the selected list and click next:
Select the Web Access server (WA01). Click the arrow to move it to the selected list and click next:
Select the Virtualization Host (HV01). Click the arrow to move it to the selected list. Select Create a new virtual switch on the selected servers and click next:
Select Restart the destination server automatically if required and click deploy:
The progress bar will indicate how much time is required for installation:
Upon completion ensure all tasks succeeded and click close:
Next, we need to deploy a Windows 8 virtual desktop that will be used as our master image moving forward. Login to the Hyper-V server (HV01) and launch Hyper-V Manager. Right click the server in Hyper-V manager and select New -> Virtual Machine:
Name the virtual desktop and click next:
Assign an appropriate memory allocation, select use dynamic memory and click next:
Select the RDS Virtual network (Automatically created through the RDS wizard) and click Next:
Size the Virtual Hard Disk appropriately and click next:
Select the appropriate option for the Windows 8 installation media. In my case I have mounted the ISO to the D:\ drive of the Hyper-V host, which is where I will be installing from. Click next:
Review the summary and click Finish:
Right click the new VM and select Start:
Right click the new VM and select Connect:
The VM should boot to the installation media to start the Windows 8 install. Click Next:
Click install now:
Enter the appropriate license key provided with the Windows 8 Release Preview installation media:
Accept the license terms and click next:
Select the appropriate disk and click Next:
The installation may take some time to complete, dependent on storage performance:
Upon completion, the sysprep first run setup will ask for the PC name. Provide the VM name and click next:
Select Use express settings:
Select sign in without a Microsoft account:
Select Local account:
Enter an account and password and click finish:
At this point you would typically customize the Windows 8 virtual desktop to install you base application set and personalization. For the sake of this blog post, I am going to proceed with Sysprep’ing and shutting down the virtual machine for provisioning a collection of desktops. Click Desktop to exit metro:
Click Explorer and browse to C:\Windows\System32\Sysprep\. Launch Sysprep.exe:
Select Generalize and shutdown. Click OK:
Once the virtual desktop has shutdown it’s important that you detach the ISO or drive that was used for creating the virtual desktop. Otherwise, this will be carried with the virtual machine during the provisioning operations. Right click the Virtual Desktop and select Edit Settings. Select the DVD drive and pick none. Click OK to save the virtual machine:
In Server Manager on the Connection Broker (CB01) navigate to Remote Desktop Services -> Collections. Select Tasks in the top right and click Create Virtual Desktop Collection:
Review the welcome screen and click Next:
Enter a collection name and description. Be very specific when naming the collection as you cannot change this after the collection has been deployed. Click Next:
Select Pooled virtual desktop collection. Leave Automatically create and manage virtual desktops selected and click Next:
Select the virtual desktop we created previously and click next. If the desktop has not been sysprep’d you will receive a warning:
For this option you can optionally provide a sysprep inf file. For our simple deployment, I will select Provide unattend installation settings. Click next:
Select the Active Directory domain and Organizational Unit. Optionally, you can enter a distinguished name of the OU. Click next:
Enter the domain security group for access, number of desktops to provision, naming convention and click next:
If we had multiple hosts, the next screen would allow us to customize where the desktops are placed. Leave defaults and click next:
Leave store on each RD Virtualization Host selected for the simple deployment. Alternatively we could deploy the VMs on a highly available CIFS share or Cluster Shared Volume if we had multiple Hyper-V hosts. If you have higher performance storage available in the Hyper-V hosts, you can optionally redirect the template to a different drive (SSD for example). Leave Automatically roll back the virtual desktop selected for stateless pooling discussed earlier. Click Next:
For the simple deployment, I am not redirecting the user profile disks. In a production deployment we would likely redirect the user profile disks to a highly available CIFS share to eliminate the need for roaming profiles:
Review the collection summary and click Create to start the provisioning process:
In the first stage, the virtual desktop will be exported from the Hyper-V host:
This export is stored in C:\RDVirtualDesktopTemplate on the Connection Broker for deployment to additional hosts at a later time.
Next, the provisioning process moves into deploying the template back to the host and starting the VM deployments:
Unless you change the path during the initial deployment, the default storage location for the templates will be C:\ProgramData\Microsoft\Windows\RDVirtualizationHost:
The first and subsequent desktops will begin to deploy, using the Sysprep information provided in the wizard:
Typically at a speed of 3-6 minutes per desktop, the deployment process will eventually complete successfully. Click close to confirm the collection was created:
Now, by default the Server 2012 provisioning mechanism will perform serialized operations, not parallel. Therefore, if it takes 3-6 minutes per desktop, that’s anywhere from 15-30 minutes for a pool of 5 desktops. If you scale this up to 100 desktops, it can get pretty significant for the deployment time. This is where the Concurrency registry key comes into play. The concurrency registry key controls the number of simultaneous provisioning operations that are permitted on a host-by-host basis (max recommended value 5). To find this key on the HV01 host, I’ll open regedit and browse to HKLM\System\CurrentControlSet\Services\VmHostAgent\Parameters. In this key is a REG_DWORD value that can be set to a value between 1 and 5. Update! Now this value can be set using Set-RDVirtualDesktopConcurrency PowerShell CMDlet!
Changes to this key require a reboot of the host to apply, so I will increase the value to 5 and reboot. Now I will deploy an additional 5 virtual desktops and examine the results. From the connection broker, navigate to the newly deployed collection (Win8RP-VDI01). In the top right select Tasks -> Add Virtual Desktop:
Enter 5 and click next:
Confirm that all 5 will be created on the first and only host. Click next:
Now, in the Hyper-V Manager console, you’ll notice the desktops spinning up and provisioning all 5 at a time:
Now that we have a working desktop pool, let’s test access using the Web Access server. Open a browser and navigate to https://2012rc-wa01/RDWeb. Note, if this were a production deployment we would install Enterprise SSL certificates and create IIS Http Redirects so the /RDWeb would not need to be entered. After accepting the certificate error, login with appropriate credentials:
Launch the virtual desktop using the supplied icon:
Confirm that you want to connect Drives, Clipboard, etc.:
Upon connection, the user credentials provided will be seamlessly passed through to the virtual desktop:
Viola! We are now connected to a Windows 8 desktop via Server 2012 Virtual Desktop Infrastructure and RDS:
On the connection broker (CB01) the new session will be displayed in the Connections area in the bottom right:
Best of all, when I’m done tainting the virtual desktop, all user changes will be reverted as Hyper-V will revert to the saved state snapshot upon logoff.
If you have any questions, comments, or just want to leave feedback, please do so below. Thanks for reading!
If some could answer the following please: would it be possible to create a template for Win 8.1 with all the user applications install then sysprep? This to create pooled desktop base for all users.
Yes, this is absolutely possible.
Very Good Information, thanks, but i am facing a problem while creating virtual desktop collection.
Message is : Unable to retrieve the details of the Virtual Desktop collection
Could you please help me in this.
Thanks in Advance.
Awesome comprehensive guide. This helped me a lot. Thanx!
Thanks for this guide, it’s the most useful one I’ve found on this subject by far. I am wondering what changes I’d need to make in order to enable RemoteFX. I have a brand new Nivida K1 and want to try it out by so far keep running in to errors as far as actually using it as part of the VDI, which it is supposed to play with nicely, at least that’s what they say.
Feel free to e-mail me email@example.com if you want some consultative assistance with this. I have quite a bit of experience with NVIDIA K1/K2 cards and can point you in the right direction.
Does KMS for Windows 8 still require 25 activations before workstation clients will activate? I’m aware we’ll have to go with VDA licensing to achieve this since our Desktops are manufacturer loads without SA.
Yes it should still require 25 activations. Be sure to do Office via KMS as well.