RDP wake-on-lan in LAN environment

How do you configure RDP to be able to wake-on-lan client computers?

Basically, I want to be able to wake-on-lan 1 or more computers at a time in our LAN environment.


Solution 1:

Remote Desktop does not have any built-in remote wake-up capability. You will need to first use Wake-On-Lan to wake up the sleeping computer, before you can RDP to it.

To enable WOL on your computer, the first step is to check the hardware :

  • Your network card must support Wake-on-LAN
  • Your power supply must support Wake-on-LAN
  • Wake-on-LAN must be enabled in BIOS
  • Your router must be configured to forward broadcast packets
  • Your OS must be configured to enable Wake-on-LAN

Enable WOL in BIOS (from boot)

The actual method depends on your motherboard. However, if no such option is found in the BIOS, it might be safe to assume that it will work by default.

Enable WOL for your Ethernet Card

Open Device Manager from the Control Panel, expand Network Adapters and find your Ethernet Card. Right-click and open Properties then go to the Advanced tab and enable "Wake on Magic Packet" or something similar.

image1

Install Windows Feature "Simple TCPIP services"

Open Programs and Features from the Control Panel, click "Turn Windows features on or off" on the sidebar, scroll down and check "Simple TCPIP services", then click OK to install the feature.

image2

Start Service "Simple TCP/IP Service" (enables ports 7 & 9)

Open Services from Administrative Tools in Control Panel, scroll down to the service, ensure the service is started and that its Startup Type is set to Automatic so that it will run with Windows.

image3

Open UDP for Port 9 in Windows Firewall

Open Windows Firewall from Control Panel. Only UDP is needed, but you can if you wish open the TCP port as well. UDP is a broadcast packet which can always be received by your NIC, whereas TCP requires the computer to be powered up.

image4

WOL software

Many such are available on the Internet, by command line like wolcmd or its matching Graphical Interface found here.

source

Solution 2:

If the machine is a Physical machine, then you first configure it's BIOS to allow wake-on-lan and just send it a WakeOnLan packet, using any other software (there are many free ones) and then separately RDP to it.

If on the other hand they are Virtual Machines, then you have a problem. WOL relies on the NIC to do the wake, and in a VM you have virtual NICs not physical ones. In that case, you are dependent on your virtualization tool to support the WOL, if it supports it and is enabled, then you will send a WOL packet, as if you are doing it to a physical machine.

Note: With the default windows RDP client, you cannot configure a script to run prior to the connection, only after. I suggest you package mstsc.exe to run inside a BAT script that sends the WOL packet, waits for a few minutes and then launches mstsc.exe (i.e. the RDP client).

How-to-guide assuming physical machines (OS doesn't matter): http://www.smallnetbuilder.com/lanwan/lanwan-howto/29941-how-to-wake-on-lan--wake-on-wan VMWare settings (one example, you need to search for your specific vendor and version): http://pubs.vmware.com/vsphere-50/index.jsp?topic=%2Fcom.vmware.vsphere.vm_admin.doc_50%2FGUID-35CD5E60-6FFA-47CE-A5CF-78B6D6B42CB8.html

Solution 3:

Using Wake On Pattern would seem to be the way to go for this. As long as Wake On Lan is enabled in the BIOS as well as in Windows.

I haven't done it myself, but I know that WOL can be done on Name Lookups as well as TCP SYN requests.
This Microsoft KB doco specifies as much also.

Assuming that you're connecting to an IP address and not a hostname, connecting to the IP should attempt to send a TCP Syn request to the computer, as long as the switch has not forgotten which IP address has that MAC address.

By default, Windows 7 should be setup to wake on either MagicPacket and PetternMatch. The latter is what will take care of waking on TCP Syn requests.
However, the NIC itself will need to support ARP & ND offload, or at least ARP offload.
If the NIC doesn't support that, then Magic Packet is the only way to wake up the computer.

In which case, you will need a utility to run before attempting to connect with RDP to the computer. Your network infrastructure may even have the ability to send Wake On Lan packets for you.