Windows Server 2003 (and XP) logon screen power config to allow reliable ACPI shutdown

It can sometimes be difficult to get Windows systems to shut down reliably using an ACPI signal (either the power button for a physical system, or an equivalent signal from a virtual machine hypervisor). Generally you find after the system has been on for a period of time, the first ACPI signal merely wakes up the screen. On a physical system this makes some sense – it shows you the system is in fact on already. To turn a physical system off you just press the power button again. For a virtual system this is not convenient, especially when you want the system to shut down cleanly when the host system is going down. The trick is to keep everything, particularly the screen, alive so that the first ACPI signal does actually initiate shutdown.

Power scheme configuration

Server 2003 and XP can do odd things with the standard power schemes. The most reliable way to make a power scheme stick appears to be to create a custom one. The registry files here create a new power scheme that really does leave the monitor on permanently.

For the current user:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Control Panel\PowerCfg\PowerPolicies\6]
"Policies"=hex:01,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,32,32,00,00,04,00,00,00,04,00,\
  00,00,00,00,3d,77,2e,f2,07,00,00,00,00,00,84,03,00,00,00,00,00,00,08,07,00,\
  00,00,00,64,64,64,64,91,7c
"Name"="Really always on"
"Description"="Non-standard power scheme that keeps the monitor on to allow reliable ACPI shutdowns"

For the default user (i.e. the one system uses at the logon screen):

Windows Registry Editor Version 5.00

[HKEY_USERS\.DEFAULT\Control Panel\PowerCfg\PowerPolicies\6]
"Policies"=hex:01,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,32,32,00,00,04,00,00,00,04,00,\
  00,00,00,00,3d,77,2e,f2,07,00,00,00,00,00,84,03,00,00,00,00,00,00,08,07,00,\
  00,00,00,64,64,64,64,91,7c
"Name"="Really always on"
"Description"="Non-standard power scheme that keeps the monitor on to allow reliable ACPI shutdowns"

Save these as .reg files and merge them in as necessary.

Compare these policies to the “always on” policy – there are some differences in the data. It seems that quite often the standard policies get overwritten by something, possibly the global policy. Note that these policies have timeouts associated with the DC (i.e. battery) power profile, but this isn’t relevant for virtual servers (might want to think about this for physical systems on a UPS). Use ”powercfg -query” to see the power plan details.

Go to ”[HKEY_USERS\.DEFAULT\Control Panel\PowerCfg]” and set the ”CurrentPowerPolicy” value to ”6”.

Screen saver configuration

The screen saver also seems to interfere with things. To turn it off go to ”[HKEY_USERS\.DEFAULT\Control Panel\Desktop]” and set the ”ScreenSaveActive” value to ”0”.

Group Policy configuration

Remember to check that you can shut down the system without being logged on, as per Windows Server 2003 shutdown Group Policy

Windows Server 2003 change to multiprocessor HAL

According to http://technet.microsoft.com/en-us/library/cc782277(v=ws.10).aspx this should be simple. Trying it on a Server 2003 VM (that had been converted from Virtual Server 2005) didn’t give the options of the other HALs. The answer is at http://www.pimp-my-rig.com/2008/08/article-acpi-uniprocessor-to.html – use the command line devcon.exe tool and the .cmd script at http://www.pimp-my-rig.com/2008/10/acpi-multiprocessor-hal-upgrade-script.html .

Devcon can be downloaded from Microsoft at http://support.microsoft.com/kb/311272

The script is:

@echo off
@title "Upgrading to ACPI Multi-Processor HAL.."
cls

echo ====================================================
echo Upgrading to ACPI Multi-Processor HAL..
echo ====================================================
echo.
echo please wait..

devcon sethwid @ROOT\PCI_HAL\0000 := !E_ISA_UP !ACPIPIC_UP !ACPIAPIC_UP !ACPIAPIC_MP !MPS_UP !MPS_MP !SGI_MPS_MP !SYSPRO_MP !SGI_MPS_MP > nul
devcon sethwid @ROOT\ACPI_HAL\0000 := !E_ISA_UP !ACPIPIC_UP !ACPIAPIC_UP !ACPIAPIC_MP !MPS_UP !MPS_MP !SGI_MPS_MP !SYSPRO_MP !SGI_MPS_MP > nul
devcon sethwid @ROOT\PCI_HAL\0000 := +ACPIAPIC_MP > nul
devcon sethwid @ROOT\ACPI_HAL\0000 := +ACPIAPIC_MP > nul
devcon update %windir%\inf\hal.inf ACPIAPIC_MP > nul

echo.
echo ====================================================
echo Script Completed: press any key to reboot..
echo ====================================================

pause > nul

devcon reboot