Using Virtual Machine Connection and the Enhanced Session Mode in Windows Server 2012 R2

Introduction

Enhanced Session Mode supports redirecting local client resources when using Virtual Machine Connection to connect to a virtual machine. This is comparable to the functionality that a remote desktop connection provides when connecting to a physical or virtual machine.

Background

Virtual machines (VMs) do not provide a physical console that you can sit down at and interact with like a physical computer. Therefore, all interaction with a virtual machine is performed using a remote console. Windows Server 2012 R2 and earlier versions provide a dedicated client called Virtual Machine Connection (VMConnect) that provides a remote interface to the virtual machine. VMConnect allows you to connect to a Hyper-V host and redirect the remote desktop of any virtual machine to which you have access. VMConnect provides you with the ability to interact with a virtual machine from the BIOS and boot sequence through to the guest operating system and applications running in the virtual machine.

While previous versions of Hyper-V supported only the redirection of the screen, keyboard, mouse, along with a limited ability to copy text into a virtual machine, Windows Server 2012 R2 augments VMConnect with the ability to share more data and devices with a virtual machine through Enhanced Session Mode. For those familiar with RDP, Enhanced Session Mode brings similar functionality into VMConnect, but it uses the VMBus as the connection path. The VMBus is the synthetic device path between a Hyper-V host parent and child partitions. Using the VMBus eliminates the need for the host and virtual machine to be on a common network.

Some of the resources that are redirected through the Virtual Machine Connection Enhanced Session Mode include:

  • Copy and paste (i.e., text, graphical, files, and folders)
  • Audio     
  • Drive     
  • Printer     
  • Smart cards
  • USB devices     
  • Plug and Play devices
  • Display configuration

While this new functionality enables a richer data and device sharing model for remote interaction with virtual machines, it is important to note that Enhanced Session Mode currently supports only Windows Server 2012 R2 hosts and Windows Server 2012 R2, Windows 8.1 Pro, and Windows 8.1 Enterprise editions as guest operating systems in a virtual machine.

Enabling Virtual Machine Connection Enhanced Session Mode

By default, the Enhanced Session Mode functionality is disabled on Hyper-V hosts. In order to leverage the functionality of Enhanced Session Mode, Hyper-V host server and user settings must be properly configured, and Integration Services Guest Services must be enabled for the targeted virtual machines. Table 1 summarizes the steps needed to configure a Hyper-V host and enable Enhanced Session Mode.

Enable Enhanced Session Mode Policy

 

In Hyper-V Manager, open Hyper-V settings -> Server -> Enhanced Session Mode Policy to select Allow enhanced session mode (Figure 1)

Enable Enhanced Session Mode

In Hyper-V Manager, open Hyper-V settings -> User -> Enhanced Session Mode to select Use enhanced session mode (Figure 2)

Restart the Hyper-V Service

Select Stop Service in the Hyper-V Manager Action Pane (Figure 3)

Select Start Service in the Hyper-V Manager Action Pane (Figure 4)

 


Table 1: Enabling Enhanced Session Mode on a Hyper-V Host using Hyper-V Manager

As shown in Figure 1, when you configure Hyper-V to allow Enhanced Session Mode connections, it affects all of the virtual machines running on the host. However, only those virtual machines running a supported guest operating system will permit full redirection capabilities.

Image
Figure 1: Configuring Enhanced Session Mode Policy using Hyper-V Manager

While the Enhanced Session Mode policy controls Hyper-V host support, enabling the Enhanced Session Mode in the Hyper-V user settings (Figure 2) allows Virtual Machine Connection to make Enhanced Session Mode connections to virtual machines running on the host.

Image
Figure 2: Configuring Enhanced Session Mode for VMConnect using Hyper-V Manager

After you modify the Hyper-V Server and User settings, you have to restart the Hyper-V Service to apply the configuration changes. Figures 3 and 4 illustrate restarting a Hyper-V host using the Hyper-V Manager tool.

Image
Figure 3: Stopping the Hyper-V Service using Hyper-V Manager

Image
Figure 4: Starting the Hyper-V Service using Hyper-V Manager

After the Hyper-V host configuration is complete, it is still necessary to configure virtual machines to allow Enhanced Session Mode. Table 2 summarizes the configuration steps needed for each virtual machine to enable Enhanced Session Mode.

Enable Guest Services

In Hyper-V Manager, open VM settings -> Management -> Integration Services and select Guest services (Figure 5)

 

Start the VM

Start the virtual machine and wait for the boot process to complete

 

Remote Desktop Services

Ensure that Remote Desktop Services service is running

 

New capabilities are enabled

Copy/Paste, display resize, and supported devices should now be accessible through Virtual Machine Connection

Table 2: Enabling Guest Services in Virtual Machine Settings

Figure 5 shows how you can use Hyper-V Manager to select the Guest Services option of the Integration Services and allow Enhanced Session Mode connections to a specific virtual machine. After you boot the virtual machine, verify that the Remote Desktop Services service is running in the guest operating system. There is no requirement for an RDS Client Access License (CAL), nor is there a requirement for the Allow remote connections to this computer System Properties setting to be configured. The guest operating system must support Remote Desktop sessions, which limits the feature to Windows Server 2012 R2, Windows 8.1 Pro, and Windows 8.1 Enterprise editions. Windows 8.1 Home edition is not supported.

Image
Figure 5: Configuring a Virtual Machine Guest Services using Hyper-V Manager

Once all the configuration changes have been applied to the Hyper-V host and virtual machines, you should see the dialog box shown in Figures 6 and 7 when you connect to a virtual machine that supports Enhanced Service Mode. If you don’t see this dialog, verify that you are logging on with an account that is a member of the local administrators or remote desktop users groups in the guest operating system.

Image
Figure 6: Virtual Machine Connection Display Configuration Options

If you successfully connect to the virtual machine and see the dialog in Figure 6, you can select the display size for your virtual machine desktop, as well as save the settings for future connections to the virtual machine. The connection settings are saved in a file in the %appdata%\Microsoft\Windows\Hyper-V\Client\1.0. A separate file is created for each virtual machine connection using the following naming convention: vmconnect.rdp.{virtual machine GUID}.config.

Image
Figure 7: Virtual Machine Connection Local Resources Configuration Options

On the Local Resources tab of the dialog shown in Figure 8, you can configure redirection of audio playback and recording, and select the local devices and resources to redirect to the virtual machine. This includes smart cards, printers, drives, as well as existing and future plug and play devices.

Image
Figure 8: Virtual Machine Connection Local Resources Selection

Figure 9 shows that you can also toggle between a basic and Enhanced Session Mode connection using the Virtual Machine Connection View menu Enhanced Session option.

Image
Figure 9: Virtual Machine Connection Enhanced Session View Menu Option

Additional Configuration for USB Device Redirection

In order to implement USB device redirection through Virtual Machine Connection, you need to perform an additional configuration step. Using the Group Policy management tool on the client computer, enable the Allow RDP redirection of other supported RemoteFX USB devices from computer group policy. You can find this policy under Administrative Templates->Windows Components->Remote Desktop Services->RemoteFX USB Device Redirection. After enabling the policy, use the GPUPDATE /FORCE command to apply this change on the client, and then reboot it. Figure 10 shows the Local Resources dialog for a virtual machine for which USB device redirection has been enabled.

Image
Figure 10: Virtual Machine Connection Local Resources Dialog with USB Redirection

Conclusion

The Virtual Machine Connection Enhanced Session Mode provides new functionality to share and redirect client resources to a virtual machine much like using RDP connections. However, the main advantage of using Enhanced Session Mode is that it does not require a network connection since it uses the VMBus connection path. Enhanced Session Mode supports many new scenarios for environments that utilize virtual machines and that need access to local client resources. A few of these scenarios include printing to a local printer from a virtual machine, using smart cards to log into a virtual machine, and USB redirection of client devices to test functionality from within a virtual machine.

About The Author

1 thought on “Using Virtual Machine Connection and the Enhanced Session Mode in Windows Server 2012 R2”

  1. This article “Using Virtual Machine Connection and the Enhanced Session Mode” was very helpful
    Thanks!!

Leave a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top