Wednesday, March 26, 2014

SOLVED: Making Wake-on-Lan (WOL) work in Windows 10 / 8.x

THIS FIX ALSO APPLIES TO WINDOWS 10, IT IS EVEN MORE IMPORTANT,  BECAUSE WINDOWS 10 TURNS "FAST STARTUP" (read below) BACK ON AFTER UPDATES (yes, Microsoft does not stop creating nonsense features / bugs).
HKLM\System\CurrentControlSet\Control\Session Manager\Power\HiberbootEnabled
and set its value to 0 !

I had very serious problems getting Wake-On-Lan (WOL) to work on my new Dell Optiplex 9020 MT (MiniTower) on Windows 8.1 Pro. I finally got this to work and would like to share my experience here.

Note: At the time of this writing the current Dell BIOS for Optiplex 9020 MT was A05.
UPDATE: The same behavior is also observed with DELL BIOS A07. Maybe Dell needs to comply with some power saving requirements and therefore enables Deep Sleep instead of Wake-On-LAN? Whatever the reason is, it is extremely annoying that this is the default and it is not clearly documented.
Note: I am using UEFI and Secure Boot.

UPDATE February 2017:  Besides the fix described here it might happen that you experience strange problems with your Dells like NOT waking up on WOL or the other way round - "MAGICALLY" waking up randomly for no reason (you see things in Windows log like "firmware" as start reason) - in both cases I recommend updating to latest Intel network drivers (the Dell drivers are often outdated). I don't know what is gouing on there with Dell hardware vs Microsoft vs Intel issues but it has become a nightmare to get simple things to work reliably these days...

WOL vs Dell Optiplex 9020

In Dells forums people recommended to downgrade the Dell BIOS or even to get their mainboard changed to get WOL to work:

I don't like doing such things because newer BIOS also has other bugs fixed and downgrading may even break something.

So I decided to look for a better solution. Actually nowadays things don't get easier but more and more complex as we will see...

How to test WOL?

First I downloaded a nice little utility and installed it on another PC to be able to send WOL wake-up packets to my Dell PC. It is called WinWOL is free and I found it here:

Of course you can also use another WOL packed sending utility.

1. Enable Wake on Lan in the BIOS

So the first step is to make sure your BIOS is set correctly:

1. The obvious WOL setting in BIOS is under Power Management > Wake on LAN. You have to enable it by setting it to LAN Only for example.

2. The not so obvious setting is under Power Management > Deep Sleep Control. You must set this to Disabled, otherwise WOL will just not work.

2. Enable Wake on Lan in the Network Adapter Settings

Now in Windows go to the Device Manager > Network Adapter > Intel Ethernet Connection I217-LM, in my case.
Open the adapter settings and go to the Power Management tab
Make sure that all Wake on LAN options are enabled. I actually did not change any other energy settings on this tab, only activated the WOL options.

These settings should already make it possible to use wake on LAN in sleep and hibernate modes (BTW: hibernate mode must be explicitly enabled in Windows 8 (some of Microsoft's "brilliant" developers decided to do so).

What about WOL after shutdown?

The problem that actually caused all my headaches was the fact that I tested WOL after shutting down the PC from Windows. My PC just did not wake up after a normal Windows shutdown.

Normally, in a corporate environment you can't expect your users to put their PCs in sleep or hibernate only - they will also shut them down if they like. And shutdown definitely did not work with the WOL settings above alone.

Then I noticed the following: To have at least a chance that Wake-on-Lan will work you must make sure that the some lights are still on on your Dell's network adapter while attempting to wake up the PC via LAN.

But there was a problem: After a Windows shutdown of the PC all network card lights were OFF! Then I found out one more thing: If I switch on my Dell through the power button and then turn it off immediately (before Windows boots up) the network adapter lights are still ON - this means that WOL is possible! But after a Windows shutdown they stay OFF. So WOL is not possible.

So to me the situation was clear: Something in Windows shutdown makes my Dell turn off the network adapter completely, although WOL is enabled in  BIOS and in the Windows network adapter settings.

Microsoft did it again! Shutdown in Window 8 is "hybrid" and explicitly does not allow WOL!

After googling a lot I finally found an official Microsoft article describing that WOL behavior has changed in Windows 8 / 8.1:

In Windows 8 and Windows 8.1, the default shutdown behavior puts the system into the hybrid shutdown state (S4), and all devices are put into D3. WOL from S4 or S5 is unsupported. Network adapters are explicitly not armed for WOL in either S5 or S4 cases because users expect zero power consumption and battery drain in the shutdown state. This behavior removes the possibility of invalid wake-ups when an explicit shutdown is requested. Therefore, WOL is supported only from sleep (S3) or hibernation (S4) states in Windows 8 and 8.1.

So WOL is explicitly disabled in shutdown in Windows 8 and 8.1. It is nice to hear that this is expected by Microsofts "brilliant" developers (they seem to expect a lot in Windows 8.x ...) but what I expect is WOL to work in a corporate environment and not to turn it off just because someone decided to save battery, especially on a desktop workstation (!) in this case.

WOL and Hybrid Shutdown in Windows 8.x

Hybrid shutdown for faster startups

Another strange thing is that this Windows 8.x WOL behavior seems to be related to hybrid shutdown which MS describes as follows:

In Windows 8 and 8.1, hybrid shutdown (S4) stops user sessions but lets the contents of kernel sessions be written to the hard disk. This enables faster startups.

Why are faster startups related to Wake-on-LAN?

I don't know - ask Microsoft and their "brilliant" engineers!

Disable fast startups and get WOL to work!

So according to Microsofts article you can disable fast startups = hybrid sleep as follows (of course not recommended, bla bla bla ...):

To disable the S4 state in Windows 8 and 8.1, follow these steps.

Note We do not recommend that you disable the hybrid shutdown (S4) state.

  1. In Control Panel, open the Power Options item.
  2. Click the Choose what the power buttons do link.
  3. Clear the Turn on fast startup (recommended) check box.
  4. Click Save Settings.
Another important annoying fact: If it seems that you cannot just change the power button settings but you need to first click on the text saying something like: "Some settings are currently not available..."  Again, very "user friendly", Microsoft...

It works!

The most amazing thing is that disabling the fast startup setting above really makes WOL work after Windows shutdown. Now if I shutdown my Dell from Windows 8.1 it leaves the network adapter powered, i.e. the green LED is lit and the orange LED is blinking. Sending a magic packet to the Dell wakes it up.

So it looks like this stupid WOL behavior is expected and wanted by Microsoft! So I am not sure if Dell will ever give us a BIOS update that will change it.

IMHO one thing is certain:

It has never been harder to get Wake-on-LAN to work!

I hope this helps! Again, thank Microsoft for wasting our time and making our life as hard as possible. In Windows 8.x everything illogical is possible! Expect the unexpected! Expect surprises everywhere!


Tuesday, March 18, 2014

Domain Controller on top of Hyper-V - Firewall problem

The problem:

I have:

1. A single physical server which is a Hyper-V host running Windows Server 2012 R2.
2. A single Windows Server 2012 R2 Essentials Guest VM running on top and acting as a domain controller.

Now I have researched a lot whether I should join the host to the domain running on top of it or leave it in a separate workgroup. There is no best practice but many sources confirm that this is possible and joining the domain offers many management benefits, e.g. here see Option #4:

Now the problem is that after having joined the host to the domain sometimes everything works fine and the host manages to join the domain on startup but sometimes this seems to fail - I think that the join process times out as the DC in the Guest VM does not start up in time. In this case the firewall tells me that the host is connected to a "public network" instead of the "domain network" and I cannot connect to the server via remote desktop as this is not allowed by default. If I disable and reenable the network adapter the "domain network" is recognized fine but this has to be done manually.

The solution:

In the meantime I am pretty sure that I solved the problem:

On my host I had entered two DNS servers: The first was the IP of the Server Essentials Guest VM and the second was Google's DNS server (; my idea was to have access to the internet even if my Guest VM DNS does not run.

Now I am pretty sure that this second DNS server confused the firewall configuration on startup - it could not detect the primary DNS because the Guest still has not started up, but then saw this second DNS server and fell back to "public network" instead of the desired "domain network" mode. After removing Google's DNS server from the IP v4 configuration now the host seems to start up fine and always ends up in the "domain network".

Delayed domain join?

I really like the idea to delay domain joining on start up but I have not found a way to do this. I only found how to add longer timeouts but this is not really solving all problems:

Any hints on completely delaying domain join on startup are welcome.


Friday, March 14, 2014

How do client PC backups work in Windows Server 2012 R2 Essentials?

The problem:

I was trying to get my Server 2012 R2 Essentials (Hyper-V VM) to do nightly backups of my Win 8.1 client PCs. As far as I had understood from the Microsoft presentations the server should be able to wake up the clients automatically from hibernate (I selected this option during setup of the connector). Unfortunately, Microsoft does not care about providing serious docs for their Windows / Server products. What is really annoying is that I don't even find any documentation how the wake up procedure actually works. Does it use Wake On Lan? Are there any magic packets involved? You pay a lot and get something that either does not work or does not tell you how it works.

What I had tested so far: I had setup the server to start client backups at lets say 10:00. So at 9:50 I put my client computer in hibernate and wait and wait ... but nothing happens. It is very sad to have to guess and wait multiple hours or days to see if backup actually works on a server system. I still don't know if the server uses wake on lan or sets some timer on the client computer to wake it up. If I know it uses WoL I will also check my BIOS and network adapters. But this is a nightmare how a server OS is sold without any serious docs.

The solution:

Finally I found a very nice YouTube video that explains in details how the whole process works:

According to the video, the server simply schedules a task on the client PCs at some time in the range defined on the server: E.g. if I enter 11:00 - 12:00 this task seems to set a random wake-up time at e.g. 11:25 on the client PC. This task is then scheduled to wake up the PC - didn't know that this is possible.

It seems to work now. As discussed above the clients are woken up by the task set by the server in the task scheduler. This works in hibernate mode, not in shutdown. Still wondering how the server exactly schedules backups as it does not know how long a client backup will take and therefore does not know when to schedule the next PC...

In each case I am still very very disappointed and annoyed because of the lack of docs for the latest Windows Client/Server products.
IMHO Windows Server should have offered the possibility to use Wake On Lan too. This is a much nicer way to do backups. It can't be that hard for Microsoft to send out a magic packet which would also be able to wake up a client when the user has shut it down.

Here is the link to the video I talk about:

BTW: Another possible problem may be some special BIOS power settings, for example on my brand new Dell PCs there is a default Deep Sleep option in the BIOS concerning states S4 and S5. When this option was turned on (default) it prevented Wake On Lan from working at all, although it was enabled in the BIOS, see e.g. here:

I first thought that Deep Sleep may be causing my wake-up problem but now according to the video above backup seems to rely on task scheduler only and not on WOL, let's see...

Hope this helps! Thank Microsoft for wasting our time so successfully!