HyperWol is a lightweight Windows application that listens for Wake-on-LAN (WoL) packets to start Hyper-V virtual machines (VMs) automatically. It generates a configuration file (config.json) listing all Hyper-V VMs and their MAC addresses, then monitors UDP port 7 for WoL packets to trigger VM startup via PowerShell. Designed for seamless integration with external scripts (e.g., PHP-based WoL triggers), HyperWol runs as a Windows service using NSSM (Non-Sucking Service Manager).
- Automatic VM Discovery: Detects all Hyper-V VMs and their MAC addresses, storing them in
C:\ProgramData\HyperWol\config.json. - WoL Listener: Listens on UDP port 7 for WoL magic packets and starts the corresponding VM.
- Service Integration: Runs as a Windows service under the Local System Account for continuous operation.
- Event Logging: Logs activity to Windows Event Viewer (under
HyperWolsource) for debugging. - Bundled Package: Includes
hyperwol.exe, NSSM,wolcmd, and scripts for easy setup and testing.
- Windows 10/11 or Windows Server with Hyper-V enabled.
- Administrative privileges for installation.
- Hyper-V virtual machines configured on the local computer.
-
Download the Package:
- Download
HyperWol.zipfrom the Releases page.
- Download
-
Extract the Package:
- Unzip
HyperWol.zipto a directory (e.g.,C:\Program Files\HyperWol). - The package contains:
hyperwol.exe: The main WoL listener application.nssm.exe: NSSM service manager.wolcmd.exe: WoL packet sender for testing.add-hyperwol-service.cmd: Script to install the service.test_wol.cmd: Script to test WoL locally.
- Unzip
-
Install the Service:
- Navigate to the extraction directory (e.g.,
C:\Program Files\HyperWol). - Right-click
add-hyperwol-service.cmdand select Run as administrator. - The script:
- Installs the
HyperWolservice using NSSM. - Configures the service to auto-start under the Local System Account.
- Starts the service.
- Installs the
- Navigate to the extraction directory (e.g.,
-
Verify Installation:
- Open Command Prompt as administrator and run:
sc query HyperWol
- Ensure
STATE: 4 RUNNING.
- Ensure
- Check
C:\ProgramData\HyperWol\config.jsonfor VM details:type C:\ProgramData\HyperWol\config.json
- Open Command Prompt as administrator and run:
Use the included test_wol.bat script to send a WoL packet to a Hyper-V VM on the local machine:
-
Run the Test Script:
- Navigate to
C:\Program Files\HyperWol. - Right-click
test_wol.cmdand select Run as administrator:test_wol.cmd
- The script:
- Lists all Hyper-V VMs and their MAC addresses.
- Prompts you to select a VM (e.g.,
Machine1). - Sends a WoL packet to
127.0.0.1:7usingwolcmd.
- Navigate to
-
Verify VM Startup:
- Check the VM’s state in PowerShell:
Get-VM -Name "Machine1" | Select-Object Name, State
- Expect
State: Running.
- Expect
- Check the VM’s state in PowerShell:
-
Trigger WoL Remotely:
- Use a WoL client (e.g., a PHP script) to send a magic packet to the server’s IP (e.g.,
192.168.1.100) on port 7 with the VM’s MAC address (e.g.,00:15:5D:01:64:11). - Example using
wolcmd:wolcmd 00155D016411 192.168.1.100 255.255.255.0 7
- Use a WoL client (e.g., a PHP script) to send a magic packet to the server’s IP (e.g.,
-
Monitor Logs:
- Open Event Viewer (
eventvwr.msc), navigate to Windows Logs > Application, and filter forHyperWol. - Look for messages like “Listening for WoL packets on 0.0.0.0:7” or “Successfully started VM Machine1”.
- Open Event Viewer (
-
Service Not Starting:
- Check service status:
sc query HyperWol
- Ensure UDP port 7 is free:
netstat -ano | findstr :7
- Check Event Viewer for
HyperWolerrors.
- Check service status:
-
No VMs in
config.json:- Verify Hyper-V is enabled and VMs exist:
Get-VM - Ensure the Local System Account has Hyper-V access.
- Verify Hyper-V is enabled and VMs exist:
-
WoL Not Working:
- Test locally with
test_wol.cmd.
- Test locally with
- Stop and remove the service:
net stop HyperWol sc delete HyperWol
- MIT License. See LICENSE for details.
NSSM for service management.
wolcmd for WoL packet testing.