Score:0

How to automate a Wake On Lan command in GRUB2 boot

al flag

I have 3 computers in my home installation, one (call it FREEBNT) is my server, with Ubuntu server 22.04.1 LTS, acting mainly as a NAS server. Other (call it XAUDIOSERVER) is a Ubuntu Desktop with audio functionality. And the third one (call it TACENS10) is my main PC, where I work, with Windows 10 installed.

All of them are available to Wake up via WOL, and I usually wake them on all because I use all of them at the same time. I can wake them up via a WOL app in my Android phone. But now, what I want to achieve, is to automate a command at TACENS10 boot, so that, when I power on TACENS10, it automatically wakes up the other two computers. I imagine that it could be easier to do with GRUB2 than the Windows 10 bootloader. So I'm available to repartition my hard disk to include a (GRUB2) partition if necessary.

I have searched in google and this forum and I didn't see anything seeming like my problem.

So, is it possible to run a Wake-On-Lan command from GRUB2? and, how do I install and configure GRUB2 to do this task? I (obviously) have the MAC addresses of both computers. Also note, that I don't have Ubuntu installed on my TACENS10, nor I'm planning to do, so I would need to run a Live Ubuntu session and create a boot partition, to include only Windows 10, or maybe if I can, Windows 10 - WakeOnLAN and also Windows 10 - no WakeOnLAN, in case I don't want to wake up the others.

dummyuser avatar
uy flag
If I understand you correctly you want to start `TACENS10` the this ubuntu serever should start 2 other server via WOL. Ubuntu has a `wakeonlan` packeage that dos WOL. Grub (or grub2) is not the place to do this, but you may write simple service (or cron) that does the job at boot.
BorHacker avatar
al flag
Yes, I understand, but the only limitation to your idea is that in **TACENS10** I don't have Ubuntu installed, but Windows 10. So I need to use GRUB2. Are you sure I can't do it from GRUB2?
mook765 avatar
cn flag
@BorHacker Grub2 doesn't provide such a feature, thus it's not possible to do.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.