[GH-ISSUE #2] Improvement Suggestion: Magic Packet Port determines Power function #1

Closed
opened 2026-02-27 07:15:06 +03:00 by kerem · 2 comments
Owner

Originally created by @abishur on GitHub (Nov 21, 2022).
Original GitHub issue: https://github.com/jedrw/proxmox_wol/issues/2

Hey, I wanted to say thanks for making this, it's working like a champ to wake my VMs. (I'm running docker in an LXC container on Proxmox in unprivileged mode in case anyone is wondering how to set it up later)

I was looking at this thread where they come at the issue from a different direction than you took to wake the VM and interestingly they included the following power options:
Wake up
Shutdown
Power Off
Suspend
Resume
Reboot
Reset

I was curious what your thoughts were about letting the port the magic packet came through on determine which power function was applied to the VM. Most the WoL packages I've looked at let me specify the port I want to use so it would be interesting if I could specify one port in the config file, say 9, to power it on and a second port, port 7 for example, to suspend it.

What are your thoughts?

Originally created by @abishur on GitHub (Nov 21, 2022). Original GitHub issue: https://github.com/jedrw/proxmox_wol/issues/2 Hey, I wanted to say thanks for making this, it's working like a champ to wake my VMs. (I'm running docker in an LXC container on Proxmox in unprivileged mode in case anyone is wondering how to set it up later) I was looking at [this thread](https://forum.proxmox.com/threads/update-wake-and-other-on-lan-for-vms-v0-3.26381/) where they come at the issue from a different direction than you took to wake the VM and interestingly they included the following power options: Wake up Shutdown Power Off Suspend Resume Reboot Reset I was curious what your thoughts were about letting the port the magic packet came through on determine which power function was applied to the VM. Most the WoL packages I've looked at let me specify the port I want to use so it would be interesting if I could specify one port in the config file, say 9, to power it on and a second port, port 7 for example, to suspend it. What are your thoughts?
kerem closed this issue 2026-02-27 07:15:06 +03:00
Author
Owner

@jedrw commented on GitHub (Nov 21, 2022):

@abishur that's interesting, thanks. I couldn't see anything about using different ports, looked to me like they were breaking the wakeonlan specification by using different headers for the magic packet to signify different actions. For example, from their code:

"FF:FF:FF:FF:FF:FF")	CMDONLAN="start" ;;
"EE:EE:EE:EE:EE:EE")	CMDONLAN="shutdown" ;;
"DD:DD:DD:DD:DD:DD")	CMDONLAN="stop" ;;
"CC:CC:CC:CC:CC:CC")	CMDONLAN="suspend" ;;
"BB:BB:BB:BB:BB:BB")	CMDONLAN="resume" ;;
"AA:AA:AA:AA:AA:AA")	CMDONLAN="reset" ;;
"AB:AB:AB:AB:AB:AB")	CMDONLAN="reboot" ;;

However it would need it's own client to really make good use of the functionality... no wakeonlan packages will write different headers AFAIK. A web interface would be far more flexible, on which note...

What's your use case? You may want to take a look at another of my repos, also available as a docker container, which provides a web dashboard for quick startup/shutdown of VMs. https://github.com/lupinelab/vmupdown

I want to update it to make it a little less specific to my old use case anyway so could add some different states you can put the VM into while I'm at it if you're interested?

<!-- gh-comment-id:1322789768 --> @jedrw commented on GitHub (Nov 21, 2022): @abishur that's interesting, thanks. I couldn't see anything about using different ports, looked to me like they were breaking the wakeonlan specification by using different headers for the magic packet to signify different actions. For example, from their code: ``` "FF:FF:FF:FF:FF:FF") CMDONLAN="start" ;; "EE:EE:EE:EE:EE:EE") CMDONLAN="shutdown" ;; "DD:DD:DD:DD:DD:DD") CMDONLAN="stop" ;; "CC:CC:CC:CC:CC:CC") CMDONLAN="suspend" ;; "BB:BB:BB:BB:BB:BB") CMDONLAN="resume" ;; "AA:AA:AA:AA:AA:AA") CMDONLAN="reset" ;; "AB:AB:AB:AB:AB:AB") CMDONLAN="reboot" ;; ``` However it would need it's own client to really make good use of the functionality... no wakeonlan packages will write different headers AFAIK. A web interface would be far more flexible, on which note... What's your use case? You may want to take a look at another of my repos, also available as a docker container, which provides a web dashboard for quick startup/shutdown of VMs. https://github.com/lupinelab/vmupdown I want to update it to make it a little less specific to my old use case anyway so could add some different states you can put the VM into while I'm at it if you're interested?
Author
Owner

@abishur commented on GitHub (Nov 22, 2022):

You are correct, they are using headers, I was just thinking that the same could be accomplished using port numbers with minimal effort.

It's entirely possible I'm misunderstanding the work flow of the code, but my thought process was since currently you have a spot in the config file to specify wol_port that then does an API call to start the vm if it is found, a second config option could be something like "suspend_port" and any magic packet that came in on that port would instead issue a suspend command.

I have a couple VMs that I use for specialized programming software (they don't play nice with other vendor's software), for these VMs I let them hibernate when not in use which apparently stops the VM? I don't need them sitting there taking up resources when I only need them intermittently.

My desire was to not have to log in to Proxmox every time I needed to start up the VM but use the Wake On Lan integration from Home Assistant. After the leading "F" patch it does this perfectly. To expand it out was admittedly an idle thought that I thought might expand the usefulness of this already quite useful container, but not necessarily one that I find myself in immediate need of 😉

<!-- gh-comment-id:1323084174 --> @abishur commented on GitHub (Nov 22, 2022): You are correct, they are using headers, I was just thinking that the same could be accomplished using port numbers with minimal effort. It's entirely possible I'm misunderstanding the work flow of the code, but my thought process was since currently you have a spot in the config file to specify wol_port that then does an API call to start the vm if it is found, a second config option could be something like "suspend_port" and any magic packet that came in on that port would instead issue a suspend command. I have a couple VMs that I use for specialized programming software (they don't play nice with other vendor's software), for these VMs I let them hibernate when not in use which apparently stops the VM? I don't need them sitting there taking up resources when I only need them intermittently. My desire was to not have to log in to Proxmox every time I needed to start up the VM but use the Wake On Lan integration from Home Assistant. After the leading "F" patch it does this perfectly. To expand it out was admittedly an idle thought that I thought might expand the usefulness of this already quite useful container, but not necessarily one that I find myself in immediate need of 😉
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmox_wol-jedrw#1
No description provided.