Jump to content
dummzeuch

Automatically make your PC wake up at a given time

Recommended Posts

Due the the COVID19 pandemic I am currently working from home, using Putty + ssh + Remote Desktop to log into and work on my office PC. For this to work, the office PC must be turned on and booted. So far I have let it running 24h which is really a waste of energy but since sometimes nobody is in the office at all, that was the most fool proof way.

Today I have had some time at my hands waiting for an Ubuntu server to finish installing, so I thought about alternatives.

 

... read on in my blog post.

 

  • Like 1

Share this post


Link to post

About Wake on LAN: I have not seen PC without WOL support for at least 15 years... But as far as I know, in Windows, WOL must be enabled in network adapter's properties.

Share this post


Link to post
2 hours ago, Vandrovnik said:

About Wake on LAN: I have not seen PC without WOL support for at least 15 years... But as far as I know, in Windows, WOL must be enabled in network adapter's properties.

I can't look at my office PC now (it's in the office, I am not and I can't connect to it because it's hibernated 😉

), but on my home PC there is indeed such a setting:

 

Ethernet_Controller_Properties.png.42d4fb25af83d6236c4708d4d3588bc4.png

 

 

EDIT: Wonders of remote access: Yes, you are right, it's supported. I just ssh'd into the LAN installed etherwake and woke up my PC using the wakeonlan command. Apparently the option just doesn't show up in the BIOS.

 

Thank you very much for this hint!

Edited by dummzeuch
  • Like 1

Share this post


Link to post

I have usually seen a WOL-related checkbox also on the tab "Power Management", but when it works now, it probably does not need to be touched 🙂

Share this post


Link to post
1 hour ago, David Heffernan said:

How many ports do you have open on your public facing router? 

Only one for ssh (but not the default port). Everything is tunnelled through an ssh connection.

  • Like 1

Share this post


Link to post

You could check your BIOS if it supports timed power on events. 

I did setup my computer at work to wake up on a workday at a specific time, which is just fine for my workflow.

 

Only downside is, on a vacation day I have to remote in to shut it down again.

Edited by Martin Wienold

Share this post


Link to post
44 minutes ago, Martin Wienold said:

You could check your BIOS if it supports timed power on events. 

I did setup my computer at work to wake up on a workday at a specific time, which is just fine for my workflow.

 

Only downside is, on a vacation day I have to remote in to shut it down again.

It does, but unfortunately only on a daily basis which would mean that it starts on weekends (and doesn't shut down so it runs all weekend). WOL is probably the easiest option for me (now that I know that it works) since I log on to an ssh server first thing anyway, so I can simply call a script that wakes up my PC. I could even automate via .profile it but that would mean that PC starts every time I log on even if I don't need it.

Share this post


Link to post
1 minute ago, dummzeuch said:

It does, but unfortunately only on a daily basis which would mean that it starts on weekends (and doesn't shut down so it runs all weekend). WOL is probably the easiest option for me (now that I know that it works) since I log on to an ssh server first thing anyway, so I can simply call a script that wakes up my PC. I could even automate via .profile it but that would mean that PC starts every time I log on even if I don't need it.

Or you could just have a scheduled task call shutdown on weekends.

Share this post


Link to post
14 hours ago, dummzeuch said:

Only one for ssh (but not the default port). Everything is tunnelled through an ssh connection.

The WOL packet is also being routed it would seem. 

Share this post


Link to post
36 minutes ago, David Heffernan said:

The WOL packet is also being routed it would seem. 

No, that one is sent by the computer which runs the ssh server.

  • Like 1

Share this post


Link to post
On 3/29/2020 at 2:38 AM, dummzeuch said:

It does, but unfortunately only on a daily basis which would mean that it starts on weekends (and doesn't shut down so it runs all weekend).

Both of my PCs at home are old Dells, running XP and Win7, and they both have BIOSes that support scheduling power events on weekdays only.  So they both power up before I start a work day, and as long as I shut them down cleanly (ie, not by holding down the power button, which I do have to do sometimes) then they power up correctly on the next weekday.  No weekend runs, unless I leave them powered on Friday night (for backups, etc).

 

Share this post


Link to post
On 3/29/2020 at 11:49 AM, Martin Wienold said:

I did setup my computer at work to wake up on a workday at a specific time, which is just fine for my workflow.

 

Only downside is, on a vacation day I have to remote in to shut it down again.

Just configure it to hibernate after 1hr of inactivity.

  • Like 1

Share this post


Link to post

While we were working from home the office building decided that it's a good time to test the electric breakers. This resulted someone having to travel on-site and turning all PCs on one-by-one on the whole floor.

I started to experiment; my plan is to write a simple service application which is discovering PCs in a pre-defined range and provides a web interface where you can log on with your domain credentials and choose which PC you would like to wake up with WOL. If I get the green light from management I think this is going to be our solution.

I'll have to test though, if a WOL broadcast packet actually works out-of-subnet or not; or what configuration is required on the network devices as I have no personal experience with this.

Share this post


Link to post
10 hours ago, aehimself said:

I started to experiment; my plan is to write a simple service application which is discovering PCs in a pre-defined range and provides a web interface where you can log on with your domain credentials and choose which PC you would like to wake up with WOL.

 

Aparently many modern computers are already configured to wake on any LAN activity, not just the WOL magic package. So e.g. trying to RemoteDesktop into a computer might be sufficient to wake it up. I tested this with two of our computers, both of which had a special setting to restrict WOL to the "magic package", which seems to be off by default.

 

But I am not sure from which state this will work. WOL didn't work at the one time I actually shut down the computer rather than hibernating it. Another one didn't wake up from sleep. The only state for which this has always worked for me was hibernate.

Share this post


Link to post
1 hour ago, dummzeuch said:

Aparently many modern computers are already configured to wake on any LAN activity

Strange. Won't local server's periodic activity wake PC every time then?

Share this post


Link to post

To be honest I never heard of this until now, but I'm sure our PCs do not support this (or - it's not enabled). I'll do my research on it; it would be an easier solutionfor sure.

Share this post


Link to post
6 minutes ago, Fr0sT.Brutal said:

Strange. Won't local server's periodic activity wake PC every time then?

What periodic activity you mean? In normal circumstances a regular server (DHCP, DNS, File server) is not looking for offline clients. Regular protocols are not even looking for Clients at all as most of the actions are initiated by the Client.

Share this post


Link to post
25 minutes ago, Fr0sT.Brutal said:

Strange. Won't local server's periodic activity wake PC every time then?

Apparently not. At least I have not seen any spontaneous awakenings 😉 of our office computers.

 

There are three check boxes on the "Power Management" tab of the network controller properties (on my computer):

 

* Allow the computer to turn off this device to save power

* Allow this device to wake the computer

  * Only allow a magic packet to wake the computer

 

On my computer, all of them are set. On a colleagues' computer the last one was not set. My colleague said that he didn't touch this (but on the other hand I don't remember doing that either on my computer), so I don't know what the default is. I can only assume that it depends on some circumstances during the installation. Maybe different hardware, or maybe whether the computer belongs to a domain or not (mine doesn't, the colleague's does).

Share this post


Link to post
2 hours ago, aehimself said:

What periodic activity you mean?

I'm pretty sure local network servers send periodic packets to each of network peer. Maybe when someone invokes list of network machines.

2 hours ago, dummzeuch said:

Apparently not. At least I have not seen any spontaneous awakenings 😉 of our office computers.

Good to know that! I've never dealt with this technology before, now I'll try to save it in my mind's set of known tools 🙂

Share this post


Link to post
20 minutes ago, Fr0sT.Brutal said:

I'm pretty sure local network servers send periodic packets to each of network peer. Maybe when someone invokes list of network machines.

Now this applies only to Windows as I'm not working with Linux machines, but the Windows Computer Browser service is basically collecting a bunch of broadcasted information and then others connect to it via TCP (source). If the activity-based startup is locked to an IP it will not be triggered by broadcast messages; the rest of the communication will be between other PCs and the current directory master.

 

Alas, this only applies for standard services. My program attempting to ping this IP to see if it's alive or not will trigger the power on for sure.

  • Thanks 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×