Home Contact

The Frog Pond of Technology

Ripples of Knowledge for SharePoint and Other .Net Technologies

News

 Subscribe to this blog


About Me

Name:
Brian T. Jackett
Location:
Columbus, OH
Company:
Microsoft

Find me on...

Tag Cloud


Archives

Post Categories

Syndication:

How To Configure Remote Desktop To Hyper-V Guest Virtual Machines

<Update 6/7/2010 with feedback from Kelly Jones on network adapters />

    Configuring Remote Desktop (RDP) from a host Hyper-V machine to a guest virtual machine can be tricky, so this post is dedicated to the issues and resolution steps I went through to allow RDP.  Cutting to the point, below are the things to look for followed by some explanation about my scenario if you care to read.  This is not an exhaustive list of what is required, just the items that were causing problems for my particular scenario.

Requirements

  1. Allow Remote Desktop Connections in guest OS.
  2. The network adapter type must allow communication with host machine (e.g. use an “Internal” or “External” virtual adapter.)
  3. If running Server 2008 R2 on guest, network discovery mode must be turned on.
  4. If running Server 2008 R2 on guest, the services supporting network discovery mode must be running:

    - DNS Client

    - Function Discovery Resource Publication

    - SSDP Discovery

    - UPnP Device Host

My Environment

    A quick word about my environment.  I am running Windows Server 2008 R2 with Hyper V on my laptop and numerous guest VMs running Windows Server 2003 R2 or Windows Server 2008 R2.  I run a domain controller VM and then 1 or 2 SharePoint servers depending on my work needs.  I’ve found this setup to work well except when it comes to the display window for my VMs.

The Issue

    Ever since I began running Hyper-V I haven’t been able to RDP to my guest VMs which means the resolution for my connection windows ha been limited to what the native Hyper-V connections allow.  During personal use I can put the resolution up to 1152 x 864, but during presentations I am usually limited to a measly 800 x 600.  That is until today when I decided to fully investigate why I couldn’t connect via RDP.

    First a thank you to John Ross (@johnrossjr), Christina Wheeler (@cwheeler76) and Clayton Cobb (@warrtalon) for various suggestions while I was researching tonight.  As it turns out I had not 1, not 2, but 3 items preventing me from using RDP.  Let’s dig into the requirements above.

Allow RDP Connection

    This item I had previously taken care of, but it bears repeating because by default Windows Server 2008 R2 does not allow RDP connections.  Change the setting from “Don’t allow…” to whichever “Allow connections…” setting suits your needs.  I chose the less secure option as this is just my dev laptop.

ConfigureRDPHyperVGuest8

Network Adapter Type

    When I originally configured my VMs I configured each to use 2 network adapters: one using the physical ethernet adapter for internet use and a virtual private adapter for communication between the VMs.  The connection for the ethernet adapter is an "”External” adapter and (as my co-worker Kelly Jones pointed out in comments below) does allow connections between host and guest.  After he pointed this out though I realized that my ethernet adapter is not always reliably enabled (power cord not in disables NIC.)  As such I need a secondary adapter that will always be on to connect the host and guest.  The virtual private adapter I had allowed communication ONLY between the VMs and not to my host.  There is a third option “Internal” which allows communication between VMs as well as to the host.  After finding out this distinction I promptly created an Internal network adapter and assigned that to my VMs.

ConfigureRDPHyperVGuest1

Turn On Network Discovery

    Seems like a pretty common sense thing, but in order to allow remote desktop connections the target computer must able to be found by the source computer (explained here.)  One of the settings that controls if a computer can be found on the network is aptly named Network Discovery.  By default Windows Server 2008 R2 turns Network Discovery off for security purposes.  To enable it open up the Network and Sharing Center.  Click “Change Advanced Sharing Settings” on the left.  On the following screen select “Turn on network discovery” for the currently used profile and click Save Settings.  You may notice though that your selection to turn on network discovery doesn’t save.  If this is the case then you most likely don’t have the supporting services running (as was my case.) ConfigureRDPHyperVGuest4

ConfigureRDPHyperVGuest5

Network Discovery Supporting Services

    There are a total of 4 services (listed again below) that need to be running before you can turn on network discovery (explained here.)  The below images highlight these services.  In my guest VM I found that I had DNS Client already running while the other 3 were disabled.  I set them all to enabled and started the ones that were stopped.  After this change I returned to the Sharing settings screen and found that Network Discovery was turned on.  I’m not sure whether this was picking up my attempt to turn it on previously or if starting those services turned it on.  Either way the end result was a success.

- DNS Client

- Function Discovery Resource Publication

- SSDP Discovery

- UPnP Device Host

ConfigureRDPHyperVGuest2 ConfigureRDPHyperVGuest3

Before and After Results

    The first image is the smaller square shaped viewing window used by the Hyper-V native connection.  The second is the full-screen RDP connection in all its widescreen glory.

ConfigureRDPHyperVGuest6 ConfigureRDPHyperVGuest7

Conclusion

    Over the past few months I’ve found Hyper-V to be very useful for virtualizing my development environments, but I’ve also had a steep learning curve to get various items configured just right.  Allowing RDP connections to guest VMs was one area that I hadn’t been able to get right for the longest time.  Now that I resolved these issues I hope that others can avoid the pitfalls that I ran into.  If you know of any other items I left off feel free to let me know.

 

     -Frog Out

 

Links

Turning on Network Discovery

http://sqlblog.com/blogs/john_paul_cook/archive/2009/08/15/remote-desktop-connection-on-windows-server-2008-r2.aspx

Services required for Network Discovery

http://social.technet.microsoft.com/Forums/en-US/winservergen/thread/2e1fea01-3f2b-4c46-a631-a8db34ed4f84


Sunday, June 6, 2010 11:23 PM

Feedback

# re: How To Configure Remote Desktop To Hyper-V Guest Virtual Machines

Brian -- RDP does indeed work with "External" connections. Those connection types make the guest VMs appear just as any other machine on the network. (I just confirmed this setup on my server.) Maybe the IP address settings were wrong? You definitely need to allow RDP connections (your step #1).

I'm not sure about the rest of the settings you suggest. (They aren't ringing a bell with me tonight, like the network connection type did.) 6/6/2010 11:40 PM | Kelly D. Jones

# re: How To Configure Remote Desktop To Hyper-V Guest Virtual Machines

Kelly,

Thanks for the input. My mistake, you are correct that "External" network adapters allow communication to the host. Unfortunately my external network adapter is not always enabled due to a configuration that disables it when the power cord is removed. I've updated my post to reflect your correction. Thanks for responding so quickly. 6/7/2010 7:19 AM | Brian Jackett

# re: How To Configure Remote Desktop To Hyper-V Guest Virtual Machines

I've had troubles with this one for a while. Good thing that I found this post.
Good article. 3/16/2011 11:30 PM | The Anh Nguyen

# re: How To Configure Remote Desktop To Hyper-V Guest Virtual Machines

Install the Remote Server Administration Tools for your OS and you can use VMConnect.exe to get this same functionality. Makes it really easy. 11/3/2011 8:54 PM | James

# re: How To Configure Remote Desktop To Hyper-V Guest Virtual Machines

James,

Thanks for the input. I may try that out next time I get a chance.
11/4/2011 1:57 AM | Brian T. Jackett

# re: How To Configure Remote Desktop To Hyper-V Guest Virtual Machines

How does vmconnect address teh screen resolution issue ?? I tried to use it, but i cannot set the resolution to something useable on my laptop. Desired resolution is 1366 x 768

800 x 600 leaves me great big black lines down either side and anything bigger i get scroll bars

Luke 7/4/2012 9:10 PM | Luke

# re: How To Configure Remote Desktop To Hyper-V Guest Virtual Machines

Luke,

I now use a program called mRemote to connect to my VMs. This program has gone through a number of changes since I started using it but it works very well for managing multiple VMs, viewing in full screen mode, and storing credentials. Be sure that you can ping the guest VM from the host and you should be set to connect.

http://www.mremote.org/wiki/Default.aspx?Page=Downloads&AspxAutoDetectCookieSupport=1
7/9/2012 10:43 PM | Brian T. Jackett

# re: How To Configure Remote Desktop To Hyper-V Guest Virtual Machines

Great Post Brian! i was in the same boat as you described and finally i figured it out. Your post was of great help to me. 10/10/2012 6:17 PM | Sam Khan

# re: How To Configure Remote Desktop To Hyper-V Guest Virtual Machines

Very thanks. Me working and be usefull. 10/13/2012 7:44 AM | David

# re: How To Configure Remote Desktop To Hyper-V Guest Virtual Machines

I would like the RDP session to open as soon as the Hyper-V image will allow it.
Is there some kind of flag sent to the host that could trigger the RDP to open?
Currently, I am delaying the RDP by 10 minutes but that is a LONG time. 6/2/2014 11:51 AM | Troy

# re: How To Configure Remote Desktop To Hyper-V Guest Virtual Machines

Thanks for sharing this. It's much simpler than others found on the web and it works. Really appreciate it. 8/1/2014 12:55 AM | Edward Ng

# re: How To Configure Remote Desktop To Hyper-V Guest Virtual Machines

Awesome post! Where I'm struggling is with remote access TO my vm's. My environment has 5 guest OS installed, and I want 5 people (at 5 locations) to access the box, and each have access to their own VM. Any ideas? 8/16/2014 12:54 AM | christopher haag

Post A Comment
Title:
Name:
Email:
Comment:
Verification: