A Wake-on-LAN system for remote management of Proxmox VE virtual machines and containers.
Install with one command:
wget -qO- https://raw.githubusercontent.com/SpotlightForBugs/dosthol-wol/master/install-oneline.sh | bash
Uninstall with one command:
wget -qO- https://raw.githubusercontent.com/SpotlightForBugs/dosthol-wol/master/uninstall-oneline.sh | bash
dosthol consists of two main components:
- dostholc.sh - Client script for sending remote commands
- dosthold.sh - Daemon script that runs on the Proxmox host to receive and process commands
- Wake up virtual machines and containers
- Shutdown, power off, suspend, resume, and reset VMs
- Support for both QEMU VMs and LXC containers
- Broadcast and unicast packet support
- Verbose logging and debugging options
For the fastest installation, use this one-liner in your Proxmox VE console:
wget -qO- https://raw.githubusercontent.com/SpotlightForBugs/dosthol-wol/master/install-oneline.sh | bash
This will automatically:
- Install all dependencies
- Download the latest version from GitHub
- Install and configure the service
- Set up firewall rules
- Test the installation
To completely remove dosthol from your system:
wget -qO- https://raw.githubusercontent.com/SpotlightForBugs/dosthol-wol/master/uninstall-oneline.sh | bash
- Proxmox VE 4.x or later
socat
package installedgawk
(GNU awk) installedxxd
utility (usually part of vim-common)
apt update
apt install socat gawk vim-common
- Copy the scripts to the appropriate locations:
cp dosthold.sh /usr/local/bin/
cp dostholc.sh /usr/local/bin/
chmod +x /usr/local/bin/dosthold.sh
chmod +x /usr/local/bin/dostholc.sh
- Install the systemd service:
cp dosthol.service /etc/systemd/system/
systemctl daemon-reload
systemctl enable dosthol.service
systemctl start dosthol.service
- Verify installation:
systemctl status dosthol.service
dostholc.sh -f FUNCTION -m MAC_ADDRESS [OPTIONS]
-
-f, --function
: Command to executewakeup
- Start the VM/containershutdown
- Gracefully shutdown the VM/containerpoweroff
- Force power off the VM/containersuspend
- Suspend the VM/containerresume
- Resume the VM/containerreset
- Reset the VM/container (QEMU only)
-
-m, --mac
: Target MAC address (format: 11:22:33:44:55:66) -
-v, --verbose
: Verbose output (0=quiet, 1=verbose, default=0) -
-i, --ip
: Target IP address or subnet (default: 255.255.255.255 for broadcast)
# Wake up a VM with MAC 00:11:22:33:44:55
dostholc.sh -f wakeup -m 00:11:22:33:44:55
# Shutdown a VM with verbose output
dostholc.sh -f shutdown -m 00:11:22:33:44:55 -v 1
# Send command to specific subnet
dostholc.sh -f resume -m 00:11:22:33:44:55 -i 192.168.1.255
To find the MAC addresses of your VMs:
# For QEMU VMs
grep -r "net[0-9]:" /etc/pve/local/qemu-server/ | grep -ioE "([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}"
# For LXC containers
grep -r "net[0-9]:" /etc/pve/local/lxc/ | grep -ioE "([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}"
The daemon listens on UDP port 9. Ensure this port is accessible from your client machines.
If using a firewall, allow UDP port 9:
# UFW
ufw allow 9/udp
# iptables
iptables -A INPUT -p udp --dport 9 -j ACCEPT
The daemon logs to syslog. View logs with:
journalctl -u dosthol.service -f
- Service not starting: Check if socat is installed
- Commands not working: Verify MAC address format and VM existence
- Network issues: Ensure UDP port 9 is not blocked by firewall
Enable verbose output on the client:
dostholc.sh -f wakeup -m 00:11:22:33:44:55 -v 1
systemctl status dosthol.service
journalctl -u dosthol.service --no-pager -l
- The system uses UDP broadcast packets which are not encrypted
- MAC addresses can be spoofed
- Consider network segmentation for production use
- Restrict access to the Proxmox host network
Distributed under the terms of the GNU General Public License v2
Oliver Jaksch [email protected]
- v0.5 - nothing changed
- v0.4 - nothing changed
- v0.3 (2016-03-11) - Parameter parsing, help extended, some beautifyings
- v0.2 (2016-03-07) - Renamed dosthol to dosthold, created client dostholc, finished more commands, turned to socat
- v0.1 (2016-03-06) - Initial work; starting virtual machines per wake-on-lan works
- v0.5 (2019-03-17) - Beautify shell execs, limit grep to find only one result (thanks cheffe)
- v0.4 (2017-01-03) - Expanded Resume: Send a key before resume (Windows Standby)
- v0.3 (2016-03-11) - Fixed typo in dosthol.service
- v0.2 (2016-03-07) - Renamed dosthol to dosthold, created client dostholc, finished more commands, turned to socat
- v0.1 (2016-03-06) - Initial work; starting virtual machines per wake-on-lan works